From e9c659426416c95c4469b16e6bcc7700f1898278 Mon Sep 17 00:00:00 2001 From: Bruce Richardson Date: Wed, 27 Mar 2019 13:58:05 +0000 Subject: [PATCH] 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 --- examples/Makefile | 4 ++-- examples/bbdev_app/Makefile | 4 ++-- examples/bond/Makefile | 4 ++-- examples/cmdline/Makefile | 4 ++-- examples/distributor/Makefile | 4 ++-- examples/ethtool/Makefile | 4 ++-- examples/ethtool/ethtool-app/Makefile | 4 ++-- examples/ethtool/lib/Makefile | 4 ++-- examples/eventdev_pipeline/Makefile | 4 ++-- examples/exception_path/Makefile | 4 ++-- examples/fips_validation/Makefile | 4 ++-- examples/flow_classify/Makefile | 4 ++-- examples/flow_filtering/Makefile | 4 ++-- examples/helloworld/Makefile | 4 ++-- examples/ip_fragmentation/Makefile | 4 ++-- examples/ip_pipeline/Makefile | 4 ++-- examples/ip_reassembly/Makefile | 4 ++-- examples/ipsec-secgw/Makefile | 4 ++-- examples/ipv4_multicast/Makefile | 4 ++-- examples/kni/Makefile | 4 ++-- examples/l2fwd-cat/Makefile | 4 ++-- examples/l2fwd-crypto/Makefile | 4 ++-- examples/l2fwd-jobstats/Makefile | 4 ++-- examples/l2fwd-keepalive/Makefile | 4 ++-- examples/l2fwd-keepalive/ka-agent/Makefile | 4 ++-- examples/l2fwd/Makefile | 4 ++-- examples/l3fwd-acl/Makefile | 4 ++-- examples/l3fwd-power/Makefile | 4 ++-- examples/l3fwd-vf/Makefile | 4 ++-- examples/l3fwd/Makefile | 4 ++-- examples/link_status_interrupt/Makefile | 4 ++-- examples/load_balancer/Makefile | 4 ++-- examples/multi_process/Makefile | 4 ++-- examples/multi_process/client_server_mp/Makefile | 4 ++-- examples/multi_process/client_server_mp/mp_server/Makefile | 4 ++-- examples/multi_process/hotplug_mp/Makefile | 4 ++-- examples/multi_process/simple_mp/Makefile | 4 ++-- examples/multi_process/symmetric_mp/Makefile | 4 ++-- examples/netmap_compat/Makefile | 4 ++-- examples/netmap_compat/bridge/Makefile | 4 ++-- examples/packet_ordering/Makefile | 4 ++-- examples/performance-thread/Makefile | 4 ++-- examples/performance-thread/l3fwd-thread/Makefile | 4 ++-- examples/performance-thread/pthread_shim/Makefile | 4 ++-- examples/ptpclient/Makefile | 4 ++-- examples/qos_meter/Makefile | 4 ++-- examples/qos_sched/Makefile | 4 ++-- examples/quota_watermark/Makefile | 4 ++-- examples/quota_watermark/qw/Makefile | 4 ++-- examples/quota_watermark/qwctl/Makefile | 4 ++-- examples/rxtx_callbacks/Makefile | 4 ++-- examples/server_node_efd/Makefile | 4 ++-- examples/server_node_efd/server/Makefile | 4 ++-- examples/service_cores/Makefile | 4 ++-- examples/skeleton/Makefile | 4 ++-- examples/tep_termination/Makefile | 4 ++-- examples/timer/Makefile | 4 ++-- examples/vdpa/Makefile | 4 ++-- examples/vhost/Makefile | 4 ++-- examples/vhost_crypto/Makefile | 4 ++-- examples/vhost_scsi/Makefile | 4 ++-- examples/vm_power_manager/Makefile | 4 ++-- examples/vm_power_manager/guest_cli/Makefile | 4 ++-- examples/vmdq/Makefile | 4 ++-- examples/vmdq_dcb/Makefile | 4 ++-- 65 files changed, 130 insertions(+), 130 deletions(-) diff --git a/examples/Makefile b/examples/Makefile index c7a81f08de..f7c4231402 100644 --- a/examples/Makefile +++ b/examples/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/bbdev_app/Makefile b/examples/bbdev_app/Makefile index 51abf82cf8..e8115b46a6 100644 --- a/examples/bbdev_app/Makefile +++ b/examples/bbdev_app/Makefile @@ -45,8 +45,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/bond/Makefile b/examples/bond/Makefile index 98a31d6b59..488eeac70a 100644 --- a/examples/bond/Makefile +++ b/examples/bond/Makefile @@ -47,8 +47,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/cmdline/Makefile b/examples/cmdline/Makefile index 30a87626e9..a03dfa8eea 100644 --- a/examples/cmdline/Makefile +++ b/examples/cmdline/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 diff --git a/examples/distributor/Makefile b/examples/distributor/Makefile index 0cda58a5be..52076214b7 100644 --- a/examples/distributor/Makefile +++ b/examples/distributor/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 diff --git a/examples/ethtool/Makefile b/examples/ethtool/Makefile index 27908bb63b..d3b97bb50b 100644 --- a/examples/ethtool/Makefile +++ b/examples/ethtool/Makefile @@ -5,8 +5,8 @@ ifeq ($(RTE_SDK),) $(error "Please define RTE_SDK environment variable") endif -# Default target, can be overwritten 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/ethtool/ethtool-app/Makefile b/examples/ethtool/ethtool-app/Makefile index 0dae20383d..3543bdee0c 100644 --- a/examples/ethtool/ethtool-app/Makefile +++ b/examples/ethtool/ethtool-app/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/ethtool/lib/Makefile b/examples/ethtool/lib/Makefile index 70e00eee8b..9da7dc3ba2 100644 --- a/examples/ethtool/lib/Makefile +++ b/examples/ethtool/lib/Makefile @@ -5,8 +5,8 @@ ifeq ($(RTE_SDK),) $(error "Please define RTE_SDK environment variable") endif -# Default target, can be overwritten 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/eventdev_pipeline/Makefile b/examples/eventdev_pipeline/Makefile index 238c41ea29..c34779086f 100644 --- a/examples/eventdev_pipeline/Makefile +++ b/examples/eventdev_pipeline/Makefile @@ -47,8 +47,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/exception_path/Makefile b/examples/exception_path/Makefile index 1f08792ee8..18db85ddb8 100644 --- a/examples/exception_path/Makefile +++ b/examples/exception_path/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 diff --git a/examples/fips_validation/Makefile b/examples/fips_validation/Makefile index 2120cd9655..e74252e274 100644 --- a/examples/fips_validation/Makefile +++ b/examples/fips_validation/Makefile @@ -52,8 +52,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))))) INC += $(sort $(wildcard *.h)) diff --git a/examples/flow_classify/Makefile b/examples/flow_classify/Makefile index 3a49f971cc..dfce1a4bd0 100644 --- a/examples/flow_classify/Makefile +++ b/examples/flow_classify/Makefile @@ -45,8 +45,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/flow_filtering/Makefile b/examples/flow_filtering/Makefile index cc51ffdb84..f657c0336a 100644 --- a/examples/flow_filtering/Makefile +++ b/examples/flow_filtering/Makefile @@ -41,8 +41,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/helloworld/Makefile b/examples/helloworld/Makefile index 0b5374d037..97d82f68aa 100644 --- a/examples/helloworld/Makefile +++ b/examples/helloworld/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 diff --git a/examples/ip_fragmentation/Makefile b/examples/ip_fragmentation/Makefile index fd186406c2..6d1a1fbba5 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") 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/ip_pipeline/Makefile b/examples/ip_pipeline/Makefile index 26d2c71b0e..409966afde 100644 --- a/examples/ip_pipeline/Makefile +++ b/examples/ip_pipeline/Makefile @@ -63,8 +63,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/ip_reassembly/Makefile b/examples/ip_reassembly/Makefile index 672ffe3841..7bbc241c78 100644 --- a/examples/ip_reassembly/Makefile +++ b/examples/ip_reassembly/Makefile @@ -44,8 +44,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/ipsec-secgw/Makefile b/examples/ipsec-secgw/Makefile index 0236a74bf9..ac042e4ce6 100644 --- a/examples/ipsec-secgw/Makefile +++ b/examples/ipsec-secgw/Makefile @@ -56,8 +56,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/ipv4_multicast/Makefile b/examples/ipv4_multicast/Makefile index ea7339aa97..5a1e368fa5 100644 --- a/examples/ipv4_multicast/Makefile +++ b/examples/ipv4_multicast/Makefile @@ -44,8 +44,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/kni/Makefile b/examples/kni/Makefile index e6d897f94a..634334f86f 100644 --- a/examples/kni/Makefile +++ b/examples/kni/Makefile @@ -44,8 +44,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/l2fwd-cat/Makefile b/examples/l2fwd-cat/Makefile index 111247edb0..fb3c4bc008 100644 --- a/examples/l2fwd-cat/Makefile +++ b/examples/l2fwd-cat/Makefile @@ -49,8 +49,8 @@ ifeq ($(PQOS_INSTALL_PATH),) $(error "Please define PQOS_INSTALL_PATH 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/l2fwd-crypto/Makefile b/examples/l2fwd-crypto/Makefile index 84249a5cb3..ed5e2c73f3 100644 --- a/examples/l2fwd-crypto/Makefile +++ b/examples/l2fwd-crypto/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 diff --git a/examples/l2fwd-jobstats/Makefile b/examples/l2fwd-jobstats/Makefile index cacec916e7..e14c3a2b2b 100644 --- a/examples/l2fwd-jobstats/Makefile +++ b/examples/l2fwd-jobstats/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 diff --git a/examples/l2fwd-keepalive/Makefile b/examples/l2fwd-keepalive/Makefile index 3d3f28e683..bc851b732e 100644 --- a/examples/l2fwd-keepalive/Makefile +++ b/examples/l2fwd-keepalive/Makefile @@ -45,8 +45,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/l2fwd-keepalive/ka-agent/Makefile b/examples/l2fwd-keepalive/ka-agent/Makefile index 005b72c631..755e474383 100644 --- a/examples/l2fwd-keepalive/ka-agent/Makefile +++ b/examples/l2fwd-keepalive/ka-agent/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/l2fwd/Makefile b/examples/l2fwd/Makefile index 30866015b3..94d70a43e0 100644 --- a/examples/l2fwd/Makefile +++ b/examples/l2fwd/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 diff --git a/examples/l3fwd-acl/Makefile b/examples/l3fwd-acl/Makefile index 294c1f1010..fc236f1298 100644 --- a/examples/l3fwd-acl/Makefile +++ b/examples/l3fwd-acl/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 diff --git a/examples/l3fwd-power/Makefile b/examples/l3fwd-power/Makefile index 4c768380c3..a106b04044 100644 --- a/examples/l3fwd-power/Makefile +++ b/examples/l3fwd-power/Makefile @@ -45,8 +45,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/l3fwd-vf/Makefile b/examples/l3fwd-vf/Makefile index 90f4f7fb3d..cc93603e3b 100644 --- a/examples/l3fwd-vf/Makefile +++ b/examples/l3fwd-vf/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 diff --git a/examples/l3fwd/Makefile b/examples/l3fwd/Makefile index 9fa7a448ec..8c51c7b969 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 diff --git a/examples/link_status_interrupt/Makefile b/examples/link_status_interrupt/Makefile index 65773f8c4d..d12e04782c 100644 --- a/examples/link_status_interrupt/Makefile +++ b/examples/link_status_interrupt/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 diff --git a/examples/load_balancer/Makefile b/examples/load_balancer/Makefile index 280dfa97e0..d4b145ca17 100644 --- a/examples/load_balancer/Makefile +++ b/examples/load_balancer/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 diff --git a/examples/multi_process/Makefile b/examples/multi_process/Makefile index b0633df38f..7f7e68d912 100644 --- a/examples/multi_process/Makefile +++ b/examples/multi_process/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/multi_process/client_server_mp/Makefile b/examples/multi_process/client_server_mp/Makefile index f199faf1fa..fe7a8af605 100644 --- a/examples/multi_process/client_server_mp/Makefile +++ b/examples/multi_process/client_server_mp/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/multi_process/client_server_mp/mp_server/Makefile b/examples/multi_process/client_server_mp/mp_server/Makefile index ac18822b07..50ebf1d7da 100644 --- a/examples/multi_process/client_server_mp/mp_server/Makefile +++ b/examples/multi_process/client_server_mp/mp_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 diff --git a/examples/multi_process/hotplug_mp/Makefile b/examples/multi_process/hotplug_mp/Makefile index b5babf6857..1fd7aa085c 100644 --- a/examples/multi_process/hotplug_mp/Makefile +++ b/examples/multi_process/hotplug_mp/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/multi_process/simple_mp/Makefile b/examples/multi_process/simple_mp/Makefile index 6657538a4e..4c0764451a 100644 --- a/examples/multi_process/simple_mp/Makefile +++ b/examples/multi_process/simple_mp/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/multi_process/symmetric_mp/Makefile b/examples/multi_process/symmetric_mp/Makefile index 9226690b16..bdc415621f 100644 --- a/examples/multi_process/symmetric_mp/Makefile +++ b/examples/multi_process/symmetric_mp/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/netmap_compat/Makefile b/examples/netmap_compat/Makefile index f2bf39e691..b9f78d1736 100644 --- a/examples/netmap_compat/Makefile +++ b/examples/netmap_compat/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 unexport RTE_SRCDIR RTE_OUTPUT RTE_EXTMK diff --git a/examples/netmap_compat/bridge/Makefile b/examples/netmap_compat/bridge/Makefile index 3e3ff0795e..7ed30e57b9 100644 --- a/examples/netmap_compat/bridge/Makefile +++ b/examples/netmap_compat/bridge/Makefile @@ -5,8 +5,8 @@ ifeq ($(RTE_SDK),) $(error "Please define the 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/packet_ordering/Makefile b/examples/packet_ordering/Makefile index 16781e7620..474ec95716 100644 --- a/examples/packet_ordering/Makefile +++ b/examples/packet_ordering/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 diff --git a/examples/performance-thread/Makefile b/examples/performance-thread/Makefile index d63fcbbb99..08158914c3 100644 --- a/examples/performance-thread/Makefile +++ b/examples/performance-thread/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/performance-thread/l3fwd-thread/Makefile b/examples/performance-thread/l3fwd-thread/Makefile index 7bc0fef824..1a1c95829c 100644 --- a/examples/performance-thread/l3fwd-thread/Makefile +++ b/examples/performance-thread/l3fwd-thread/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/performance-thread/pthread_shim/Makefile b/examples/performance-thread/pthread_shim/Makefile index 731aef6379..efd66febf4 100644 --- a/examples/performance-thread/pthread_shim/Makefile +++ b/examples/performance-thread/pthread_shim/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/ptpclient/Makefile b/examples/ptpclient/Makefile index 99c817ffd5..f113c9d56f 100644 --- a/examples/ptpclient/Makefile +++ b/examples/ptpclient/Makefile @@ -43,8 +43,8 @@ ifeq ($(RTE_SDK),) $(error "Please define RTE_SDK environment variable") endif -# Default target, can be overriddegitn 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/qos_meter/Makefile b/examples/qos_meter/Makefile index fe44e64184..fbcda09b20 100644 --- a/examples/qos_meter/Makefile +++ b/examples/qos_meter/Makefile @@ -45,8 +45,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/qos_sched/Makefile b/examples/qos_sched/Makefile index 44df68ab82..a25875900e 100644 --- a/examples/qos_sched/Makefile +++ b/examples/qos_sched/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 diff --git a/examples/quota_watermark/Makefile b/examples/quota_watermark/Makefile index 6a20cba0c1..8ef053198a 100644 --- a/examples/quota_watermark/Makefile +++ b/examples/quota_watermark/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/quota_watermark/qw/Makefile b/examples/quota_watermark/qw/Makefile index 9971acc41b..3f10f01c3b 100644 --- a/examples/quota_watermark/qw/Makefile +++ b/examples/quota_watermark/qw/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/quota_watermark/qwctl/Makefile b/examples/quota_watermark/qwctl/Makefile index b3640f7d4e..a40f280250 100644 --- a/examples/quota_watermark/qwctl/Makefile +++ b/examples/quota_watermark/qwctl/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/rxtx_callbacks/Makefile b/examples/rxtx_callbacks/Makefile index 5154089de4..b937d599b4 100644 --- a/examples/rxtx_callbacks/Makefile +++ b/examples/rxtx_callbacks/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 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 diff --git a/examples/service_cores/Makefile b/examples/service_cores/Makefile index d38acd53a4..351fb7e1d9 100644 --- a/examples/service_cores/Makefile +++ b/examples/service_cores/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 diff --git a/examples/skeleton/Makefile b/examples/skeleton/Makefile index 5e2742ec60..56713a524c 100644 --- a/examples/skeleton/Makefile +++ b/examples/skeleton/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 diff --git a/examples/tep_termination/Makefile b/examples/tep_termination/Makefile index f5303bacbb..2da41922f5 100644 --- a/examples/tep_termination/Makefile +++ b/examples/tep_termination/Makefile @@ -47,8 +47,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/timer/Makefile b/examples/timer/Makefile index daed94d29b..046348fd1c 100644 --- a/examples/timer/Makefile +++ b/examples/timer/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 diff --git a/examples/vdpa/Makefile b/examples/vdpa/Makefile index b28378f0c8..9d16d8eb5f 100644 --- a/examples/vdpa/Makefile +++ b/examples/vdpa/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/vhost/Makefile b/examples/vhost/Makefile index d58d002bae..80607b79c5 100644 --- a/examples/vhost/Makefile +++ b/examples/vhost/Makefile @@ -47,8 +47,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/vhost_crypto/Makefile b/examples/vhost_crypto/Makefile index 80403a5e9a..80af3de0c8 100644 --- a/examples/vhost_crypto/Makefile +++ b/examples/vhost_crypto/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/vhost_scsi/Makefile b/examples/vhost_scsi/Makefile index 58ff7a25ca..0a3450bae5 100644 --- a/examples/vhost_scsi/Makefile +++ b/examples/vhost_scsi/Makefile @@ -46,8 +46,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/vm_power_manager/Makefile b/examples/vm_power_manager/Makefile index e608bb61a9..2fdb991d7c 100644 --- a/examples/vm_power_manager/Makefile +++ b/examples/vm_power_manager/Makefile @@ -9,8 +9,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/vm_power_manager/guest_cli/Makefile b/examples/vm_power_manager/guest_cli/Makefile index a5634eacfa..e35a68d0fe 100644 --- a/examples/vm_power_manager/guest_cli/Makefile +++ b/examples/vm_power_manager/guest_cli/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/vmdq/Makefile b/examples/vmdq/Makefile index 09ff070a85..6a389c7760 100644 --- a/examples/vmdq/Makefile +++ b/examples/vmdq/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 diff --git a/examples/vmdq_dcb/Makefile b/examples/vmdq_dcb/Makefile index 436ccb9c10..113bce7d13 100644 --- a/examples/vmdq_dcb/Makefile +++ b/examples/vmdq_dcb/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 -- 2.20.1