--- qemu/roms/seabios/Makefile 2018/04/24 17:51:38 1.1.1.2 +++ qemu/roms/seabios/Makefile 2018/04/24 18:27:05 1.1.1.3 @@ -5,7 +5,7 @@ # This file may be distributed under the terms of the GNU LGPLv3 license. # Program version -VERSION=0.5.1-$(shell date +"%Y%m%d_%H%M%S")-$(shell hostname) +VERSION=pre-0.6.1-$(shell date +"%Y%m%d_%H%M%S")-$(shell hostname) # Output directory OUT=out/ @@ -13,13 +13,14 @@ OUT=out/ # Source files SRCBOTH=misc.c pmm.c stacks.c output.c util.c block.c floppy.c ata.c mouse.c \ kbd.c pci.c serial.c clock.c pic.c cdrom.c ps2port.c smp.c resume.c \ - pnpbios.c pirtable.c vgahooks.c ramdisk.c pcibios.c \ - usb.c usb-uhci.c usb-ohci.c usb-hid.c paravirt.c + pnpbios.c pirtable.c vgahooks.c ramdisk.c pcibios.c blockcmd.c \ + usb.c usb-uhci.c usb-ohci.c usb-ehci.c usb-hid.c usb-msc.c \ + virtio-ring.c virtio-pci.c virtio-blk.c SRC16=$(SRCBOTH) system.c disk.c apm.c font.c SRC32FLAT=$(SRCBOTH) post.c shadow.c memmap.c coreboot.c boot.c \ acpi.c smm.c mptable.c smbios.c pciinit.c optionroms.c mtrr.c \ - lzmadecode.c -SRC32SEG=util.c output.c pci.c pcibios.c apm.c + lzmadecode.c bootsplash.c jpeg.c usb-hub.c paravirt.c dev-i440fx.c +SRC32SEG=util.c output.c pci.c pcibios.c apm.c stacks.c cc-option = $(shell if test -z "`$(1) $(2) -S -o /dev/null -xc \ /dev/null 2>&1`"; then echo "$(2)"; else echo "$(3)"; fi ;) @@ -42,7 +43,7 @@ CFLAGSSEG = $(COMMONCFLAGS) -DMODESEGMEN $(call cc-option,$(CC),-fno-tree-switch-conversion,) CFLAGS32SEG = $(CFLAGSSEG) -DMODE16=0 -g CFLAGS16INC = $(CFLAGSSEG) -DMODE16=1 \ - $(call cc-option,$(CC),--param large-stack-frame=4,) + $(call cc-option,$(CC),--param large-stack-frame=4,-fno-inline) CFLAGS16 = $(CFLAGS16INC) -g all: $(OUT) $(OUT)bios.bin @@ -100,6 +101,9 @@ endef endif endif +%.strip.o: %.o + @echo " Stripping $@" + $(Q)$(STRIP) $< -o $@ $(OUT)%.s: %.c @echo " Compiling to assembler $@" @@ -135,27 +139,17 @@ $(OUT)romlayout16.lds $(OUT)romlayout32s $(Q)./tools/layoutrom.py $(OUT)code16.o.objdump $(OUT)code32seg.o.objdump $(OUT)code32flat.o.objdump $(OUT)romlayout16.lds $(OUT)romlayout32seg.lds $(OUT)romlayout32flat.lds -$(OUT)rom16.o: $(OUT)code16.o $(OUT)rom32flat.o $(OUT)romlayout16.lds - @echo " Linking (no relocs) $@" - $(Q)$(LD) -r -T $(OUT)romlayout16.lds $< -o $@ +$(OUT)rom16.o: $(OUT)code16.o $(OUT)romlayout16.lds + @echo " Linking $@" + $(Q)$(LD) -T $(OUT)romlayout16.lds $< -o $@ $(OUT)rom32seg.o: $(OUT)code32seg.o $(OUT)romlayout32seg.lds - @echo " Linking (no relocs) $@" - $(Q)$(LD) -r -T $(OUT)romlayout32seg.lds $< -o $@ - -$(OUT)rom32flat.o: $(OUT)code32flat.o $(OUT)romlayout32flat.lds - @echo " Linking (no relocs) $@" - $(Q)$(LD) -r -T $(OUT)romlayout32flat.lds $< -o $@ + @echo " Linking $@" + $(Q)$(LD) -T $(OUT)romlayout32seg.lds $< -o $@ -$(OUT)rom.o: $(OUT)rom16.o $(OUT)rom32seg.o $(OUT)rom32flat.o $(OUT)rombios16.lds $(OUT)rombios32seg.lds $(OUT)rombios.lds +$(OUT)rom.o: $(OUT)rom16.strip.o $(OUT)rom32seg.strip.o $(OUT)code32flat.o $(OUT)romlayout32flat.lds @echo " Linking $@" - $(Q)$(LD) -T $(OUT)rombios16.lds $(OUT)rom16.o -R $(OUT)rom32seg.o -R $(OUT)rom32flat.o -o $(OUT)rom16.reloc.o - $(Q)$(STRIP) $(OUT)rom16.reloc.o -o $(OUT)rom16.final.o - $(Q)$(OBJCOPY) --adjust-vma 0xf0000 $(OUT)rom16.o $(OUT)rom16.moved.o - $(Q)$(LD) -T $(OUT)rombios32seg.lds $(OUT)rom32seg.o -R $(OUT)rom16.o -R $(OUT)rom32flat.o -o $(OUT)rom32seg.reloc.o - $(Q)$(STRIP) $(OUT)rom32seg.reloc.o -o $(OUT)rom32seg.final.o - $(Q)$(OBJCOPY) --adjust-vma 0xf0000 $(OUT)rom32seg.o $(OUT)rom32seg.moved.o - $(Q)$(LD) -T $(OUT)rombios.lds $(OUT)rom16.final.o $(OUT)rom32seg.final.o $(OUT)rom32flat.o -R $(OUT)rom16.moved.o -R $(OUT)rom32seg.moved.o -o $@ + $(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 tools/checkrom.py @echo " Prepping $@" @@ -190,11 +184,13 @@ $(OUT)vgabios.bin: $(OUT)vgabios.bin.raw $(Q)./tools/buildrom.py $< $@ ####### dsdt build rules -src/acpi-dsdt.hex: src/acpi-dsdt.dsl +src/%.hex: src/%.dsl @echo "Compiling DSDT" - $(Q)cpp -P $< > $(OUT)acpi-dsdt.dsl.i - $(Q)iasl -tc -p $@ $(OUT)acpi-dsdt.dsl.i - $(Q)rm $(OUT)acpi-dsdt.dsl.i + $(Q)cpp -P $< > $(OUT)$*.dsl.i + $(Q)iasl -tc -p $(OUT)$* $(OUT)$*.dsl.i + $(Q)cp $(OUT)$*.hex $@ + +$(OUT)ccode32flat.o: src/acpi-dsdt.hex ####### Generic rules clean: