[Buildroot] [PATCH] prevent recursion in %_defconfig rules

Jérémy Rosen jeremy.rosen at openwide.fr
Tue Jan 7 16:22:07 UTC 2014


Signed-off-by: Jérémy Rosen <jeremy.rosen at openwide.fr>

---
The following command, run from a clean buildroot checkout

make O=.. BR2_EXTERNAL=.. raspberrypi_defconfig

cause the following output, and makes stop :


make: *** Pas de règle pour fabriquer la cible « /home/rosen/tmp/buildroot/
configs/../configs/../configs/../configs/<lots more >/../configs/
raspberrypi_defconfig », nécessaire pour « /home/rosen/tmp/buildroot/
configs/../configs/../configs/<lots more>/../configs/
raspberrypi_defconfig ». Arrêt.

The problem is that the buildroot makefile has two rules to generate
%_defconfig: One that depends on $(TOPDIR)/configs/%_defconfig and the
other one that depends on $(BR2_EXTERNAL)/configs/%_defconfig.

When one rule checks for the file, the other rule becomes an implicit rule
for the dependancy causing an infinite cross-recursion.

By overriding the implicit rule, we prevent the infinite recursion.
---
 Makefile | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/Makefile b/Makefile
index 4320e7b..41d641c 100644
--- a/Makefile
+++ b/Makefile
@@ -760,10 +760,14 @@ defconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 	@mkdir -p $(BUILD_DIR)/buildroot-config
 	@$(COMMON_CONFIG_ENV) $< --defconfig=$(TOPDIR)/configs/$@ $(CONFIG_CONFIG_IN)
 
+$(TOPDIR)/configs/%_defconfig:;
+
 %_defconfig: $(BUILD_DIR)/buildroot-config/conf $(BR2_EXTERNAL)/configs/%_defconfig outputmakefile
 	@mkdir -p $(BUILD_DIR)/buildroot-config
 	@$(COMMON_CONFIG_ENV) $< --defconfig=$(BR2_EXTERNAL)/configs/$@ $(CONFIG_CONFIG_IN)
 
+$(BR2_EXTERNAL)/configs/%_defconfig:;
+
 savedefconfig: $(BUILD_DIR)/buildroot-config/conf outputmakefile
 	@mkdir -p $(BUILD_DIR)/buildroot-config
 	@$(COMMON_CONFIG_ENV) $< \
-- 
1.8.5.2



More information about the buildroot mailing list