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: 7247711 Return-Path: X-Original-To: patchwork-linux-kbuild@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AB8DD9F372 for ; Wed, 23 Sep 2015 05:41:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E080820A68 for ; Wed, 23 Sep 2015 05:41:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 751BB2065B for ; Wed, 23 Sep 2015 05:41:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751901AbbIWFkl (ORCPT ); Wed, 23 Sep 2015 01:40:41 -0400 Received: from ozlabs.org ([103.22.144.67]:40152 "EHLO ozlabs.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751604AbbIWFkj (ORCPT ); Wed, 23 Sep 2015 01:40:39 -0400 Received: by ozlabs.org (Postfix, from userid 1034) id 404831402D6; Wed, 23 Sep 2015 15:40:37 +1000 (AEST) From: Michael Ellerman To: Cc: , linux-kbuild@vger.kernel.org, yann.morin.1998@free.fr, mmarek@suse.com 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 Sender: linux-kbuild-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kbuild@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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