summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Georgi <patrick.georgi@coresystems.de>2010-01-29 17:38:57 +0000
committerPatrick Georgi <patrick.georgi@coresystems.de>2010-01-29 17:38:57 +0000
commitcccbb898e2568178ea251b9c19242809a79efc62 (patch)
tree5a6f30de5de1635e361fc4df6a89737c9a89bf50
parent24ddfd4b7dd521d5acf52fb35f197ecacc86991d (diff)
downloadcoreboot-cccbb898e2568178ea251b9c19242809a79efc62.tar.xz
Make $(obj)/build.h an explicit dependency for all
object files, as it's dragged into the build by -include $(obj)/build.h for pretty much everything. Also, generate build.h atomically. This fixes parallel build with kconfig on my box. Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de> Acked-by: Ronald G. Minnich <rminnich@gmail.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5062 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
-rw-r--r--Makefile42
1 files changed, 23 insertions, 19 deletions
diff --git a/Makefile b/Makefile
index 067b83dea8..51bdcecfb0 100644
--- a/Makefile
+++ b/Makefile
@@ -140,7 +140,7 @@ $(eval $(call evaluate_subdirs))
define c_dsl_template
-$(obj)/$(1)%.c: src/$(1)%.dsl
+$(obj)/$(1)%.c: src/$(1)%.dsl $(obj)/build.h
@printf " IASL $$(subst $$(shell pwd)/,,$$(@))\n"
iasl -p $$(basename $$@) -tc $$<
perl -pi -e 's/AmlCode/AmlCode_$$(notdir $$(basename $$@))/g' $$(basename $$@).hex
@@ -148,31 +148,31 @@ $(obj)/$(1)%.c: src/$(1)%.dsl
endef
define objs_c_template
-$(obj)/$(1)%.o: src/$(1)%.c
+$(obj)/$(1)%.o: src/$(1)%.c $(obj)/build.h
@printf " CC $$(subst $$(obj)/,,$$(@))\n"
$(CC) -m32 $$(CFLAGS) -c -o $$@ $$<
endef
define objs_S_template
-$(obj)/$(1)%.o: src/$(1)%.S
+$(obj)/$(1)%.o: src/$(1)%.S $(obj)/build.h
@printf " CC $$(subst $$(obj)/,,$$(@))\n"
$(CC) -m32 -DASSEMBLY $$(CFLAGS) -c -o $$@ $$<
endef
define initobjs_c_template
-$(obj)/$(1)%.o: src/$(1)%.c
+$(obj)/$(1)%.o: src/$(1)%.c $(obj)/build.h
@printf " CC $$(subst $$(obj)/,,$$(@))\n"
$(CC) -m32 $$(CFLAGS) -c -o $$@ $$<
endef
define initobjs_S_template
-$(obj)/$(1)%.o: src/$(1)%.S
+$(obj)/$(1)%.o: src/$(1)%.S $(obj)/build.h
@printf " CC $$(subst $$(obj)/,,$$(@))\n"
$(CC) -m32 -DASSEMBLY $$(CFLAGS) -c -o $$@ $$<
endef
define drivers_c_template
-$(obj)/$(1)%.o: src/$(1)%.c
+$(obj)/$(1)%.o: src/$(1)%.c $(obj)/build.h
@printf " CC $$(subst $$(obj)/,,$$(@))\n"
$(CC) -m32 $$(CFLAGS) -c -o $$@ $$<
endef
@@ -257,20 +257,24 @@ prepare:
mkdir -p $(obj)/util/kconfig/lxdialog
test -n "$(alldirs)" && mkdir -p $(alldirs) || true
-prepare2:
+prepare2: $(obj)/build.h
+
+$(obj)/build.h:
@printf " GEN build.h\n"
- printf "#define COREBOOT_VERSION \"$(KERNELVERSION)\"\n" > $(obj)/build.h
- printf "#define COREBOOT_EXTRA_VERSION \"$(COREBOOT_EXTRA_VERSION)\"\n" >> $(obj)/build.h
- printf "#define COREBOOT_BUILD \"`LANG= date`\"\n" >> $(obj)/build.h
- printf "\n" >> $(obj)/build.h
- printf "#define COREBOOT_COMPILER \"$(shell LANG= $(CC) --version | head -n1)\"\n" >> $(obj)/build.h
- printf "#define COREBOOT_ASSEMBLER \"$(shell LANG= $(AS) --version | head -n1)\"\n" >> $(obj)/build.h
- printf "#define COREBOOT_LINKER \"$(shell LANG= $(LD) --version | head -n1)\"\n" >> $(obj)/build.h
- printf "#define COREBOOT_COMPILE_TIME \"`LANG= date +%T`\"\n" >> $(obj)/build.h
- printf "#define COREBOOT_COMPILE_BY \"$(shell PATH=$$PATH:/usr/ucb whoami)\"\n" >> $(obj)/build.h
- printf "#define COREBOOT_COMPILE_HOST \"$(shell hostname)\"\n" >> $(obj)/build.h
- printf "#define COREBOOT_COMPILE_DOMAIN \"$(shell test `uname -s` = "Linux" && dnsdomainname || domainname)\"\n" >> $(obj)/build.h
- printf "#include \"config.h\"\n" >> $(obj)/build.h
+ rm -f $(obj)/build.h
+ printf "#define COREBOOT_VERSION \"$(KERNELVERSION)\"\n" > $(obj)/build.ht
+ printf "#define COREBOOT_EXTRA_VERSION \"$(COREBOOT_EXTRA_VERSION)\"\n" >> $(obj)/build.ht
+ printf "#define COREBOOT_BUILD \"`LANG= date`\"\n" >> $(obj)/build.ht
+ printf "\n" >> $(obj)/build.ht
+ printf "#define COREBOOT_COMPILER \"$(shell LANG= $(CC) --version | head -n1)\"\n" >> $(obj)/build.ht
+ printf "#define COREBOOT_ASSEMBLER \"$(shell LANG= $(AS) --version | head -n1)\"\n" >> $(obj)/build.ht
+ printf "#define COREBOOT_LINKER \"$(shell LANG= $(LD) --version | head -n1)\"\n" >> $(obj)/build.ht
+ printf "#define COREBOOT_COMPILE_TIME \"`LANG= date +%T`\"\n" >> $(obj)/build.ht
+ printf "#define COREBOOT_COMPILE_BY \"$(subst \,@,$(shell PATH=$$PATH:/usr/ucb whoami))\"\n" >> $(obj)/build.ht
+ printf "#define COREBOOT_COMPILE_HOST \"$(shell hostname)\"\n" >> $(obj)/build.ht
+ printf "#define COREBOOT_COMPILE_DOMAIN \"$(shell test `uname -s` = "Linux" && dnsdomainname || domainname)\"\n" >> $(obj)/build.ht
+ printf "#include \"config.h\"\n" >> $(obj)/build.ht
+ mv $(obj)/build.ht $(obj)/build.h
doxy: doxygen
doxygen: