* [dpdk-dev] [PATCH v3 0/6] examples: add a new makefile to build all examples
@ 2014-05-16 8:18 Olivier Matz
2014-05-16 8:18 ` [dpdk-dev] [PATCH v3 1/6] mk: introduce rte.extsubdir.mk Olivier Matz
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: Olivier Matz @ 2014-05-16 8:18 UTC (permalink / raw)
To: dev
This patch series adds a makefile to build all examples supported
by the configuration. It helps to check that all examples compile
after a dpdk modification.
After applying the patches, it is possible to build all examples for
given targets, given the installation directory:
# first, install the x86_64-default-linuxapp-gcc in
# ${RTE_SDK}/x86_64-default-linuxapp-gcc directory
user@droids:~/dpdk.org$ make install T=x86_64-default-linuxapp-gcc
# build examples for this new installation in
# ${RTE_SDK}/examples directory
user@droids:~/dpdk.org$ make examples T=x86_64-default-linuxapp-gcc
Or directly from examples directory:
user@droids:~/dpdk.org$ cd examples
user@droids:~/dpdk.org/examples$ make RTE_SDK=${PWD}/.. \
RTE_TARGET=x86_64-default-linuxapp-gcc
Changes included in v3:
- use x86_64-default-linuxapp-gcc instead of x86_64-ivshmem-linuxapp-gcc
for default RTE_TARGET of multi_process example (was a bad copy/paste).
- replace ifndef by ?=
- fix when O= is a relative directory
- exit if the installation directory does not exist
Changes included in v2:
- do not build kni example if CONFIG_RTE_LIBRTE_KNI is not set
- fix rte.extsubdir.mk when there are several levels of subdirectories
- allow to build examples directly from dpdk root directory
- explain in commit logs that it requires an install directory
Olivier Matz (6):
mk: introduce rte.extsubdir.mk
examples: use rte.extsubdir.mk to process subdirectories
examples: add a makefile to build all examples
examples: fix qos_sched makefile
examples: fix netmap_compat example
mk: add "make examples" target in root makefile
doc/build-sdk-quick.txt | 14 +++--
examples/Makefile | 68 ++++++++++++++++++++
examples/l2fwd-ivshmem/Makefile | 9 +--
examples/multi_process/Makefile | 16 +++--
examples/multi_process/client_server_mp/Makefile | 15 ++---
examples/netmap_compat/bridge/Makefile | 5 +-
examples/qos_sched/Makefile | 2 -
examples/quota_watermark/Makefile | 12 +---
mk/rte.extsubdir.mk | 53 ++++++++++++++++
mk/rte.sdkexamples.mk | 79 ++++++++++++++++++++++++
mk/rte.sdkroot.mk | 4 ++
11 files changed, 233 insertions(+), 44 deletions(-)
create mode 100644 examples/Makefile
create mode 100644 mk/rte.extsubdir.mk
create mode 100644 mk/rte.sdkexamples.mk
--
1.9.2
^ permalink raw reply [flat|nested] 8+ messages in thread
* [dpdk-dev] [PATCH v3 1/6] mk: introduce rte.extsubdir.mk
2014-05-16 8:18 [dpdk-dev] [PATCH v3 0/6] examples: add a new makefile to build all examples Olivier Matz
@ 2014-05-16 8:18 ` Olivier Matz
2014-05-16 8:18 ` [dpdk-dev] [PATCH v3 2/6] examples: use rte.extsubdir.mk to process subdirectories Olivier Matz
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Olivier Matz @ 2014-05-16 8:18 UTC (permalink / raw)
To: dev
This makefile can be included by a project that needs to build several
applications or libraries that are located in different directories.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
mk/rte.extsubdir.mk | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 53 insertions(+)
create mode 100644 mk/rte.extsubdir.mk
diff --git a/mk/rte.extsubdir.mk b/mk/rte.extsubdir.mk
new file mode 100644
index 0000000..f50f006
--- /dev/null
+++ b/mk/rte.extsubdir.mk
@@ -0,0 +1,53 @@
+# BSD LICENSE
+#
+# Copyright(c) 2014 6WIND S.A.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of 6WIND S.A. nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+MAKEFLAGS += --no-print-directory
+
+# output directory
+O ?= .
+BASE_OUTPUT ?= $(O)
+CUR_SUBDIR ?= .
+
+.PHONY: all
+all: $(DIRS-y)
+
+.PHONY: clean
+clean: $(DIRS-y)
+
+.PHONY: $(DIRS-y)
+$(DIRS-y):
+ @echo "== $@"
+ $(Q)$(MAKE) -C $(@) \
+ M=$(CURDIR)/$(@)/Makefile \
+ O=$(BASE_OUTPUT)/$(CUR_SUBDIR)/$(@)/$(RTE_TARGET) \
+ BASE_OUTPUT=$(BASE_OUTPUT) \
+ CUR_SUBDIR=$(CUR_SUBDIR)/$(@) \
+ S=$(CURDIR)/$(@) \
+ $(filter-out $(DIRS-y),$(MAKECMDGOALS))
--
1.9.2
^ permalink raw reply [flat|nested] 8+ messages in thread
* [dpdk-dev] [PATCH v3 2/6] examples: use rte.extsubdir.mk to process subdirectories
2014-05-16 8:18 [dpdk-dev] [PATCH v3 0/6] examples: add a new makefile to build all examples Olivier Matz
2014-05-16 8:18 ` [dpdk-dev] [PATCH v3 1/6] mk: introduce rte.extsubdir.mk Olivier Matz
@ 2014-05-16 8:18 ` Olivier Matz
2014-05-16 8:18 ` [dpdk-dev] [PATCH v3 3/6] examples: add a makefile to build all examples Olivier Matz
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Olivier Matz @ 2014-05-16 8:18 UTC (permalink / raw)
To: dev
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
examples/l2fwd-ivshmem/Makefile | 9 +--------
examples/multi_process/Makefile | 16 +++++++---------
examples/multi_process/client_server_mp/Makefile | 15 ++++++---------
examples/quota_watermark/Makefile | 12 +++---------
4 files changed, 17 insertions(+), 35 deletions(-)
diff --git a/examples/l2fwd-ivshmem/Makefile b/examples/l2fwd-ivshmem/Makefile
index 7286b37..df59ed8 100644
--- a/examples/l2fwd-ivshmem/Makefile
+++ b/examples/l2fwd-ivshmem/Makefile
@@ -37,14 +37,7 @@ endif
RTE_TARGET ?= x86_64-ivshmem-linuxapp-gcc
include $(RTE_SDK)/mk/rte.vars.mk
-unexport RTE_SRCDIR RTE_OUTPUT RTE_EXTMK
DIRS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += host guest
-.PHONY: all clean $(DIRS-y)
-
-all: $(DIRS-y)
-clean: $(DIRS-y)
-
-$(DIRS-y):
- $(MAKE) -C $@ $(MAKECMDGOALS)
+include $(RTE_SDK)/mk/rte.extsubdir.mk
diff --git a/examples/multi_process/Makefile b/examples/multi_process/Makefile
index ba96a7e..5e01f9a 100644
--- a/examples/multi_process/Makefile
+++ b/examples/multi_process/Makefile
@@ -33,15 +33,13 @@ ifeq ($(RTE_SDK),)
$(error "Please define RTE_SDK environment variable")
endif
-include $(RTE_SDK)/mk/rte.vars.mk
-unexport RTE_SRCDIR RTE_OUTPUT RTE_EXTMK
-
-DIRS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += $(wildcard *_mp)
+# Default target, can be overriden by command line or environment
+RTE_TARGET ?= x86_64-default-linuxapp-gcc
-.PHONY: all clean $(DIRS-y)
+include $(RTE_SDK)/mk/rte.vars.mk
-all: $(DIRS-y)
-clean: $(DIRS-y)
+DIRS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += client_server_mp
+DIRS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += simple_mp
+DIRS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += symmetric_mp
-$(DIRS-y):
- $(MAKE) -C $@ $(MAKECMDGOALS)
+include $(RTE_SDK)/mk/rte.extsubdir.mk
diff --git a/examples/multi_process/client_server_mp/Makefile b/examples/multi_process/client_server_mp/Makefile
index 24d31b0..d2046ba 100644
--- a/examples/multi_process/client_server_mp/Makefile
+++ b/examples/multi_process/client_server_mp/Makefile
@@ -33,15 +33,12 @@ ifeq ($(RTE_SDK),)
$(error "Please define RTE_SDK environment variable")
endif
-include $(RTE_SDK)/mk/rte.vars.mk
-unexport RTE_SRCDIR RTE_OUTPUT RTE_EXTMK
-
-DIRS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += $(wildcard mp_*)
+# Default target, can be overriden by command line or environment
+RTE_TARGET ?= x86_64-default-linuxapp-gcc
-.PHONY: all clean $(DIRS-y)
+include $(RTE_SDK)/mk/rte.vars.mk
-all: $(DIRS-y)
-clean: $(DIRS-y)
+DIRS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += mp_client
+DIRS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += mp_server
-$(DIRS-y):
- $(MAKE) -C $@ $(MAKECMDGOALS)
+include $(RTE_SDK)/mk/rte.extsubdir.mk
diff --git a/examples/quota_watermark/Makefile b/examples/quota_watermark/Makefile
index 5596dcc..e4d54c2 100644
--- a/examples/quota_watermark/Makefile
+++ b/examples/quota_watermark/Makefile
@@ -37,14 +37,8 @@ endif
RTE_TARGET ?= x86_64-default-linuxapp-gcc
include $(RTE_SDK)/mk/rte.vars.mk
-unexport RTE_SRCDIR RTE_OUTPUT RTE_EXTMK
-DIRS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += $(wildcard qw*)
+DIRS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += qw
+DIRS-$(CONFIG_RTE_EXEC_ENV_LINUXAPP) += qwctl
-.PHONY: all clean $(DIRS-y)
-
-all: $(DIRS-y)
-clean: $(DIRS-y)
-
-$(DIRS-y):
- $(MAKE) -C $@ $(MAKECMDGOALS)
+include $(RTE_SDK)/mk/rte.extsubdir.mk
--
1.9.2
^ permalink raw reply [flat|nested] 8+ messages in thread
* [dpdk-dev] [PATCH v3 3/6] examples: add a makefile to build all examples
2014-05-16 8:18 [dpdk-dev] [PATCH v3 0/6] examples: add a new makefile to build all examples Olivier Matz
2014-05-16 8:18 ` [dpdk-dev] [PATCH v3 1/6] mk: introduce rte.extsubdir.mk Olivier Matz
2014-05-16 8:18 ` [dpdk-dev] [PATCH v3 2/6] examples: use rte.extsubdir.mk to process subdirectories Olivier Matz
@ 2014-05-16 8:18 ` Olivier Matz
2014-05-16 8:18 ` [dpdk-dev] [PATCH v3 4/6] examples: fix qos_sched makefile Olivier Matz
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Olivier Matz @ 2014-05-16 8:18 UTC (permalink / raw)
To: dev
It is now possible to build all examples by doing the following:
user@droids:~/dpdk.org$ cd examples
user@droids:~/dpdk.org/examples$ make RTE_SDK=${PWD}/.. \
RTE_TARGET=x86_64-default-linuxapp-gcc
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
examples/Makefile | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 68 insertions(+)
create mode 100644 examples/Makefile
diff --git a/examples/Makefile b/examples/Makefile
new file mode 100644
index 0000000..5e36c92
--- /dev/null
+++ b/examples/Makefile
@@ -0,0 +1,68 @@
+# BSD LICENSE
+#
+# Copyright(c) 2014 6WIND S.A.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of 6WIND S.A. nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ifeq ($(RTE_SDK),)
+$(error "Please define RTE_SDK environment variable")
+endif
+
+# Default target, can be overriden by command line or environment
+RTE_TARGET ?= x86_64-default-linuxapp-gcc
+
+include $(RTE_SDK)/mk/rte.vars.mk
+
+DIRS-y += cmdline
+ifneq ($(ICP_ROOT),)
+DIRS-y += dpdk_qat
+endif
+DIRS-y += exception_path
+DIRS-y += helloworld
+DIRS-y += ip_reassembly
+DIRS-$(CONFIG_RTE_MBUF_SCATTER_GATHER) += ipv4_frag
+DIRS-$(CONFIG_RTE_MBUF_SCATTER_GATHER) += ipv4_multicast
+DIRS-$(CONFIG_RTE_LIBRTE_KNI) += kni
+DIRS-y += l2fwd
+DIRS-$(CONFIG_RTE_LIBRTE_IVSHMEM) += l2fwd-ivshmem
+DIRS-y += l3fwd
+DIRS-y += l3fwd-power
+DIRS-y += l3fwd-vf
+DIRS-y += link_status_interrupt
+DIRS-y += load_balancer
+DIRS-y += multi_process
+DIRS-y += netmap_compat/bridge
+DIRS-$(CONFIG_RTE_LIBRTE_METER) += qos_meter
+DIRS-$(CONFIG_RTE_LIBRTE_SCHED) += qos_sched
+DIRS-y += quota_watermark
+DIRS-y += timer
+DIRS-y += vhost
+DIRS-$(CONFIG_RTE_LIBRTE_XEN_DOM0) += vhost_xen
+DIRS-y += vmdq
+DIRS-y += vmdq_dcb
+
+include $(RTE_SDK)/mk/rte.extsubdir.mk
--
1.9.2
^ permalink raw reply [flat|nested] 8+ messages in thread
* [dpdk-dev] [PATCH v3 4/6] examples: fix qos_sched makefile
2014-05-16 8:18 [dpdk-dev] [PATCH v3 0/6] examples: add a new makefile to build all examples Olivier Matz
` (2 preceding siblings ...)
2014-05-16 8:18 ` [dpdk-dev] [PATCH v3 3/6] examples: add a makefile to build all examples Olivier Matz
@ 2014-05-16 8:18 ` Olivier Matz
2014-05-16 8:19 ` [dpdk-dev] [PATCH v3 5/6] examples: fix netmap_compat example Olivier Matz
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Olivier Matz @ 2014-05-16 8:18 UTC (permalink / raw)
To: dev
The example does not compile as the linker complains about duplicated
symbols.
Remove -lsched from LDLIBS, it is already present in rte.app.mk and
added by the DPDK framework automatically.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
examples/qos_sched/Makefile | 2 --
1 file changed, 2 deletions(-)
diff --git a/examples/qos_sched/Makefile b/examples/qos_sched/Makefile
index b91fe37..9366efe 100755
--- a/examples/qos_sched/Makefile
+++ b/examples/qos_sched/Makefile
@@ -54,6 +54,4 @@ CFLAGS += $(WERROR_FLAGS)
CFLAGS_args.o := -D_GNU_SOURCE
CFLAGS_cfg_file.o := -D_GNU_SOURCE
-LDLIBS += -lrte_sched
-
include $(RTE_SDK)/mk/rte.extapp.mk
--
1.9.2
^ permalink raw reply [flat|nested] 8+ messages in thread
* [dpdk-dev] [PATCH v3 5/6] examples: fix netmap_compat example
2014-05-16 8:18 [dpdk-dev] [PATCH v3 0/6] examples: add a new makefile to build all examples Olivier Matz
` (3 preceding siblings ...)
2014-05-16 8:18 ` [dpdk-dev] [PATCH v3 4/6] examples: fix qos_sched makefile Olivier Matz
@ 2014-05-16 8:19 ` Olivier Matz
2014-05-16 8:19 ` [dpdk-dev] [PATCH v3 6/6] mk: add "make examples" target in root makefile Olivier Matz
2014-05-16 14:37 ` [dpdk-dev] [PATCH v3 0/6] examples: add a new makefile to build all examples Thomas Monjalon
6 siblings, 0 replies; 8+ messages in thread
From: Olivier Matz @ 2014-05-16 8:19 UTC (permalink / raw)
To: dev
It is not allowed to reference a an absolute file name in SRCS-y.
A VPATH has to be used, else the dependencies won't be checked
properly.
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
examples/netmap_compat/bridge/Makefile | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/examples/netmap_compat/bridge/Makefile b/examples/netmap_compat/bridge/Makefile
index 74feb1e..ebc6b1c 100644
--- a/examples/netmap_compat/bridge/Makefile
+++ b/examples/netmap_compat/bridge/Makefile
@@ -41,9 +41,12 @@ include $(RTE_SDK)/mk/rte.vars.mk
# binary name
APP = bridge
+# for compat_netmap.c
+VPATH := $(SRCDIR)/../lib
+
# all source are stored in SRCS-y
SRCS-y := bridge.c
-SRCS-y += $(SRCDIR)/../lib/compat_netmap.c
+SRCS-y += compat_netmap.c
CFLAGS += -O3 -I$(SRCDIR)/../lib -I$(SRCDIR)/../netmap
CFLAGS += $(WERROR_FLAGS)
--
1.9.2
^ permalink raw reply [flat|nested] 8+ messages in thread
* [dpdk-dev] [PATCH v3 6/6] mk: add "make examples" target in root makefile
2014-05-16 8:18 [dpdk-dev] [PATCH v3 0/6] examples: add a new makefile to build all examples Olivier Matz
` (4 preceding siblings ...)
2014-05-16 8:19 ` [dpdk-dev] [PATCH v3 5/6] examples: fix netmap_compat example Olivier Matz
@ 2014-05-16 8:19 ` Olivier Matz
2014-05-16 14:37 ` [dpdk-dev] [PATCH v3 0/6] examples: add a new makefile to build all examples Thomas Monjalon
6 siblings, 0 replies; 8+ messages in thread
From: Olivier Matz @ 2014-05-16 8:19 UTC (permalink / raw)
To: dev
It is now possible to build all projects from the examples/ directory
using one command from root directory.
Some illustration of what is possible:
- build examples in the DPDK tree for one target
# install the x86_64-default-linuxapp-gcc in
# ${RTE_SDK}/x86_64-default-linuxapp-gcc directory
user@droids:~/dpdk.org$ make install T=x86_64-default-linuxapp-gcc
# build examples for this new installation in
# ${RTE_SDK}/examples directory
user@droids:~/dpdk.org$ make examples T=x86_64-default-linuxapp-gcc
- build examples outside DPDK tree for several targets
# install all targets matching x86_64-*-linuxapp-gcc in
# ${RTE_SDK}/x86_64-*-linuxapp-gcc directories
user@droids:~/dpdk.org$ make install T=x86_64-*-linuxapp-gcc
# build examples for these installations in /tmp/foobar
user@droids:~/dpdk.org$ make examples T=x86_64-*-linuxapp-gcc O=/tmp/foobar
Signed-off-by: Olivier Matz <olivier.matz@6wind.com>
---
doc/build-sdk-quick.txt | 14 +++++----
mk/rte.sdkexamples.mk | 77 +++++++++++++++++++++++++++++++++++++++++++++++++
mk/rte.sdkroot.mk | 4 +++
3 files changed, 89 insertions(+), 6 deletions(-)
create mode 100644 mk/rte.sdkexamples.mk
diff --git a/doc/build-sdk-quick.txt b/doc/build-sdk-quick.txt
index 8989a32..d768c44 100644
--- a/doc/build-sdk-quick.txt
+++ b/doc/build-sdk-quick.txt
@@ -1,12 +1,14 @@
Basic build
make config T=x86_64-default-linuxapp-gcc && make
Build commands
- config get configuration from target template (T=)
- all same as build (default rule)
- build build in a configured directory
- clean remove files but keep configuration
- install build many targets (wildcard allowed) and install in DESTDIR
- uninstall remove all installed targets
+ config get configuration from target template (T=)
+ all same as build (default rule)
+ build build in a configured directory
+ clean remove files but keep configuration
+ install build many targets (wildcard allowed) and install in DESTDIR
+ uninstall remove all installed targets
+ examples build examples for given targets (T=)
+ examples_clean clean examples for given targets (T=)
Build variables
EXTRA_CPPFLAGS preprocessor options
EXTRA_CFLAGS compiler options
diff --git a/mk/rte.sdkexamples.mk b/mk/rte.sdkexamples.mk
new file mode 100644
index 0000000..111ce91
--- /dev/null
+++ b/mk/rte.sdkexamples.mk
@@ -0,0 +1,77 @@
+# BSD LICENSE
+#
+# Copyright(c) 2014 6WIND S.A.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in
+# the documentation and/or other materials provided with the
+# distribution.
+# * Neither the name of 6WIND S.A. nor the names of its
+# contributors may be used to endorse or promote products derived
+# from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+# examples application are seen as external applications which are
+# not part of SDK.
+BUILDING_RTE_SDK :=
+export BUILDING_RTE_SDK
+
+# Build directory is given with O=
+O ?= $(RTE_SDK)/examples
+
+# Target for which examples should be built.
+T ?= *
+
+# list all available configurations
+EXAMPLES_CONFIGS := $(patsubst $(RTE_SRCDIR)/config/defconfig_%,%,\
+ $(wildcard $(RTE_SRCDIR)/config/defconfig_$(T)))
+EXAMPLES_TARGETS := $(addsuffix _examples,\
+ $(filter-out %~,$(EXAMPLES_CONFIGS)))
+
+.PHONY: examples
+examples: $(EXAMPLES_TARGETS)
+
+%_examples:
+ @echo ================== Build examples for $*
+ $(Q)if [ ! -d "${RTE_SDK}/${*}" ]; then \
+ echo "Target ${*} does not exist in ${RTE_SDK}/${*}." ; \
+ echo -n "Please install DPDK first (make install) or use another " ; \
+ echo "target argument (T=target)." ; \
+ false ; \
+ else \
+ $(MAKE) -C examples O=$(abspath $(O)) RTE_TARGET=$(*); \
+ fi
+
+EXAMPLES_CLEAN_TARGETS := $(addsuffix _examples_clean,\
+ $(filter-out %~,$(EXAMPLES_CONFIGS)))
+
+.PHONY: examples_clean
+examples_clean: $(EXAMPLES_CLEAN_TARGETS)
+
+%_examples_clean:
+ @echo ================== Clean examples for $*
+ $(Q)if [ ! -d "${RTE_SDK}/${*}" ]; then \
+ echo "Target ${*} does not exist in ${RTE_SDK}/${*}." ; \
+ echo -n "Please install DPDK first (make install) or use another " ; \
+ echo "target argument (T=target)." ; \
+ false ; \
+ else \
+ $(MAKE) -C examples O=$(abspath $(O)) RTE_TARGET=$(*) clean; \
+ fi
diff --git a/mk/rte.sdkroot.mk b/mk/rte.sdkroot.mk
index 28e404b..54aa204 100644
--- a/mk/rte.sdkroot.mk
+++ b/mk/rte.sdkroot.mk
@@ -115,6 +115,10 @@ depdirs depgraph:
gcov gcovclean:
$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkgcov.mk $@
+.PHONY: examples examples_clean
+examples examples_clean:
+ $(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkexamples.mk $@
+
# all other build targets
%:
$(Q)$(MAKE) -f $(RTE_SDK)/mk/rte.sdkconfig.mk checkconfig
--
1.9.2
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH v3 0/6] examples: add a new makefile to build all examples
2014-05-16 8:18 [dpdk-dev] [PATCH v3 0/6] examples: add a new makefile to build all examples Olivier Matz
` (5 preceding siblings ...)
2014-05-16 8:19 ` [dpdk-dev] [PATCH v3 6/6] mk: add "make examples" target in root makefile Olivier Matz
@ 2014-05-16 14:37 ` Thomas Monjalon
6 siblings, 0 replies; 8+ messages in thread
From: Thomas Monjalon @ 2014-05-16 14:37 UTC (permalink / raw)
To: Olivier Matz; +Cc: dev
2014-05-16 10:18, Olivier Matz:
> This patch series adds a makefile to build all examples supported
> by the configuration. It helps to check that all examples compile
> after a dpdk modification.
>
> After applying the patches, it is possible to build all examples for
> given targets, given the installation directory:
>
> # first, install the x86_64-default-linuxapp-gcc in
> # ${RTE_SDK}/x86_64-default-linuxapp-gcc directory
> user@droids:~/dpdk.org$ make install T=x86_64-default-linuxapp-gcc
> # build examples for this new installation in
> # ${RTE_SDK}/examples directory
> user@droids:~/dpdk.org$ make examples T=x86_64-default-linuxapp-gcc
>
> Or directly from examples directory:
>
> user@droids:~/dpdk.org$ cd examples
> user@droids:~/dpdk.org/examples$ make RTE_SDK=${PWD}/.. \
> RTE_TARGET=x86_64-default-linuxapp-gcc
>
>
> Changes included in v3:
> - use x86_64-default-linuxapp-gcc instead of x86_64-ivshmem-linuxapp-gcc
> for default RTE_TARGET of multi_process example (was a bad copy/paste).
> - replace ifndef by ?=
> - fix when O= is a relative directory
> - exit if the installation directory does not exist
>
> Changes included in v2:
> - do not build kni example if CONFIG_RTE_LIBRTE_KNI is not set
> - fix rte.extsubdir.mk when there are several levels of subdirectories
> - allow to build examples directly from dpdk root directory
> - explain in commit logs that it requires an install directory
>
> Olivier Matz (6):
> mk: introduce rte.extsubdir.mk
> examples: use rte.extsubdir.mk to process subdirectories
> examples: add a makefile to build all examples
> examples: fix qos_sched makefile
> examples: fix netmap_compat example
> mk: add "make examples" target in root makefile
Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
Applied for version 1.7.0.
--
Thomas
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2014-05-16 14:37 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-16 8:18 [dpdk-dev] [PATCH v3 0/6] examples: add a new makefile to build all examples Olivier Matz
2014-05-16 8:18 ` [dpdk-dev] [PATCH v3 1/6] mk: introduce rte.extsubdir.mk Olivier Matz
2014-05-16 8:18 ` [dpdk-dev] [PATCH v3 2/6] examples: use rte.extsubdir.mk to process subdirectories Olivier Matz
2014-05-16 8:18 ` [dpdk-dev] [PATCH v3 3/6] examples: add a makefile to build all examples Olivier Matz
2014-05-16 8:18 ` [dpdk-dev] [PATCH v3 4/6] examples: fix qos_sched makefile Olivier Matz
2014-05-16 8:19 ` [dpdk-dev] [PATCH v3 5/6] examples: fix netmap_compat example Olivier Matz
2014-05-16 8:19 ` [dpdk-dev] [PATCH v3 6/6] mk: add "make examples" target in root makefile Olivier Matz
2014-05-16 14:37 ` [dpdk-dev] [PATCH v3 0/6] examples: add a new makefile to build all examples Thomas Monjalon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).