From patchwork Tue Jul 13 01:43:22 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Rothwell X-Patchwork-Id: 58697 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from bilbo.ozlabs.org (localhost [127.0.0.1]) by ozlabs.org (Postfix) with ESMTP id 04B86100977 for ; Tue, 13 Jul 2010 11:43:31 +1000 (EST) Received: from smtps.tip.net.au (chilli.pcug.org.au [203.10.76.44]) by ozlabs.org (Postfix) with ESMTP id CE4EEB6F10 for ; Tue, 13 Jul 2010 11:43:23 +1000 (EST) Received: from canb.auug.org.au (ibmaus65.lnk.telstra.net [165.228.126.9]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtps.tip.net.au (Postfix) with ESMTPSA id 49225144008; Tue, 13 Jul 2010 11:43:22 +1000 (EST) Date: Tue, 13 Jul 2010 11:43:22 +1000 From: Stephen Rothwell To: Linus , Michal Marek Subject: [PATCH] kbuild: Enable building defconfigs from Kconfig files Message-Id: <20100713114322.57c8b166.sfr@canb.auug.org.au> X-Mailer: Sylpheed 3.0.2 (GTK+ 2.20.1; i486-pc-linux-gnu) Mime-Version: 1.0 Cc: Catalin Marinas , Andrew Morton , ppc-dev , LKML X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org After this change, doing a "make xxx_defconfig" will check first for a file called arch//configs/Kconfig.xxx and use that to generate the .config (effectively starting from an allnoconfig). If that file doesn't exist, it will use arch//configs/xxx_defconfig as now. Signed-off-by: Stephen Rothwell --- scripts/kconfig/Makefile | 14 +++++++++++++- 1 files changed, 13 insertions(+), 1 deletions(-) Hi Linus, Is this more the direction you want to take? There are still 2 main problems with is approach: - there are some config options that are globally and unconditionally enabled that some platforms may not want. The only way currently to turn them off is to reproduce the config entry with the different default. I am not sure if we need a wa to turn them off or to just change them to being neede to be selected by those that do want them. - we have no way to select options that are neither bool or tristate to suitable values. Again the only way to do that currently is to reproduce the config entry with a different default value. I am currently working towards using this to recreate the PowerPC defconfigs, but it is a slow process as they have some much stuff enabled in them and some of it is probably actually not relevant. This process is made easier by the recent commit "kbuild: Warn on selecting symbols with unmet direct dependencies" that is in the kbuild tree (and linux-next). diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index 7ea649d..1ab8f45 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -117,9 +117,21 @@ else $(Q)$< -D arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig) endif -%_defconfig: $(obj)/conf +configs_dir := $(srctree)/arch/$(SRCARCH)/configs +# We check a level of sub directories because arch/powerpc +# has its defconfig files arranged that way +old_defconfigs := $(patsubst $(configs_dir)/%,%,\ + $(wildcard $(configs_dir)/*_defconfig) \ + $(wildcard $(configs_dir)/*/*_defconfig)) +defconfigs := $(patsubst $(configs_dir)/Kconfig.%,%_defconfig,\ + $(wildcard $(configs_dir)/Kconfig.*)) + +$(old_defconfigs): %_defconfig: $(obj)/conf $(Q)$< -D arch/$(SRCARCH)/configs/$@ $(Kconfig) +$(defconfigs): %_defconfig: $(obj)/conf + $(Q)$< -n arch/$(SRCARCH)/configs/Kconfig.$* + # Help text used by make help help: @echo ' config - Update current config utilising a line-oriented program'