# We need that to combine multiple images (legacy bios,
# efi ia32, efi x64) into a single rom binary.
#
-# We try to find it in the path. You can also pass the location on
-# the command line, i.e. "make EFIROM=/path/to/EfiRom efirom"
-#
-EFIROM ?= $(shell which EfiRom 2>/dev/null)
+EDK2_EFIROM = edk2/BaseTools/Source/C/bin/EfiRom
default:
@echo "nothing is build by default"
@echo " vgabios -- update vgabios binaries (seabios)"
@echo " sgabios -- update sgabios binaries"
@echo " pxerom -- update nic roms (bios only)"
- @echo " efirom -- update nic roms (bios+efi, this needs"
- @echo " the EfiRom utility from edk2 / tianocore)"
+ @echo " efirom -- update nic roms (bios+efi)"
@echo " slof -- update slof.bin"
@echo " skiboot -- update skiboot.lid"
@echo " u-boot.e500 -- update u-boot.e500"
@echo " u-boot.sam460 -- update u-boot.sam460"
+ @echo " efi -- update UEFI (edk2) platform firmware"
+ @echo " clean -- delete the files generated by the previous" \
+ "build targets"
bios: build-seabios-config-seabios-128k build-seabios-config-seabios-256k
cp seabios/builds/seabios-128k/bios.bin ../pc-bios/bios.bin
cp $< seabios/builds/$*/.config
$(MAKE) -C seabios \
EXTRAVERSION=$(SEABIOS_EXTRAVERSION) \
- CROSS_COMPILE=$(x86_64_cross_prefix) \
+ CROSS_PREFIX=$(x86_64_cross_prefix) \
KCONFIG_CONFIG=$(CURDIR)/seabios/builds/$*/.config \
OUT=$(CURDIR)/seabios/builds/$*/ oldnoconfig
$(MAKE) -C seabios \
EXTRAVERSION=$(SEABIOS_EXTRAVERSION) \
- CROSS_COMPILE=$(x86_64_cross_prefix) \
+ CROSS_PREFIX=$(x86_64_cross_prefix) \
KCONFIG_CONFIG=$(CURDIR)/seabios/builds/$*/.config \
OUT=$(CURDIR)/seabios/builds/$*/ all
efirom: $(patsubst %,efi-rom-%,$(pxerom_variants))
-efi-rom-%: build-pxe-roms build-efi-roms
- $(EFIROM) -f "0x$(VID)" -i "0x$(DID)" -l 0x02 \
+efi-rom-%: build-pxe-roms build-efi-roms edk2-basetools
+ $(EDK2_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 \
-ec ipxe/src/bin-x86_64-efi/$(VID)$(DID).efidrv \
$(patsubst %,bin-i386-efi/%.efidrv,$(pxerom_targets)) \
$(patsubst %,bin-x86_64-efi/%.efidrv,$(pxerom_targets))
+# Build scripts can pass compiler/linker flags to the EDK2
+# build tools via the EDK2_BASETOOLS_OPTFLAGS (CFLAGS) and
+# EDK2_BASETOOLS_LDFLAGS (LDFLAGS) environment variables.
+#
+# Example:
+#
+# make -C roms \
+# EDK2_BASETOOLS_OPTFLAGS='...' \
+# EDK2_BASETOOLS_LDFLAGS='...' \
+# efirom
+#
+edk2-basetools:
+ $(MAKE) -C edk2/BaseTools \
+ EXTRA_OPTFLAGS='$(EDK2_BASETOOLS_OPTFLAGS)' \
+ EXTRA_LDFLAGS='$(EDK2_BASETOOLS_LDFLAGS)'
slof:
$(MAKE) -C SLOF CROSS=$(powerpc64_cross_prefix) qemu
$(MAKE) -C skiboot CROSS=$(powerpc64_cross_prefix)
cp skiboot/skiboot.lid ../pc-bios/skiboot.lid
+efi: edk2-basetools
+ $(MAKE) -f Makefile.edk2
+
clean:
rm -rf seabios/.config seabios/out seabios/builds
$(MAKE) -C sgabios clean
rm -f sgabios/.depend
$(MAKE) -C ipxe/src veryclean
+ $(MAKE) -C edk2/BaseTools clean
$(MAKE) -C SLOF clean
rm -rf u-boot/build.e500
$(MAKE) -C u-boot-sam460ex distclean
$(MAKE) -C skiboot clean
+ $(MAKE) -f Makefile.edk2 clean