aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2013-10-14 21:52:28 -0400
committerKevin O'Connor <kevin@koconnor.net>2013-10-16 20:17:00 -0400
commit8744e1512b55f57715e9a44e7629f53e54fd8a96 (patch)
tree251bda70da97730f9808cfb827c8f29940655379 /Makefile
parent7c80bb83d9a154a19df75c48a8b42bfb4904a2e4 (diff)
downloadseabios-hppa-8744e1512b55f57715e9a44e7629f53e54fd8a96.zip
seabios-hppa-8744e1512b55f57715e9a44e7629f53e54fd8a96.tar.gz
seabios-hppa-8744e1512b55f57715e9a44e7629f53e54fd8a96.tar.bz2
Build different final files for QEMU, coreboot, and CSM.
Build out/bios.bin on QEMU, out/bios.bin.elf on coreboot, and out/Csm16.bin for CSM. This reduces the chance that one accidentally builds for an incorrect target. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile21
1 files changed, 18 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 01bd8b3..1812796 100644
--- a/Makefile
+++ b/Makefile
@@ -82,7 +82,10 @@ endif
# Default targets
-include $(KCONFIG_CONFIG)
-target-y = $(OUT)bios.bin
+target-y :=
+target-$(CONFIG_QEMU) += $(OUT)bios.bin
+target-$(CONFIG_CSM) += $(OUT)Csm16.bin
+target-$(CONFIG_COREBOOT) += $(OUT)bios.bin.elf
target-$(CONFIG_BUILD_VGABIOS) += $(OUT)vgabios.bin
all: $(target-y)
@@ -174,12 +177,24 @@ $(OUT)rom.o: $(OUT)rom16.strip.o $(OUT)rom32seg.strip.o $(OUT)code32flat.o $(OUT
@echo " Linking $@"
$(Q)$(LD) -T $(OUT)romlayout32flat.lds $(OUT)rom16.strip.o $(OUT)rom32seg.strip.o $(OUT)code32flat.o -o $@
-$(OUT)bios.bin.elf $(OUT)bios.bin: $(OUT)rom.o scripts/checkrom.py
+$(OUT)bios.bin.prep: $(OUT)rom.o scripts/checkrom.py
@echo " Prepping $@"
+ $(Q)rm -f $(OUT)bios.bin $(OUT)Csm16.bin $(OUT)bios.bin.elf
$(Q)$(OBJDUMP) -thr $< > $<.objdump
$(Q)$(OBJCOPY) -O binary $< $(OUT)bios.bin.raw
$(Q)$(PYTHON) ./scripts/checkrom.py $<.objdump $(CONFIG_ROM_SIZE) \
- $(OUT)bios.bin.raw $(OUT)bios.bin
+ $(OUT)bios.bin.raw $(OUT)bios.bin.prep
+
+$(OUT)bios.bin: $(OUT)bios.bin.prep
+ @echo " Creating $@"
+ $(Q)cp $< $@
+
+$(OUT)Csm16.bin: $(OUT)bios.bin.prep
+ @echo " Creating $@"
+ $(Q)cp $< $@
+
+$(OUT)bios.bin.elf: $(OUT)rom.o $(OUT)bios.bin.prep
+ @echo " Creating $@"
$(Q)$(STRIP) -R .comment $< -o $(OUT)bios.bin.elf