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)]"
31 @echo "==== NOTE ===="
32 @echo "It is recommended to build DPDK using 'meson' and 'ninja'"
33 @echo "See https://doc.dpdk.org/guides/linux_gsg/build_dpdk.html for instructions"
34 @echo "Building DPDK with 'make' will be deprecated in a future release"
35 @echo "=============="
39 @rm -rf $(RTE_OUTPUT)/include $(RTE_OUTPUT)/app \
41 $(RTE_OUTPUT)/hostlib $(RTE_OUTPUT)/kmod
42 @[ -d $(RTE_OUTPUT)/include ] || mkdir -p $(RTE_OUTPUT)/include
43 @$(RTE_SDK)/buildtools/gen-config-h.sh $(RTE_OUTPUT)/.config \
44 > $(RTE_OUTPUT)/include/rte_config.h
45 $(Q)$(MAKE) -f $(RTE_SDK)/GNUmakefile gcovclean
49 .PHONY: $(ROOTDIRS-y) $(ROOTDIRS-)
50 $(ROOTDIRS-y) $(ROOTDIRS-):
51 @[ -d $(BUILDDIR)/$@ ] || mkdir -p $(BUILDDIR)/$@
53 $(Q)$(MAKE) S=$@ -f $(RTE_SRCDIR)/$@/Makefile -C $(BUILDDIR)/$@ all
54 @if [ $@ = drivers ]; then \
55 $(MAKE) -f $(RTE_SDK)/mk/rte.combinedlib.mk; \
60 $(Q)if [ -f $(RTE_SRCDIR)/$*/Makefile -a -d $(BUILDDIR)/$* ]; then \
61 $(MAKE) S=$* -f $(RTE_SRCDIR)/$*/Makefile -C $(BUILDDIR)/$* clean ; \
64 RTE_MAKE_SUBTARGET ?= all
66 %_sub: $(addsuffix _sub,$(*))
67 @echo $(addsuffix _sub,$(*))
68 @[ -d $(BUILDDIR)/$* ] || mkdir -p $(BUILDDIR)/$*
70 $(Q)$(MAKE) S=$* -f $(RTE_SRCDIR)/$*/Makefile -C $(BUILDDIR)/$* \