This patch fixes an issue with the wrong build rules being selected.
authorPatrick Georgi <patrick.georgi@coresystems.de>
Wed, 24 Feb 2010 13:18:01 +0000 (13:18 +0000)
committerStefan Reinauer <stepan@openbios.org>
Wed, 24 Feb 2010 13:18:01 +0000 (13:18 +0000)
Make is free to choose any fitting rule for a target, and so some
obj-y files were compiled with initobj flags. This patch also fixes
the behavior for objects being both in initobj and obj.

At the moment all object rules are the same, but if we start not including
all .c files in romstage.c anymore we need to define __PRE_RAM__ in the
initobj rule and that's when things start breaking.

Signed-off-by: Patrick Georgi <patrick.georgi@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5156 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1

Makefile
src/arch/i386/Makefile.bigbootblock.inc
src/arch/i386/Makefile.tinybootblock.inc

index f9f17f69e93fa4bb7a4a1ca719bc09c92dfc624b..e87c2c8a3b3c56006e790404a8b7edf71b47f68b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -126,6 +126,10 @@ evaluate_subdirs=$(eval cursubdirs:=$(subdirs)) $(eval subdirs:=) $(foreach dir,
 subdirs:=$(PLATFORM-y) $(BUILD-y)
 $(eval $(call evaluate_subdirs, modify))
 
+initobjs:=$(addsuffix .initobj.o, $(basename $(initobjs)))
+drivers:=$(addsuffix .driver.o, $(basename $(drivers)))
+smmobjs:=$(addsuffix .smmobj.o, $(basename $(smmobjs)))
+
 allobjs:=$(foreach var, $(addsuffix s,$(types)), $($(var)))
 alldirs:=$(sort $(abspath $(dir $(allobjs))))
 source_with_ext=$(patsubst $(obj)/%.o,src/%.$(1),$(allobjs))
@@ -160,37 +164,37 @@ $(obj)/$(1)%.o: src/$(1)%.S $(obj)/config.h
 endef
 
 define initobjs_c_template
-$(obj)/$(1)%.o: src/$(1)%.c $(obj)/config.h
+$(obj)/$(1)%.initobj.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)/config.h
+$(obj)/$(1)%.initobj.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)/config.h
+$(obj)/$(1)%.driver.o: src/$(1)%.c $(obj)/config.h
        @printf "    CC         $$(subst $$(obj)/,,$$(@))\n"
        $(CC) -m32 $$(CFLAGS) -c -o $$@ $$<
 endef
 
 define drivers_S_template
-$(obj)/$(1)%.o: src/$(1)%.S
+$(obj)/$(1)%.driver.o: src/$(1)%.S
        @printf "    CC         $$(subst $$(obj)/,,$$(@))\n"
        $(CC) -m32 -DASSEMBLY $$(CFLAGS) -c -o $$@ $$<
 endef
 
 define smmobjs_c_template
-$(obj)/$(1)%.o: src/$(1)%.c
+$(obj)/$(1)%.smmobj.o: src/$(1)%.c
        @printf "    CC         $$(subst $$(obj)/,,$$(@))\n"
        $(CC) -m32 $$(CFLAGS) -c -o $$@ $$<
 endef
 
 define smmobjs_S_template
-$(obj)/$(1)%.o: src/$(1)%.S
+$(obj)/$(1)%.smmobj.o: src/$(1)%.S
        @printf "    CC         $$(subst $$(obj)/,,$$(@))\n"
        $(CC) -m32 $$(CFLAGS) -c -o $$@ $$<
 endef
index a8882316b774fb6ee0ed40ce6236e697c82838e9..fbdc3fb8b924035e0b92e9bab3dcf59ade84c7da 100644 (file)
@@ -22,7 +22,7 @@ $(obj)/crt0_includes.h: $(crt0s)
        @printf "    GEN        $(subst $(obj)/,,$(@))\n"
        printf '$(foreach crt0,config.h $(crt0s),#include "$(crt0:$(obj)/%=%)"\n)' > $@
 
-$(obj)/mainboard/$(MAINBOARDDIR)/crt0.o: $(obj)/mainboard/$(MAINBOARDDIR)/crt0.s
+$(obj)/mainboard/$(MAINBOARDDIR)/crt0.initobj.o: $(obj)/mainboard/$(MAINBOARDDIR)/crt0.s
        $(CC) -I$(obj) -Wa,-acdlns -c -o $@ $<  > $(dir $@)/crt0.disasm
 
 $(obj)/mainboard/$(MAINBOARDDIR)/crt0.s: $(src)/arch/i386/init/crt0.S.lb $(obj)/crt0_includes.h
index 9c048006bbf0daee56df1356b933f31dd586e66b..8911844d9e160a5f6d56b9a28d0b589aa5a55cc6 100644 (file)
@@ -95,7 +95,7 @@ $(obj)/romstage/crt0_includes.h: $(crt0s)
        mkdir -p $(obj)/romstage
        printf '$(foreach crt0,config.h $(crt0s),#include "$(crt0:$(obj)/%=%)"\n)' > $@
 
-$(obj)/mainboard/$(MAINBOARDDIR)/crt0.o: $(obj)/mainboard/$(MAINBOARDDIR)/crt0.s
+$(obj)/mainboard/$(MAINBOARDDIR)/crt0.initobj.o: $(obj)/mainboard/$(MAINBOARDDIR)/crt0.s
        $(CC) -I$(obj) -Wa,-acdlns -c -o $@ $<  > $(dir $@)/crt0.disasm
 
 $(obj)/mainboard/$(MAINBOARDDIR)/crt0.s: $(src)/arch/i386/init/crt0.S.lb $(obj)/romstage/crt0_includes.h