1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2014 6WIND S.A.
4 # examples application are seen as external applications which are
7 export BUILDING_RTE_SDK
9 # Build directory is given with O=
10 O ?= $(RTE_SDK)/examples
12 # Target for which examples should be built.
15 # list all available configurations
16 EXAMPLES_CONFIGS := $(patsubst $(RTE_SRCDIR)/config/defconfig_%,%,\
17 $(wildcard $(RTE_SRCDIR)/config/defconfig_$(T)))
18 EXAMPLES_TARGETS := $(addsuffix _examples,\
19 $(filter-out %~,$(EXAMPLES_CONFIGS)))
22 examples: $(EXAMPLES_TARGETS)
25 @echo ================== Build examples for $*
26 $(Q)if [ ! -d "${RTE_SDK}/${*}" ]; then \
27 echo "Target ${*} does not exist in ${RTE_SDK}/${*}." ; \
28 echo -n "Please install DPDK first (make install) or use another " ; \
29 echo "target argument (T=target)." ; \
32 $(MAKE) -C examples O=$(abspath $(O)) RTE_TARGET=$(*); \
35 EXAMPLES_CLEAN_TARGETS := $(addsuffix _examples_clean,\
36 $(filter-out %~,$(EXAMPLES_CONFIGS)))
38 .PHONY: examples_clean
39 examples_clean: $(EXAMPLES_CLEAN_TARGETS)
42 @echo ================== Clean examples for $*
43 $(Q)if [ ! -d "${RTE_SDK}/${*}" ]; then \
44 echo "Target ${*} does not exist in ${RTE_SDK}/${*}." ; \
45 echo -n "Please install DPDK first (make install) or use another " ; \
46 echo "target argument (T=target)." ; \
49 $(MAKE) -C examples O=$(abspath $(O)) RTE_TARGET=$(*) clean; \