[coreboot] [commit] r5156 - in trunk: . src/arch/i386

repository service svn at coreboot.org
Wed Feb 24 14:18:01 CET 2010


Author: stepan
Date: Wed Feb 24 14:18:01 2010
New Revision: 5156
URL: http://tracker.coreboot.org/trac/coreboot/changeset/5156

Log:
This patch fixes an issue with the wrong build rules being selected.
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 at coresystems.de>
Acked-by: Stefan Reinauer <stepan at coresystems.de>

Modified:
   trunk/Makefile
   trunk/src/arch/i386/Makefile.bigbootblock.inc
   trunk/src/arch/i386/Makefile.tinybootblock.inc

Modified: trunk/Makefile
==============================================================================
--- trunk/Makefile	Wed Feb 24 14:09:09 2010	(r5155)
+++ trunk/Makefile	Wed Feb 24 14:18:01 2010	(r5156)
@@ -126,6 +126,10 @@
 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 @@
 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

Modified: trunk/src/arch/i386/Makefile.bigbootblock.inc
==============================================================================
--- trunk/src/arch/i386/Makefile.bigbootblock.inc	Wed Feb 24 14:09:09 2010	(r5155)
+++ trunk/src/arch/i386/Makefile.bigbootblock.inc	Wed Feb 24 14:18:01 2010	(r5156)
@@ -22,7 +22,7 @@
 	@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

Modified: trunk/src/arch/i386/Makefile.tinybootblock.inc
==============================================================================
--- trunk/src/arch/i386/Makefile.tinybootblock.inc	Wed Feb 24 14:09:09 2010	(r5155)
+++ trunk/src/arch/i386/Makefile.tinybootblock.inc	Wed Feb 24 14:18:01 2010	(r5156)
@@ -95,7 +95,7 @@
 	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




More information about the coreboot mailing list