path: root/examples/ip_fragmentation
diff options
authorBruce Richardson <>2019-03-27 13:58:05 +0000
committerThomas Monjalon <>2019-03-30 01:12:15 +0100
commite9c659426416c95c4469b16e6bcc7700f1898278 (patch)
tree6cf3bb6af1365ad059548bd90b17f2e033f51429 /examples/ip_fragmentation
parentff1e35fb5f8330f89d13f58c9fb767b5bd188940 (diff)
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 <> Acked-by: Ferruh Yigit <>
Diffstat (limited to 'examples/ip_fragmentation')
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/ip_fragmentation/Makefile b/examples/ip_fragmentation/Makefile
index fd18640..6d1a1fb 100644
--- a/examples/ip_fragmentation/Makefile
+++ b/examples/ip_fragmentation/Makefile
@@ -44,8 +44,8 @@ ifeq ($(RTE_SDK),)
$(error "Please define RTE_SDK environment variable")
-# 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/