summaryrefslogtreecommitdiff
path: root/examples/l3fwd
diff options
context:
space:
mode:
authorBruce Richardson <bruce.richardson@intel.com>2019-03-27 13:58:05 +0000
committerThomas Monjalon <thomas@monjalon.net>2019-03-30 01:12:15 +0100
commite9c659426416c95c4469b16e6bcc7700f1898278 (patch)
tree6cf3bb6af1365ad059548bd90b17f2e033f51429 /examples/l3fwd
parentff1e35fb5f8330f89d13f58c9fb767b5bd188940 (diff)
downloaddpdk-e9c659426416c95c4469b16e6bcc7700f1898278.zip
dpdk-e9c659426416c95c4469b16e6bcc7700f1898278.tar.gz
dpdk-e9c659426416c95c4469b16e6bcc7700f1898278.tar.xz
examples: detect default build directory
Most examples have in their makefiles a default RTE_TARGET directory to be used in case RTE_TARGET is not set. Rather than just using a hard-coded default, we can instead detect what the build directory is relative to RTE_SDK directory. This fixes a potential issue for anyone who continues to build using "make install T=x86_64-native-linuxapp-gcc" and skips setting RTE_TARGET explicitly, instead relying on the fact that they were building in a directory which corresponded to the example default path - which was changed to "x86_64-native-linux-gcc" by commit 218c4e68c1d9 ("mk: use linux and freebsd in config names"). Signed-off-by: Bruce Richardson <bruce.richardson@intel.com> Acked-by: Ferruh Yigit <ferruh.yigit@intel.com>
Diffstat (limited to 'examples/l3fwd')
-rw-r--r--examples/l3fwd/Makefile4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/l3fwd/Makefile b/examples/l3fwd/Makefile
index 9fa7a44..8c51c7b 100644
--- a/examples/l3fwd/Makefile
+++ b/examples/l3fwd/Makefile
@@ -43,8 +43,8 @@ ifeq ($(RTE_SDK),)
$(error "Please define RTE_SDK environment variable")
endif
-# Default target, can be overridden by command line or environment
-RTE_TARGET ?= x86_64-native-linux-gcc
+# Default target, detect a build directory, by looking for a path with a .config
+RTE_TARGET ?= $(notdir $(abspath $(dir $(firstword $(wildcard $(RTE_SDK)/*/.config)))))
include $(RTE_SDK)/mk/rte.vars.mk