61aee5f4b1
http://www.coreboot.org/pipermail/coreboot/2007-September/024665.html It's about time we follow this advice. Also move some manually set __PRE_RAM__ defines (ap_romstage.c) to the Makefile and drop unused CPP define Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org> Acked-by: Patrick Georgi <patrick@georgi-clan.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6482 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
38 lines
1.6 KiB
PHP
38 lines
1.6 KiB
PHP
#######################################################################
|
|
# Build the final rom image
|
|
|
|
$(obj)/coreboot.pre: $(obj)/coreboot.pre1 $(CBFSTOOL)
|
|
rm -f $@
|
|
cp $(obj)/coreboot.pre1 $@
|
|
|
|
#######################################################################
|
|
# Build the bootblock
|
|
|
|
$(obj)/coreboot.bootblock: $(obj)/coreboot
|
|
@printf " OBJCOPY $(subst $(obj)/,,$(@))\n"
|
|
$(OBJCOPY) -O binary $< $@
|
|
|
|
$(obj)/ldscript.ld: $$(ldscripts) $(obj)/ldoptions
|
|
printf 'INCLUDE "ldoptions"\n' > $@
|
|
printf '$(foreach ldscript,$(ldscripts),INCLUDE "$(ldscript:$(obj)/%=%)"\n)' >> $@
|
|
|
|
$(obj)/crt0.S: $$(crt0s)
|
|
@printf " GEN $(subst $(obj)/,,$(@))\n"
|
|
printf '$(foreach crt0,config.h $(crt0s),#include "$(crt0:$(obj)/%=%)"\n)' > $@
|
|
|
|
$(obj)/mainboard/$(MAINBOARDDIR)/crt0.romstage.o: $(obj)/mainboard/$(MAINBOARDDIR)/crt0.s
|
|
@printf " CC $(subst $(obj)/,,$(@))\n"
|
|
$(CC) -MMD -I$(obj) -Wa,-acdlns -c -o $@ $< > $(dir $@)/crt0.disasm
|
|
|
|
$(obj)/mainboard/$(MAINBOARDDIR)/crt0.s: $(obj)/crt0.S
|
|
@printf " CC $(subst $(obj)/,,$(@))\n"
|
|
$(CC) -MMD -x assembler-with-cpp -E -I$(src)/include -I$(src)/arch/x86/include -I$(obj) -include $(obj)/config.h -I. -I$(src) $< -o $@
|
|
|
|
$(obj)/coreboot: $$(romstage-objs) $(obj)/ldscript.ld
|
|
@printf " LINK $(subst $(obj)/,,$(@))\n"
|
|
$(CC) -nostdlib -nostartfiles -static -o $@ -L$(obj) -T $(obj)/ldscript.ld $(romstage-objs)
|
|
$(NM) -n $(obj)/coreboot | sort > $(obj)/coreboot.map
|
|
$(OBJCOPY) --only-keep-debug $@ $(obj)/bootblock.debug
|
|
$(OBJCOPY) --strip-debug $@
|
|
$(OBJCOPY) --add-gnu-debuglink=$(obj)/bootblock.debug $@
|
|
|