2009-12-23 13:52:56 +01:00
|
|
|
#######################################################################
|
|
|
|
# Build the final rom image
|
|
|
|
|
|
|
|
$(obj)/coreboot.pre: $(obj)/coreboot.bootblock $(CBFSTOOL)
|
|
|
|
rm -f $@
|
|
|
|
$(CBFSTOOL) $@ create $(CONFIG_COREBOOT_ROMSIZE_KB)K $(obj)/coreboot.bootblock
|
|
|
|
|
|
|
|
#######################################################################
|
|
|
|
# Build the bootblock
|
|
|
|
|
|
|
|
$(obj)/coreboot.bootblock: $(obj)/coreboot
|
|
|
|
@printf " OBJCOPY $(subst $(obj)/,,$(@))\n"
|
|
|
|
$(OBJCOPY) -O binary $< $@
|
|
|
|
|
2010-03-27 18:18:39 +01:00
|
|
|
$(obj)/ldscript.ld: $$(ldscripts) $(obj)/ldoptions
|
2009-12-23 13:52:56 +01:00
|
|
|
printf 'INCLUDE "ldoptions"\n' > $@
|
|
|
|
printf '$(foreach ldscript,$(ldscripts),INCLUDE "$(ldscript:$(obj)/%=%)"\n)' >> $@
|
|
|
|
|
2010-04-08 23:04:45 +02:00
|
|
|
$(obj)/crt0.S: $$(crt0s)
|
2010-01-30 10:47:18 +01:00
|
|
|
@printf " GEN $(subst $(obj)/,,$(@))\n"
|
2009-12-23 13:52:56 +01:00
|
|
|
printf '$(foreach crt0,config.h $(crt0s),#include "$(crt0:$(obj)/%=%)"\n)' > $@
|
|
|
|
|
2010-02-24 14:18:01 +01:00
|
|
|
$(obj)/mainboard/$(MAINBOARDDIR)/crt0.initobj.o: $(obj)/mainboard/$(MAINBOARDDIR)/crt0.s
|
2010-03-24 16:51:48 +01:00
|
|
|
@printf " CC $(subst $(obj)/,,$(@))\n"
|
|
|
|
$(CC) -MMD -I$(obj) -Wa,-acdlns -c -o $@ $< > $(dir $@)/crt0.disasm
|
2009-12-23 13:52:56 +01:00
|
|
|
|
2010-04-08 23:04:45 +02:00
|
|
|
$(obj)/mainboard/$(MAINBOARDDIR)/crt0.s: $(obj)/crt0.S
|
2010-03-24 16:51:48 +01:00
|
|
|
@printf " CC $(subst $(obj)/,,$(@))\n"
|
2010-04-15 01:58:07 +02:00
|
|
|
$(CC) -MMD -x assembler-with-cpp -DASSEMBLY -E -I$(src)/include -I$(src)/arch/i386/include -I$(obj) -include $(obj)/config.h -I. -I$(src) $< -o $@
|
2009-12-23 13:52:56 +01:00
|
|
|
|
2010-03-27 18:18:39 +01:00
|
|
|
$(obj)/coreboot: $$(initobjs) $(obj)/ldscript.ld
|
2009-12-23 13:52:56 +01:00
|
|
|
@printf " LINK $(subst $(obj)/,,$(@))\n"
|
|
|
|
$(CC) -nostdlib -nostartfiles -static -o $@ -L$(obj) -T $(obj)/ldscript.ld $(initobjs)
|
|
|
|
$(NM) -n $(obj)/coreboot | sort > $(obj)/coreboot.map
|
2010-09-23 17:38:55 +02:00
|
|
|
$(OBJCOPY) --only-keep-debug $@ $(obj)/bootblock.debug
|
|
|
|
$(OBJCOPY) --strip-debug $@
|
|
|
|
$(OBJCOPY) --add-gnu-debuglink=$(obj)/bootblock.debug $@
|
2009-12-23 13:52:56 +01:00
|
|
|
|