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
44 .PHONY: $(ROOTDIRS-y) $(ROOTDIRS-)
45 $(ROOTDIRS-y) $(ROOTDIRS-):
46 @[ -d $(BUILDDIR)/$@ ] || mkdir -p $(BUILDDIR)/$@
48 $(Q)$(MAKE) S=$@ -f $(RTE_SRCDIR)/$@/Makefile -C $(BUILDDIR)/$@ all
49 @if [ $@ = drivers ]; then \
50 $(MAKE) -f $(RTE_SDK)/mk/rte.combinedlib.mk; \
55 $(Q)if [ -f $(RTE_SRCDIR)/$*/Makefile -a -d $(BUILDDIR)/$* ]; then \
56 $(MAKE) S=$* -f $(RTE_SRCDIR)/$*/Makefile -C $(BUILDDIR)/$* clean ; \
59 RTE_MAKE_SUBTARGET ?= all
61 %_sub: $(addsuffix _sub,$(*))
62 @echo $(addsuffix _sub,$(*))
63 @[ -d $(BUILDDIR)/$* ] || mkdir -p $(BUILDDIR)/$*
65 $(Q)$(MAKE) S=$* -f $(RTE_SRCDIR)/$*/Makefile -C $(BUILDDIR)/$* \