[SeaBIOS] [PATCH] build: move .config to $(OUT)

Gerd Hoffmann kraxel at redhat.com
Fri Sep 20 10:02:50 CEST 2013

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

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 at 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
@@ -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

More information about the SeaBIOS mailing list