summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorStefan Reinauer <stepan@coresystems.de>2010-02-11 03:21:29 +0000
committerStefan Reinauer <stepan@openbios.org>2010-02-11 03:21:29 +0000
commitb4d3af8888f261abb1f45ca42503f7170bdb3470 (patch)
treefc054166ea879023876ecc10f154f3d78ed86f13 /Makefile
parente82f4754ee905437d434f0d58c03e9ee2929224e (diff)
separate build.h and config.h usage (now possible because newconfig is gone)
Signed-off-by: Stefan Reinauer <stepan@coresystems.de> Acked-by: Patrick Georgi <patrick.georgi@coresystems.de> This patch is slightly reworked to include a necessary romcc change that allows more than one -include specified on the command line, and gets rid of the explicit build.h dependencies of all files. (The files do keep an explicit config.h dependency though) git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5114 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile19
1 files changed, 11 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 65a740595a..5b1e42ebef 100644
--- a/Makefile
+++ b/Makefile
@@ -148,31 +148,31 @@ $(obj)/$(1)%.o: src/$(1)%.asl
endef
define objs_c_template
-$(obj)/$(1)%.o: src/$(1)%.c $(obj)/build.h
+$(obj)/$(1)%.o: src/$(1)%.c $(obj)/config.h
@printf " CC $$(subst $$(obj)/,,$$(@))\n"
$(CC) -m32 $$(CFLAGS) -c -o $$@ $$<
endef
define objs_S_template
-$(obj)/$(1)%.o: src/$(1)%.S $(obj)/build.h
+$(obj)/$(1)%.o: src/$(1)%.S $(obj)/config.h
@printf " CC $$(subst $$(obj)/,,$$(@))\n"
$(CC) -m32 -DASSEMBLY $$(CFLAGS) -c -o $$@ $$<
endef
define initobjs_c_template
-$(obj)/$(1)%.o: src/$(1)%.c $(obj)/build.h
+$(obj)/$(1)%.o: src/$(1)%.c $(obj)/config.h
@printf " CC $$(subst $$(obj)/,,$$(@))\n"
$(CC) -m32 $$(CFLAGS) -c -o $$@ $$<
endef
define initobjs_S_template
-$(obj)/$(1)%.o: src/$(1)%.S $(obj)/build.h
+$(obj)/$(1)%.o: src/$(1)%.S $(obj)/config.h
@printf " CC $$(subst $$(obj)/,,$$(@))\n"
$(CC) -m32 -DASSEMBLY $$(CFLAGS) -c -o $$@ $$<
endef
define drivers_c_template
-$(obj)/$(1)%.o: src/$(1)%.c $(obj)/build.h
+$(obj)/$(1)%.o: src/$(1)%.c $(obj)/config.h
@printf " CC $$(subst $$(obj)/,,$$(@))\n"
$(CC) -m32 $$(CFLAGS) -c -o $$@ $$<
endef
@@ -219,7 +219,7 @@ OBJS := $(patsubst %,$(obj)/%,$(TARGETS-y))
INCLUDES := -I$(top)/src -I$(top)/src/include -I$(obj) -I$(top)/src/arch/$(ARCHDIR-y)/include
INCLUDES += -I$(shell $(CC) -print-search-dirs | head -n 1 | cut -d' ' -f2)include
INCLUDES += -I$(top)/util/x86emu/include
-INCLUDES += -include $(obj)/build.h
+INCLUDES += -include $(obj)/config.h
CFLAGS = $(INCLUDES) -Os -nostdinc
CFLAGS += -nostdlib -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes
@@ -250,7 +250,10 @@ prepare2: $(obj)/build.h
$(obj)/build.h:
@printf " GEN build.h\n"
rm -f $(obj)/build.h
- printf "#define COREBOOT_VERSION \"$(KERNELVERSION)\"\n" > $(obj)/build.ht
+ printf "/* build system definitions (autogenerated) */\n" > $(obj)/build.ht
+ printf "#ifndef __BUILD_H\n" >> $(obj)/build.ht
+ printf "#define __BUILD_H\n\n" >> $(obj)/build.ht
+ 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
@@ -261,7 +264,7 @@ $(obj)/build.h:
printf "#define COREBOOT_COMPILE_BY \"$(subst \,@,$(shell PATH=$$PATH:/usr/ucb whoami))\"\n" >> $(obj)/build.ht
printf "#define COREBOOT_COMPILE_HOST \"$(shell hostname -s)\"\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
+ printf "#endif\n" >> $(obj)/build.ht
mv $(obj)/build.ht $(obj)/build.h
doxy: doxygen