summaryrefslogtreecommitdiff
path: root/examples/server_node_efd
diff options
context:
space:
mode:
authorBruce Richardson <[email protected]>2019-03-27 13:58:05 +0000
committerThomas Monjalon <[email protected]>2019-03-30 01:12:15 +0100
commite9c659426416c95c4469b16e6bcc7700f1898278 (patch)
tree6cf3bb6af1365ad059548bd90b17f2e033f51429 /examples/server_node_efd
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 <[email protected]> Acked-by: Ferruh Yigit <[email protected]>
Diffstat (limited to 'examples/server_node_efd')
-rw-r--r--examples/server_node_efd/Makefile4
-rw-r--r--examples/server_node_efd/server/Makefile4
2 files changed, 4 insertions, 4 deletions
diff --git a/examples/server_node_efd/Makefile b/examples/server_node_efd/Makefile
index 0e0896609b..cc2ea8b566 100644
--- a/examples/server_node_efd/Makefile
+++ b/examples/server_node_efd/Makefile
@@ -5,8 +5,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
diff --git a/examples/server_node_efd/server/Makefile b/examples/server_node_efd/server/Makefile
index 2906261dde..4837bd3eab 100644
--- a/examples/server_node_efd/server/Makefile
+++ b/examples/server_node_efd/server/Makefile
@@ -5,8 +5,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