diff --git a/Makefile b/Makefile index 249cee85d3..c8f1fece9b 100644 --- a/Makefile +++ b/Makefile @@ -848,7 +848,7 @@ define percent_defconfig @$$(COMMON_CONFIG_ENV) BR2_DEFCONFIG=$(1)/configs/$$@ \ $$< --defconfig=$(1)/configs/$$@ $$(CONFIG_CONFIG_IN) endef -$(eval $(foreach d,$(TOPDIR) $(BR2_EXTERNAL_DIRS),$(call percent_defconfig,$(d))$(sep))) +$(eval $(foreach d,$(call reverse,$(TOPDIR) $(BR2_EXTERNAL_DIRS)),$(call percent_defconfig,$(d))$(sep))) savedefconfig: $(BUILD_DIR)/buildroot-config/conf prepare-kconfig @$(COMMON_CONFIG_ENV) $< \ diff --git a/docs/manual/customize-outside-br.txt b/docs/manual/customize-outside-br.txt index 09977e050e..4c0f56813f 100644 --- a/docs/manual/customize-outside-br.txt +++ b/docs/manual/customize-outside-br.txt @@ -169,5 +169,6 @@ And then in +$(BR2_EXTERNAL_FOO_42_PATH)/package/package1+ and + .Note: If a defconfig file is present in more than one br2-external tree, then - the first one is used. It is not possible to override a defconfig - bundled in Buildroot. + the one from the last br2-external tree is used. It is thus possible + to override a defconfig bundled in Buildroot or another br2-external + tree. diff --git a/support/misc/utils.mk b/support/misc/utils.mk index 990a3d1fd6..c44319338e 100644 --- a/support/misc/utils.mk +++ b/support/misc/utils.mk @@ -46,6 +46,10 @@ endef $(eval $(call caseconvert-helper,UPPERCASE,$(join $(addsuffix :,$([FROM])),$([TO])))) $(eval $(call caseconvert-helper,LOWERCASE,$(join $(addsuffix :,$([TO])),$([FROM])))) +# Reverse the orders of words in a list. Again, inspired by the gmsl +# 'reverse' macro. +reverse = $(if $(1),$(call reverse,$(wordlist 2,$(words $(1)),$(1))) $(firstword $(1))) + # Sanitize macro cleans up generic strings so it can be used as a filename # and in rules. Particularly useful for VCS version strings, that can contain # slashes, colons (OK in filenames but not in rules), and spaces.