aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Peter Seiderer <ps.report@gmx.net>2017-11-21 20:13:30 +0100
committerGravatar Peter Korsgaard <peter@korsgaard.com>2017-11-27 11:05:51 +0100
commit8bb4b9c8dff6783557a8cda6507e2b4e613e5d8d (patch)
treeda0a375a935528d987194185960d79523ae871d3
parent3f8e8050d6ccd6c6bbac5d4d8019c39397557f54 (diff)
downloadbuildroot-8bb4b9c8dff6783557a8cda6507e2b4e613e5d8d.tar.gz
buildroot-8bb4b9c8dff6783557a8cda6507e2b4e613e5d8d.tar.bz2
Fix makefile include order by using sort/wildcard.
The 'include' directive in GNU make supports wildcards, but their expansion has no defined sort order (GLOB_NOSORT is passed to glob()). Usually this doesn't matter. However, there is at least one case where it does make a difference: toolchain/*/*.mk includes both the definitions of the external toolchain packages and pkg-toolchain-external.mk, but pkg-toolchain-external.mk must be included first. For predictability, use ordered 'include $(sort $(wildcard ...))' instead of unordered direct 'include */*.mk' everywhere. Fixes [1] reported by Petr Vorel: make: *** No rule to make target 'toolchain-external-custom', needed by '.../build/toolchain-external/.stamp_configured'. Stop. [1] http://lists.busybox.net/pipermail/buildroot/2017-November/206969.html Signed-off-by: Peter Seiderer <ps.report@gmx.net> Tested-by: Petr Vorel <petr.vorel@gmail.com> [Arnout: also sort the one remaining include, of the external docs] Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> (cherry picked from commit b9d2d4cb4ebc7a2290c4683dd9667b8f0a9e3cdf) Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
-rw-r--r--Makefile8
-rw-r--r--package/gstreamer/gstreamer.mk2
-rw-r--r--package/gstreamer1/gstreamer1.mk2
-rw-r--r--toolchain/toolchain-external/toolchain-external.mk2
4 files changed, 7 insertions, 7 deletions
diff --git a/Makefile b/Makefile
index 39db0c1240..f2afe8016d 100644
--- a/Makefile
+++ b/Makefile
@@ -483,13 +483,13 @@ include system/system.mk
include package/Makefile.in
# arch/arch.mk.* must be after package/Makefile.in because it may need to
# complement variables defined therein, like BR_NO_CHECK_HASH_FOR.
--include $(wildcard arch/arch.mk.*)
+-include $(sort $(wildcard arch/arch.mk.*))
include support/dependencies/dependencies.mk
PACKAGES += $(DEPENDENCIES_HOST_PREREQ)
-include toolchain/*.mk
-include toolchain/*/*.mk
+include $(sort $(wildcard toolchain/*.mk))
+include $(sort $(wildcard toolchain/*/*.mk))
# Include the package override file if one has been provided in the
# configuration.
@@ -1109,7 +1109,7 @@ print-version:
./support/testing/run-tests -l 2>&1 | sed -r -e '/^test_run \((.*)\).*/!d; s//\1: *runtime_test/' | LC_ALL=C sort >> $@
include docs/manual/manual.mk
--include $(foreach dir,$(BR2_EXTERNAL_DIRS),$(dir)/docs/*/*.mk)
+-include $(foreach dir,$(BR2_EXTERNAL_DIRS),$(sort $(wildcard $(dir)/docs/*/*.mk)))
.PHONY: $(noconfig_targets)
diff --git a/package/gstreamer/gstreamer.mk b/package/gstreamer/gstreamer.mk
index bc886c78a2..22240bceea 100644
--- a/package/gstreamer/gstreamer.mk
+++ b/package/gstreamer/gstreamer.mk
@@ -1 +1 @@
-include package/gstreamer/*/*.mk
+include $(sort $(wildcard package/gstreamer/*/*.mk))
diff --git a/package/gstreamer1/gstreamer1.mk b/package/gstreamer1/gstreamer1.mk
index 5b748e33fb..8530ff027a 100644
--- a/package/gstreamer1/gstreamer1.mk
+++ b/package/gstreamer1/gstreamer1.mk
@@ -1 +1 @@
-include package/gstreamer1/*/*.mk
+include $(sort $(wildcard package/gstreamer1/*/*.mk))
diff --git a/toolchain/toolchain-external/toolchain-external.mk b/toolchain/toolchain-external/toolchain-external.mk
index 48de1e71f2..dd07884c7e 100644
--- a/toolchain/toolchain-external/toolchain-external.mk
+++ b/toolchain/toolchain-external/toolchain-external.mk
@@ -25,4 +25,4 @@ $(error No prefix selected for external toolchain package $(BR2_PACKAGE_PROVIDES
endif
endif
-include toolchain/toolchain-external/*/*.mk
+include $(sort $(wildcard toolchain/toolchain-external/*/*.mk))