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
17 drivers: | lib buildtools
18 app: | lib buildtools drivers
19 test: | lib buildtools drivers
22 # build and clean targets
25 CLEANDIRS = $(addsuffix _clean,$(ROOTDIRS-y) $(ROOTDIRS-n) $(ROOTDIRS-))
29 @echo "Build complete [$(RTE_TARGET)]"
33 @rm -rf $(RTE_OUTPUT)/include $(RTE_OUTPUT)/app \
35 $(RTE_OUTPUT)/hostlib $(RTE_OUTPUT)/kmod
36 @[ -d $(RTE_OUTPUT)/include ] || mkdir -p $(RTE_OUTPUT)/include
37 @$(RTE_SDK)/buildtools/gen-config-h.sh $(RTE_OUTPUT)/.config \
38 > $(RTE_OUTPUT)/include/rte_config.h
39 $(Q)$(MAKE) -f $(RTE_SDK)/GNUmakefile gcovclean
46 .PHONY: $(ROOTDIRS-y) $(ROOTDIRS-)
47 $(ROOTDIRS-y) $(ROOTDIRS-):
48 @[ -d $(BUILDDIR)/$@ ] || mkdir -p $(BUILDDIR)/$@
50 $(Q)$(MAKE) S=$@ -f $(RTE_SRCDIR)/$@/Makefile -C $(BUILDDIR)/$@ all
51 @if [ $@ = drivers ]; then \
52 $(MAKE) -f $(RTE_SDK)/mk/rte.combinedlib.mk; \
57 $(Q)if [ -f $(RTE_SRCDIR)/$*/Makefile -a -d $(BUILDDIR)/$* ]; then \
58 $(MAKE) S=$* -f $(RTE_SRCDIR)/$*/Makefile -C $(BUILDDIR)/$* clean ; \
61 RTE_MAKE_SUBTARGET ?= all
63 %_sub: $(addsuffix _sub,$(*))
64 @echo $(addsuffix _sub,$(*))
65 @[ -d $(BUILDDIR)/$* ] || mkdir -p $(BUILDDIR)/$*
67 $(Q)$(MAKE) S=$* -f $(RTE_SRCDIR)/$*/Makefile -C $(BUILDDIR)/$* \