From b4d3af8888f261abb1f45ca42503f7170bdb3470 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Thu, 11 Feb 2010 03:21:29 +0000 Subject: separate build.h and config.h usage (now possible because newconfig is gone) Signed-off-by: Stefan Reinauer Acked-by: Patrick Georgi 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 --- Makefile | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'Makefile') 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 -- cgit v1.2.3