diff mbox

Support nested config directories

Message ID 1463019163-27543-1-git-send-email-patrick@stwcx.xyz
State Superseded
Headers show

Commit Message

Patrick Williams May 12, 2016, 2:12 a.m. UTC
From: Elizabeth Liner <eliner@us.ibm.com>

Adds an additional recipe to search configs/*/ for defconfig files.
Recipe added for both $(TOPDIR) and $(BR2_EXTERNAL) to allow nested
directories for both locations.

Signed-off-by: Elizabeth Liner <eliner@us.ibm.com>
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
---
 Makefile | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Thomas Petazzoni May 12, 2016, 1:55 p.m. UTC | #1
Hello,

On Wed, 11 May 2016 21:12:43 -0500, Patrick Williams wrote:
> From: Elizabeth Liner <eliner@us.ibm.com>
> 
> Adds an additional recipe to search configs/*/ for defconfig files.
> Recipe added for both $(TOPDIR) and $(BR2_EXTERNAL) to allow nested
> directories for both locations.
> 
> Signed-off-by: Elizabeth Liner <eliner@us.ibm.com>
> Signed-off-by: Patrick Williams <patrick@stwcx.xyz>

I believe this would not work well without changes if we were to merge
something like https://patchwork.ozlabs.org/patch/619719/ (which allows
to generate defconfig from fragments).

Could you work with your IBM colleagues to have a solution that works
for both use cases?

Best regards,

Thomas
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 32bbfc4..81a9c6d 100644
--- a/Makefile
+++ b/Makefile
@@ -850,6 +850,14 @@  defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 	@$(COMMON_CONFIG_ENV) BR2_DEFCONFIG=$(BR2_EXTERNAL)/configs/$@ \
 		$< --defconfig=$(BR2_EXTERNAL)/configs/$@ $(CONFIG_CONFIG_IN)
 
+%_defconfig: $(BUILD_DIR)/buildroot-config/conf $(wildcard $(TOPDIR)/configs/*/%_defconfig) outputmakefile
+	@$(COMMON_CONFIG_ENV) BR2_DEFCONFIG=$(wildcard $(TOPDIR)/configs/*/$@) \
+		$< --defconfig=$(wildcard $(TOPDIR)/configs/*/$@) $(CONFIG_CONFIG_IN)
+
+%_defconfig: $(BUILD_DIR)/buildroot-config/conf $(wildcard $(BR2_EXTERNAL)/configs/*/%_defconfig) outputmakefile
+	@$(COMMON_CONFIG_ENV) BR2_DEFCONFIG=$(wildcard $(BR2_EXTERNAL)/configs/*/$@) \
+		$< --defconfig=$(wildcard $(BR2_EXTERNAL)/configs/*/$@) $(CONFIG_CONFIG_IN)
+
 savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 	@$(COMMON_CONFIG_ENV) $< \
 		--savedefconfig=$(if $(DEFCONFIG),$(DEFCONFIG),$(CONFIG_DIR)/defconfig) \