From patchwork Tue Jan 7 16:22:07 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jeremy Rosen X-Patchwork-Id: 307701 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id EAB452C00E7 for ; Wed, 8 Jan 2014 03:22:20 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 3EDB3814C0; Tue, 7 Jan 2014 16:22:19 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id iW7T0VP6xMF5; Tue, 7 Jan 2014 16:22:18 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 6558681092; Tue, 7 Jan 2014 16:22:18 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id AAF5C1BF9D3 for ; Tue, 7 Jan 2014 16:22:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id A3B9381092 for ; Tue, 7 Jan 2014 16:22:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CnYbNBRJhCKM for ; Tue, 7 Jan 2014 16:22:15 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from zimbra3.corp.accelance.fr (zimbra3.corp.accelance.fr [213.162.49.233]) by whitealder.osuosl.org (Postfix) with ESMTP id 193DC8082B for ; Tue, 7 Jan 2014 16:22:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by zimbra3.corp.accelance.fr (Postfix) with ESMTP id C02F4604CB for ; Tue, 7 Jan 2014 17:22:12 +0100 (CET) X-Virus-Scanned: amavisd-new at zimbra3.corp.accelance.fr Received: from zimbra3.corp.accelance.fr ([127.0.0.1]) by localhost (zimbra3.corp.accelance.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 48wfoFHBB20b; Tue, 7 Jan 2014 17:22:12 +0100 (CET) Received: from pcrosen.daviel.openwide.fr. (unknown [193.56.60.160]) by zimbra3.corp.accelance.fr (Postfix) with ESMTPSA id 14D236049F; Tue, 7 Jan 2014 17:22:12 +0100 (CET) From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Rosen?= To: buildroot@busybox.net Date: Tue, 7 Jan 2014 17:22:07 +0100 Message-Id: <1389111727-11021-1-git-send-email-jeremy.rosen@openwide.fr> X-Mailer: git-send-email 1.8.5.2 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] prevent recursion in %_defconfig rules X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Signed-off-by: Jérémy Rosen --- 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//../configs/ raspberrypi_defconfig », nécessaire pour « /home/rosen/tmp/buildroot/ configs/../configs/../configs//../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) $< \