summaryrefslogtreecommitdiff
path: root/examples
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
parentff1e35fb5f8330f89d13f58c9fb767b5bd188940 (diff)
downloaddpdk-next-eventdev-e9c659426416c95c4469b16e6bcc7700f1898278.zip
dpdk-next-eventdev-e9c659426416c95c4469b16e6bcc7700f1898278.tar.gz
dpdk-next-eventdev-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')
-rw-r--r--examples/Makefile4
-rw-r--r--examples/bbdev_app/Makefile4
-rw-r--r--examples/bond/Makefile4
-rw-r--r--examples/cmdline/Makefile4
-rw-r--r--examples/distributor/Makefile4
-rw-r--r--examples/ethtool/Makefile4
-rw-r--r--examples/ethtool/ethtool-app/Makefile4
-rw-r--r--examples/ethtool/lib/Makefile4
-rw-r--r--examples/eventdev_pipeline/Makefile4
-rw-r--r--examples/exception_path/Makefile4
-rw-r--r--examples/fips_validation/Makefile4
-rw-r--r--examples/flow_classify/Makefile4
-rw-r--r--examples/flow_filtering/Makefile4
-rw-r--r--examples/helloworld/Makefile4
-rw-r--r--examples/ip_fragmentation/Makefile4
-rw-r--r--examples/ip_pipeline/Makefile4
-rw-r--r--examples/ip_reassembly/Makefile4
-rw-r--r--examples/ipsec-secgw/Makefile4
-rw-r--r--examples/ipv4_multicast/Makefile4
-rw-r--r--examples/kni/Makefile4
-rw-r--r--examples/l2fwd-cat/Makefile4
-rw-r--r--examples/l2fwd-crypto/Makefile4
-rw-r--r--examples/l2fwd-jobstats/Makefile4
-rw-r--r--examples/l2fwd-keepalive/Makefile4
-rw-r--r--examples/l2fwd-keepalive/ka-agent/Makefile4
-rw-r--r--examples/l2fwd/Makefile4
-rw-r--r--examples/l3fwd-acl/Makefile4
-rw-r--r--examples/l3fwd-power/Makefile4
-rw-r--r--examples/l3fwd-vf/Makefile4
-rw-r--r--examples/l3fwd/Makefile4
-rw-r--r--examples/link_status_interrupt/Makefile4
-rw-r--r--examples/load_balancer/Makefile4
-rw-r--r--examples/multi_process/Makefile4
-rw-r--r--examples/multi_process/client_server_mp/Makefile4
-rw-r--r--examples/multi_process/client_server_mp/mp_server/Makefile4
-rw-r--r--examples/multi_process/hotplug_mp/Makefile4
-rw-r--r--examples/multi_process/simple_mp/Makefile4
-rw-r--r--examples/multi_process/symmetric_mp/Makefile4
-rw-r--r--examples/netmap_compat/Makefile4
-rw-r--r--examples/netmap_compat/bridge/Makefile4
-rw-r--r--examples/packet_ordering/Makefile4
-rw-r--r--examples/performance-thread/Makefile4
-rw-r--r--examples/performance-thread/l3fwd-thread/Makefile4
-rw-r--r--examples/performance-thread/pthread_shim/Makefile4
-rw-r--r--examples/ptpclient/Makefile4
-rw-r--r--examples/qos_meter/Makefile4
-rw-r--r--examples/qos_sched/Makefile4
-rw-r--r--examples/quota_watermark/Makefile4
-rw-r--r--examples/quota_watermark/qw/Makefile4
-rw-r--r--examples/quota_watermark/qwctl/Makefile4
-rw-r--r--examples/rxtx_callbacks/Makefile4
-rw-r--r--examples/server_node_efd/Makefile4
-rw-r--r--examples/server_node_efd/server/Makefile4
-rw-r--r--examples/service_cores/Makefile4
-rw-r--r--examples/skeleton/Makefile4
-rw-r--r--examples/tep_termination/Makefile4
-rw-r--r--examples/timer/Makefile4
-rw-r--r--examples/vdpa/Makefile4
-rw-r--r--examples/vhost/Makefile4
-rw-r--r--examples/vhost_crypto/Makefile4
-rw-r--r--examples/vhost_scsi/Makefile4
-rw-r--r--examples/vm_power_manager/Makefile4
-rw-r--r--examples/vm_power_manager/guest_cli/Makefile4
-rw-r--r--examples/vmdq/Makefile4
-rw-r--r--examples/vmdq_dcb/Makefile4
65 files changed, 130 insertions, 130 deletions
diff --git a/examples/Makefile b/examples/Makefile
index c7a81f0..f7c4231 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 51abf82..e8115b4 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 98a31d6..488eeac 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 30a8762..a03dfa8 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 0cda58a..5207621 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 27908bb..d3b97bb 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 0dae203..3543bde 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 70e00ee..9da7dc3 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 238c41e..c347790 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 1f08792..18db85d 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 2120cd9..e74252e 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 3a49f97..dfce1a4 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 cc51ffd..f657c03 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 0b5374d..97d82f6 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 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")
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 26d2c71..409966a 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 672ffe3..7bbc241 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 0236a74..ac042e4c 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 ea7339a..5a1e368 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 e6d897f..634334f 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 111247e..fb3c4bc 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 84249a5..ed5e2c7 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 cacec91..e14c3a2 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 3d3f28e..bc851b7 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 005b72c..755e4743 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 3086601..94d70a4 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 294c1f1..fc236f1 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 4c76838..a106b04 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 90f4f7f..cc93603 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 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
diff --git a/examples/link_status_interrupt/Makefile b/examples/link_status_interrupt/Makefile
index 65773f8..d12e047 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 280dfa9..d4b145c 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 b0633df..7f7e68d 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 f199faf..fe7a8af 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 ac18822..50ebf1d 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 b5babf6..1fd7aa0 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 6657538..4c07644 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 9226690..bdc4156 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 f2bf39e..b9f78d1 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 3e3ff07..7ed30e5 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 16781e7..474ec95 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 d63fcbb..0815891 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 7bc0fef..1a1c958 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 731aef6..efd66fe 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 99c817f..f113c9d 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 fe44e64..fbcda09 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 44df68a..a258759 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 6a20cba..8ef0531 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 9971acc..3f10f01 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 b3640f7..a40f280 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 5154089..b937d59 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 0e08966..cc2ea8b 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 2906261..4837bd3 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 d38acd5..351fb7e 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 5e2742e..56713a5 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 f5303ba..2da4192 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 daed94d..046348f 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 b28378f..9d16d8e 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 d58d002..80607b7 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 80403a5..80af3de 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 58ff7a2..0a3450b 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 e608bb6..2fdb991 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 a5634ea..e35a68d 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 09ff070..6a389c7 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 436ccb9..113bce7 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