diff mbox

[2/4] kbuild: reduce kbuild invasivity within kconfig

Message ID 1313472854-14426-3-git-send-email-lacombar@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Arnaud Lacombe Aug. 16, 2011, 5:34 a.m. UTC
Introduce `Kconfig' and `KCONFIG_DEFCONFIG' as a Kconfig's interface to kbuild.
These variable are set in the top-level Makefile, which remove reference to
KBUILD_ prefixed variable within Kconfig makefile.

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
---
 Makefile                 |    8 ++++++--
 scripts/kconfig/Makefile |   14 +++++---------
 2 files changed, 11 insertions(+), 11 deletions(-)
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 26798a4..e7b576e 100644
--- a/Makefile
+++ b/Makefile
@@ -238,6 +238,9 @@  endif
 KBUILD_CONFIG	?= .config
 export KBUILD_CONFIG
 
+KBUILD_KCONFIG	?= Kconfig
+export KBUILD_KCONFIG
+
 # SHELL used by kbuild
 CONFIG_SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
 	  else if [ -x /bin/bash ]; then echo /bin/bash; \
@@ -482,11 +485,12 @@  ifeq ($(config-targets),1)
 # KBUILD_DEFCONFIG may point out an alternative default configuration
 # used for 'make defconfig'
 include $(srctree)/arch/$(SRCARCH)/Makefile
-export KBUILD_DEFCONFIG KBUILD_KCONFIG
 
 # Prepare Kconfig environment
+Kconfig           = $(KBUILD_KCONFIG)
 KCONFIG_CONFIG    = $(KBUILD_CONFIG)
-export KCONFIG_CONFIG
+KCONFIG_DEFCONFIG = $(KBUILD_DEFCONFIG)
+export Kconfig KCONFIG_CONFIG KCONFIG_DEFCONFIG
 
 config: scripts_basic outputmakefile FORCE
 	$(Q)mkdir -p include/linux include/config
diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile
index 3fa5a65..dabb4f1 100644
--- a/scripts/kconfig/Makefile
+++ b/scripts/kconfig/Makefile
@@ -5,13 +5,9 @@ 
 PHONY += oldconfig xconfig gconfig menuconfig config silentoldconfig update-po-config \
 	localmodconfig localyesconfig
 
-ifdef KBUILD_KCONFIG
-Kconfig := $(KBUILD_KCONFIG)
-else
-Kconfig := Kconfig
-endif
-
+Kconfig           ?= Kconfig
 KCONFIG_CONFIG    ?= .config
+KCONFIG_DEFCONFIG ?=
 export KCONFIG_CONFIG
 
 xconfig: $(obj)/qconf
@@ -113,11 +109,11 @@  savedefconfig: $(obj)/conf
 	$< --$@=defconfig $(Kconfig)
 
 defconfig: $(obj)/conf
-ifeq ($(KBUILD_DEFCONFIG),)
+ifeq ($(KCONFIG_DEFCONFIG),)
 	$< --defconfig $(Kconfig)
 else
-	@echo "*** Default configuration is based on '$(KBUILD_DEFCONFIG)'"
-	$(Q)$< --defconfig=arch/$(SRCARCH)/configs/$(KBUILD_DEFCONFIG) $(Kconfig)
+	@echo "*** Default configuration is based on '$(KCONFIG_DEFCONFIG)'"
+	$(Q)$< --defconfig=arch/$(SRCARCH)/configs/$(KCONFIG_DEFCONFIG) $(Kconfig)
 endif
 
 %_defconfig: $(obj)/conf