Skip to contentSkip to conversation

roms: various improvements to roms/Makefile

PATCH In review Bruce Rogers 2 participants 6 messages Sep 19, 2013 – Sep 20, 2013

lore
Share & tools
lore
#0 lore raw

cover roms: various improvements to roms/Makefile

While attempting to use roms/Makefile to build the x86 firmware from source I encountered some issues that needed to be worked around. These patches improve the makefile to handle more of the x86 firmware binaries and to better handle recursive make usage.

Bruce Rogers (3):
roms: use formal MAKE variable reference in roms Makefile
roms: make and install isa vgabios binary
roms: make and install sgabios binary

 roms/Makefile |   37 +++++++++++++++++++++++++++----------
 1 files changed, 27 insertions(+), 10 deletions(-)
Signature · 1 line
1.7.7
#1 lore raw

PATCH 1/3 roms: use formal MAKE variable reference in roms Makefile

In order to properly support recursive make commands, convert references of make to be $(MAKE). This will for example enable parallel makes of each of the rom source trees covered by this makefile.

---
 roms/Makefile |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)
roms/Makefile +7 -7
index 7a228ae..6de9424 100644
@@ -38,7 +38,7 @@ default:
 
 bios: config.seabios
 	sh configure-seabios.sh $<
-	make -C seabios out/bios.bin
+	$(MAKE) -C seabios out/bios.bin
 	cp seabios/out/bios.bin ../pc-bios/bios.bin
 	cp seabios/out/*dsdt.aml ../pc-bios/
 
@@ -46,27 +46,27 @@ seavgabios: $(patsubst %,seavgabios-%,$(vgabios_variants))
 
 seavgabios-%: config.vga.%
 	sh configure-seabios.sh $<
-	make -C seabios out/vgabios.bin
+	$(MAKE) -C seabios out/vgabios.bin
 	cp seabios/out/vgabios.bin ../pc-bios/vgabios-$*.bin
 
 lgplvgabios: $(patsubst %,lgplvgabios-%,$(vgabios_variants))
 
 lgplvgabios-%:
-	make -C vgabios vgabios-$*.bin
+	$(MAKE) -C vgabios vgabios-$*.bin
 	cp vgabios/VGABIOS-lgpl-latest.$*.bin ../pc-bios/vgabios-$*.bin
 
 pxerom: $(patsubst %,pxe-rom-%,$(pxerom_variants))
 
 pxe-rom-%: ipxe/src/config/local/general.h
-	make -C ipxe/src bin/$(VID)$(DID).rom
+	$(MAKE) -C ipxe/src bin/$(VID)$(DID).rom
 	cp ipxe/src/bin/$(VID)$(DID).rom ../pc-bios/pxe-$*.rom
 
 efirom: $(patsubst %,efi-rom-%,$(pxerom_variants))
 
 efi-rom-%: ipxe/src/config/local/general.h
-	make -C ipxe/src bin/$(VID)$(DID).rom
-	make -C ipxe/src bin-i386-efi/$(VID)$(DID).efidrv
-	make -C ipxe/src bin-x86_64-efi/$(VID)$(DID).efidrv
+	$(MAKE) -C ipxe/src bin/$(VID)$(DID).rom
+	$(MAKE) -C ipxe/src bin-i386-efi/$(VID)$(DID).efidrv
+	$(MAKE) -C ipxe/src bin-x86_64-efi/$(VID)$(DID).efidrv
 	$(EFIROM) -f "0x$(VID)" -i "0x$(DID)" -l 0x02 \
 		-b ipxe/src/bin/$(VID)$(DID).rom \
 		-ec ipxe/src/bin-i386-efi/$(VID)$(DID).efidrv \
Signature · 1 line
1.7.7
#2 lore raw

Re: [Qemu-devel] [PATCH 1/3] roms: use formal MAKE variable reference in roms Makefile

Quoted 6 lines
Quoted 1 line
Quoted 1 line · Bruce Rogers

In order to properly support recursive make commands, convert references of make to be $(MAKE). This will for example enable parallel makes of each of the rom source trees covered by this makefile.

I perhaps should clarify the above statement: This patch does not fix parallel make issues present in this makefile, but rather just permits parallel flags to be passed along for the make references of each target, and to ensure consistent make references are being done.

Bruce

#3 lore raw

Re: [Qemu-devel] [PATCH 1/3] roms: use formal MAKE variable reference in roms Makefile

Quoted 7 lines · Bruce Rogers
Quoted 6 lines
Quoted 1 line
Quoted 1 line · Bruce Rogers

In order to properly support recursive make commands, convert references of make to be $(MAKE). This will for example enable parallel makes of each of the rom source trees covered by this makefile.

Quoted 5 lines

I perhaps should clarify the above statement: This patch does not fix parallel make issues present in this makefile, but rather just permits parallel flags to be passed along for the make references of each target, and to ensure consistent make references are being done.

Which is a rather pointless exercise IMO. When tackling parallel builds fix it for real please.

cheers,
Gerd

#4 lore raw

PATCH 2/3 roms: make and install isa vgabios binary

In reply to Bruce Rogers

Add the isa vgabios binary to the list of vgabios binaries we make and install to pc-bios. Do this for both to the seabios as well as the lgpl based vgabios source trees.

---
 roms/Makefile |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)
roms/Makefile +13 -4
index 6de9424..16fb8ac 100644
@@ -1,5 +1,5 @@
 
-vgabios_variants := stdvga cirrus vmware qxl
+vgabios_variants := stdvga cirrus vmware qxl isavga
 pxerom_variants  := e1000 eepro100 ne2k_pci pcnet rtl8139 virtio
 
 pxe-rom-e1000    efi-rom-e1000    : VID := 8086
@@ -47,13 +47,22 @@ seavgabios: $(patsubst %,seavgabios-%,$(vgabios_variants))
 seavgabios-%: config.vga.%
 	sh configure-seabios.sh $<
 	$(MAKE) -C seabios out/vgabios.bin
-	cp seabios/out/vgabios.bin ../pc-bios/vgabios-$*.bin
+	@if [ "$*" = "isavga" ]; then \
+	  cp seabios/out/vgabios.bin ../pc-bios/vgabios.bin; \
+	  else \
+	  cp seabios/out/vgabios.bin ../pc-bios/vgabios-$*.bin; \
+	fi
 
 lgplvgabios: $(patsubst %,lgplvgabios-%,$(vgabios_variants))
 
 lgplvgabios-%:
-	$(MAKE) -C vgabios vgabios-$*.bin
-	cp vgabios/VGABIOS-lgpl-latest.$*.bin ../pc-bios/vgabios-$*.bin
+	@if [ "$*" = "isavga" ]; then \
+	  $(MAKE) -C vgabios vgabios.bin; \
+	  cp vgabios/VGABIOS-lgpl-latest.bin ../pc-bios/vgabios.bin; \
+	  else \
+	  $(MAKE) -C vgabios vgabios-$*.bin; \
+	  cp vgabios/VGABIOS-lgpl-latest.$*.bin ../pc-bios/vgabios-$*.bin; \
+	fi
 
 pxerom: $(patsubst %,pxe-rom-%,$(pxerom_variants))
 
Signature · 1 line
1.7.7
#5 lore raw

PATCH 3/3 roms: make and install sgabios binary

In reply to Bruce Rogers

Add a make target for sgabios. Since the sgabios makefile is not parallel friendly, do the make in two steps, each of which allows for a parallel make.

---
 roms/Makefile |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
roms/Makefile +8 -0
index 16fb8ac..a0689ee 100644
@@ -35,6 +35,7 @@ default:
 	@echo "  pxerom         -- update nic roms (bios only)"
 	@echo "  efirom         -- update nic roms (bios+efi, this needs"
 	@echo "                    the EfiRom utility from edk2 / tianocore)"
+	@echo "  sgabios        -- update sgabios binary"
 
 bios: config.seabios
 	sh configure-seabios.sh $<
@@ -84,3 +85,10 @@ efi-rom-%: ipxe/src/config/local/general.h
 
 ipxe/src/config/local/%: config.ipxe.%
 	cp $< $@
+
+.PHONY: sgabios
+sgabios:
+# Sgabios's makefile isn't parallel make friendly. Make interim target first.
+	$(MAKE) -C sgabios .depend
+	$(MAKE) -C sgabios
+	cp sgabios/sgabios.bin ../pc-bios/sgabios.bin
Signature · 1 line
1.7.7