From patchwork Wed Sep 23 05:40:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 521588 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 867371402D4 for ; Wed, 23 Sep 2015 15:41:37 +1000 (AEST) Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 6CCE81A0AD5 for ; Wed, 23 Sep 2015 15:41:37 +1000 (AEST) X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 6C0191A001E for ; Wed, 23 Sep 2015 15:40:37 +1000 (AEST) Received: by ozlabs.org (Postfix) id 5230A1402D4; Wed, 23 Sep 2015 15:40:37 +1000 (AEST) Delivered-To: linuxppc-dev@ozlabs.org Received: by ozlabs.org (Postfix, from userid 1034) id 404831402D6; Wed, 23 Sep 2015 15:40:37 +1000 (AEST) From: Michael Ellerman To: Subject: [RFC PATCH 1/2] scripts/kconfig/Makefile: Allow KBUILD_DEFCONFIG to be a target Date: Wed, 23 Sep 2015 15:40:34 +1000 Message-Id: <1442986835-13985-1-git-send-email-mpe@ellerman.id.au> X-Mailer: git-send-email 2.1.4 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mmarek@suse.com, linux-kernel@vger.kernel.org, yann.morin.1998@free.fr, linux-kbuild@vger.kernel.org MIME-Version: 1.0 Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Arch Makefiles can set KBUILD_DEFCONFIG to tell kbuild the name of the defconfig that should be built by default. However currently there is an assumption that KBUILD_DEFCONFIG points to a file at arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG). We would like to use a target, using merge_config, as our defconfig, so adapt the logic in scripts/kconfig/Makefile to allow that. To minimise the chance of breaking anything, we first check if KBUILD_DEFCONFIG is a file, and if so we do the old logic. If it's not a file, then we call the top-level Makefile with KBUILD_DEFCONFIG as the target. Signed-off-by: Michael Ellerman Acked-by: Michal Marek --- scripts/kconfig/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index aceaaed09811..b2b9c87cec50 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -96,9 +96,12 @@ savedefconfig: $(obj)/conf defconfig: $(obj)/conf ifeq ($(KBUILD_DEFCONFIG),) $< $(silent) --defconfig $(Kconfig) -else +else ifneq ($(wildcard arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG)),) @$(kecho) "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'" $(Q)$< $(silent) --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig) +else + @$(kecho) "*** Default configuration is based on target '$(KBUILD_DEFCONFIG)'" + $(Q)$(MAKE) -f $(srctree)/Makefile $(KBUILD_DEFCONFIG) endif %_defconfig: $(obj)/conf