Changeset 5156


Ignore:
Timestamp:
Feb 24, 2010 2:18:01 PM (3 years ago)
Author:
stepan
Message:

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@…>
Acked-by: Stefan Reinauer <stepan@…>

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Makefile

    r5149 r5156  
    127127$(eval $(call evaluate_subdirs, modify)) 
    128128 
     129initobjs:=$(addsuffix .initobj.o, $(basename $(initobjs))) 
     130drivers:=$(addsuffix .driver.o, $(basename $(drivers))) 
     131smmobjs:=$(addsuffix .smmobj.o, $(basename $(smmobjs))) 
     132 
    129133allobjs:=$(foreach var, $(addsuffix s,$(types)), $($(var))) 
    130134alldirs:=$(sort $(abspath $(dir $(allobjs)))) 
     
    161165 
    162166define initobjs_c_template 
    163 $(obj)/$(1)%.o: src/$(1)%.c $(obj)/config.h 
     167$(obj)/$(1)%.initobj.o: src/$(1)%.c $(obj)/config.h 
    164168        @printf "    CC         $$(subst $$(obj)/,,$$(@))\n" 
    165169        $(CC) -m32 $$(CFLAGS) -c -o $$@ $$< 
     
    167171 
    168172define initobjs_S_template 
    169 $(obj)/$(1)%.o: src/$(1)%.S $(obj)/config.h 
     173$(obj)/$(1)%.initobj.o: src/$(1)%.S $(obj)/config.h 
    170174        @printf "    CC         $$(subst $$(obj)/,,$$(@))\n" 
    171175        $(CC) -m32 -DASSEMBLY $$(CFLAGS) -c -o $$@ $$< 
     
    173177 
    174178define drivers_c_template 
    175 $(obj)/$(1)%.o: src/$(1)%.c $(obj)/config.h 
     179$(obj)/$(1)%.driver.o: src/$(1)%.c $(obj)/config.h 
    176180        @printf "    CC         $$(subst $$(obj)/,,$$(@))\n" 
    177181        $(CC) -m32 $$(CFLAGS) -c -o $$@ $$< 
     
    179183 
    180184define drivers_S_template 
    181 $(obj)/$(1)%.o: src/$(1)%.S 
     185$(obj)/$(1)%.driver.o: src/$(1)%.S 
    182186        @printf "    CC         $$(subst $$(obj)/,,$$(@))\n" 
    183187        $(CC) -m32 -DASSEMBLY $$(CFLAGS) -c -o $$@ $$< 
     
    185189 
    186190define smmobjs_c_template 
    187 $(obj)/$(1)%.o: src/$(1)%.c 
     191$(obj)/$(1)%.smmobj.o: src/$(1)%.c 
    188192        @printf "    CC         $$(subst $$(obj)/,,$$(@))\n" 
    189193        $(CC) -m32 $$(CFLAGS) -c -o $$@ $$< 
     
    191195 
    192196define smmobjs_S_template 
    193 $(obj)/$(1)%.o: src/$(1)%.S 
     197$(obj)/$(1)%.smmobj.o: src/$(1)%.S 
    194198        @printf "    CC         $$(subst $$(obj)/,,$$(@))\n" 
    195199        $(CC) -m32 $$(CFLAGS) -c -o $$@ $$< 
  • trunk/src/arch/i386/Makefile.bigbootblock.inc

    r5065 r5156  
    2323        printf '$(foreach crt0,config.h $(crt0s),#include "$(crt0:$(obj)/%=%)"\n)' > $@ 
    2424 
    25 $(obj)/mainboard/$(MAINBOARDDIR)/crt0.o: $(obj)/mainboard/$(MAINBOARDDIR)/crt0.s 
     25$(obj)/mainboard/$(MAINBOARDDIR)/crt0.initobj.o: $(obj)/mainboard/$(MAINBOARDDIR)/crt0.s 
    2626        $(CC) -I$(obj) -Wa,-acdlns -c -o $@ $<  > $(dir $@)/crt0.disasm 
    2727 
  • trunk/src/arch/i386/Makefile.tinybootblock.inc

    r5104 r5156  
    9696        printf '$(foreach crt0,config.h $(crt0s),#include "$(crt0:$(obj)/%=%)"\n)' > $@ 
    9797 
    98 $(obj)/mainboard/$(MAINBOARDDIR)/crt0.o: $(obj)/mainboard/$(MAINBOARDDIR)/crt0.s 
     98$(obj)/mainboard/$(MAINBOARDDIR)/crt0.initobj.o: $(obj)/mainboard/$(MAINBOARDDIR)/crt0.s 
    9999        $(CC) -I$(obj) -Wa,-acdlns -c -o $@ $<  > $(dir $@)/crt0.disasm 
    100100 
Note: See TracChangeset for help on using the changeset viewer.