Place the .config file in the output directory. This makes it easier to have multiple output directories with different configurations as "make OUT=out-${config}/" will automatically switch to the correct configuration. It also allows to do parallel builds of different configurations.
To simplify transition copy over the .config file in case there is one at the old location but not at the new location.
Signed-off-by: Gerd Hoffmann kraxel@redhat.com --- Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Makefile b/Makefile index 3984d35..dd5230e 100644 --- a/Makefile +++ b/Makefile @@ -65,7 +65,7 @@ endif export HOSTCC := $(CC) export CONFIG_SHELL := sh export KCONFIG_AUTOHEADER := autoconf.h -export KCONFIG_CONFIG := $(CURDIR)/.config +export KCONFIG_CONFIG := $(abspath $(OUT))/.config AS=as OBJCOPY=objcopy OBJDUMP=objdump @@ -233,6 +233,7 @@ $(OUT)src/fw/acpi.o: $(OUT)src/fw/acpi-dsdt.hex $(OUT)src/fw/ssdt-proc.hex $(OUT define do-kconfig $(Q)mkdir -p $(OUT)/scripts/kconfig/lxdialog $(Q)mkdir -p $(OUT)/include/config +$(Q)if test -f $(CURDIR)/.config -a ! -f $(KCONFIG_CONFIG); then cp -v $(CURDIR)/.config $(KCONFIG_CONFIG); fi $(Q)$(MAKE) -C $(OUT) -f $(CURDIR)/scripts/kconfig/Makefile srctree=$(CURDIR) src=scripts/kconfig obj=scripts/kconfig Q=$(Q) Kconfig=$(CURDIR)/src/Kconfig $1 endef
On Fri, Sep 20, 2013 at 10:02:50AM +0200, Gerd Hoffmann wrote:
Place the .config file in the output directory. This makes it easier to have multiple output directories with different configurations as "make OUT=out-${config}/" will automatically switch to the correct configuration. It also allows to do parallel builds of different configurations.
To simplify transition copy over the .config file in case there is one at the old location but not at the new location.
This would mean that "make clean" would remove .config.
I don't think this is the right thing to do. If a user wants a different location for .config they can run "make KCONFIG_CONFIG=foo".
-Kevin