1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2010-2015 Intel Corporation
5 # include rte.vars.mk if config file exists
7 ifeq (,$(wildcard $(RTE_OUTPUT)/.config))
8 $(error "need a make config first")
10 include $(RTE_SDK)/mk/rte.vars.mk
13 # allow exec-env specific targets
14 -include $(RTE_SDK)/mk/exec-env/$(RTE_EXEC_ENV)/rte.custom.mk
18 drivers: | lib buildtools
19 app: | lib buildtools drivers
20 test: | lib buildtools drivers
23 # build and clean targets
26 CLEANDIRS = $(addsuffix _clean,$(ROOTDIRS-y) $(ROOTDIRS-n) $(ROOTDIRS-))
30 @echo "Build complete [$(RTE_TARGET)]"
34 @rm -rf $(RTE_OUTPUT)/include $(RTE_OUTPUT)/app \
36 $(RTE_OUTPUT)/hostlib $(RTE_OUTPUT)/kmod
37 @[ -d $(RTE_OUTPUT)/include ] || mkdir -p $(RTE_OUTPUT)/include
38 @$(RTE_SDK)/buildtools/gen-config-h.sh $(RTE_OUTPUT)/.config \
39 > $(RTE_OUTPUT)/include/rte_config.h
40 $(Q)$(MAKE) -f $(RTE_SDK)/GNUmakefile gcovclean
47 .PHONY: $(ROOTDIRS-y) $(ROOTDIRS-)
48 $(ROOTDIRS-y) $(ROOTDIRS-):
49 @[ -d $(BUILDDIR)/$@ ] || mkdir -p $(BUILDDIR)/$@
51 $(Q)$(MAKE) S=$@ -f $(RTE_SRCDIR)/$@/Makefile -C $(BUILDDIR)/$@ all
52 @if [ $@ = drivers ]; then \
53 $(MAKE) -f $(RTE_SDK)/mk/rte.combinedlib.mk; \
58 $(Q)if [ -f $(RTE_SRCDIR)/$*/Makefile -a -d $(BUILDDIR)/$* ]; then \
59 $(MAKE) S=$* -f $(RTE_SRCDIR)/$*/Makefile -C $(BUILDDIR)/$* clean ; \
62 RTE_MAKE_SUBTARGET ?= all
64 %_sub: $(addsuffix _sub,$(*))
65 @echo $(addsuffix _sub,$(*))
66 @[ -d $(BUILDDIR)/$* ] || mkdir -p $(BUILDDIR)/$*
68 $(Q)$(MAKE) S=$* -f $(RTE_SRCDIR)/$*/Makefile -C $(BUILDDIR)/$* \