test mbuf attach
[dpdk.git] / mk / rte.sdkexamples.mk
1 # SPDX-License-Identifier: BSD-3-Clause
2 # Copyright(c) 2014 6WIND S.A.
3
4 # examples application are seen as external applications which are
5 # not part of SDK.
6 BUILDING_RTE_SDK :=
7 export BUILDING_RTE_SDK
8
9 # Build directory is given with O=
10 O ?= $(RTE_SDK)/examples
11
12 # Target for which examples should be built.
13 T ?= *
14
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)))
20
21 .PHONY: examples
22 examples: $(EXAMPLES_TARGETS)
23
24 %_examples:
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)." ; \
30                 false ; \
31         else \
32                 $(MAKE) -C examples O=$(abspath $(O)) RTE_TARGET=$(*); \
33         fi
34
35 EXAMPLES_CLEAN_TARGETS := $(addsuffix _examples_clean,\
36         $(filter-out %~,$(EXAMPLES_CONFIGS)))
37
38 .PHONY: examples_clean
39 examples_clean: $(EXAMPLES_CLEAN_TARGETS)
40
41 %_examples_clean:
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)." ; \
47                 false ; \
48         else \
49                 $(MAKE) -C examples O=$(abspath $(O)) RTE_TARGET=$(*) clean; \
50         fi