2012-02-09 13:40:31 +04:00
|
|
|
|
2019-11-06 15:13:48 +03:00
|
|
|
vgabios_variants := stdvga cirrus vmware qxl isavga virtio bochs-display ramfb ati
|
2013-09-20 16:35:31 +04:00
|
|
|
vgabios_targets := $(subst -isavga,,$(patsubst %,vgabios-%.bin,$(vgabios_variants)))
|
2016-06-24 14:53:02 +03:00
|
|
|
pxerom_variants := e1000 e1000e eepro100 ne2k_pci pcnet rtl8139 virtio vmxnet3
|
|
|
|
pxerom_targets := 8086100e 808610d3 80861209 10500940 10222000 10ec8139 1af41000 15ad07b0
|
2013-02-08 19:35:08 +04:00
|
|
|
|
2013-02-26 19:45:58 +04:00
|
|
|
pxe-rom-e1000 efi-rom-e1000 : VID := 8086
|
|
|
|
pxe-rom-e1000 efi-rom-e1000 : DID := 100e
|
2016-06-24 14:51:16 +03:00
|
|
|
pxe-rom-e1000e efi-rom-e1000e : VID := 8086
|
|
|
|
pxe-rom-e1000e efi-rom-e1000e : DID := 10d3
|
2013-02-26 19:45:58 +04:00
|
|
|
pxe-rom-eepro100 efi-rom-eepro100 : VID := 8086
|
|
|
|
pxe-rom-eepro100 efi-rom-eepro100 : DID := 1209
|
|
|
|
pxe-rom-ne2k_pci efi-rom-ne2k_pci : VID := 1050
|
|
|
|
pxe-rom-ne2k_pci efi-rom-ne2k_pci : DID := 0940
|
|
|
|
pxe-rom-pcnet efi-rom-pcnet : VID := 1022
|
|
|
|
pxe-rom-pcnet efi-rom-pcnet : DID := 2000
|
|
|
|
pxe-rom-rtl8139 efi-rom-rtl8139 : VID := 10ec
|
|
|
|
pxe-rom-rtl8139 efi-rom-rtl8139 : DID := 8139
|
|
|
|
pxe-rom-virtio efi-rom-virtio : VID := 1af4
|
|
|
|
pxe-rom-virtio efi-rom-virtio : DID := 1000
|
2016-06-24 14:53:02 +03:00
|
|
|
pxe-rom-vmxnet3 efi-rom-vmxnet3 : VID := 15ad
|
|
|
|
pxe-rom-vmxnet3 efi-rom-vmxnet3 : DID := 07b0
|
2013-02-26 19:45:58 +04:00
|
|
|
|
2013-09-20 16:51:10 +04:00
|
|
|
#
|
|
|
|
# cross compiler auto detection
|
|
|
|
#
|
|
|
|
path := $(subst :, ,$(PATH))
|
|
|
|
system := $(shell uname -s | tr "A-Z" "a-z")
|
|
|
|
|
|
|
|
# first find cross binutils in path
|
|
|
|
find-cross-ld = $(firstword $(wildcard $(patsubst %,%/$(1)-*$(system)*-ld,$(path))))
|
|
|
|
# then check we have cross gcc too
|
|
|
|
find-cross-gcc = $(firstword $(wildcard $(patsubst %ld,%gcc,$(call find-cross-ld,$(1)))))
|
|
|
|
# finally strip off path + toolname so we get the prefix
|
|
|
|
find-cross-prefix = $(subst gcc,,$(notdir $(call find-cross-gcc,$(1))))
|
|
|
|
|
2020-09-11 08:20:53 +03:00
|
|
|
arm_cross_prefix := $(call find-cross-prefix,arm)
|
2013-09-20 16:51:10 +04:00
|
|
|
powerpc64_cross_prefix := $(call find-cross-prefix,powerpc64)
|
2014-01-20 03:25:40 +04:00
|
|
|
powerpc_cross_prefix := $(call find-cross-prefix,powerpc)
|
2013-09-23 13:05:48 +04:00
|
|
|
x86_64_cross_prefix := $(call find-cross-prefix,x86_64)
|
2019-07-16 21:47:22 +03:00
|
|
|
riscv32_cross_prefix := $(call find-cross-prefix,riscv32)
|
|
|
|
riscv64_cross_prefix := $(call find-cross-prefix,riscv64)
|
2013-09-20 16:51:10 +04:00
|
|
|
|
2015-06-17 10:24:55 +03:00
|
|
|
# tag our seabios builds
|
2018-11-20 08:57:48 +03:00
|
|
|
SEABIOS_EXTRAVERSION="-prebuilt.qemu.org"
|
2015-06-17 10:24:55 +03:00
|
|
|
|
2013-02-26 19:45:58 +04:00
|
|
|
#
|
|
|
|
# EfiRom utility is shipped with edk2 / tianocore, in BaseTools/
|
|
|
|
#
|
|
|
|
# We need that to combine multiple images (legacy bios,
|
|
|
|
# efi ia32, efi x64) into a single rom binary.
|
|
|
|
#
|
2019-04-09 16:45:35 +03:00
|
|
|
EDK2_EFIROM = edk2/BaseTools/Source/C/bin/EfiRom
|
2012-02-09 13:40:31 +04:00
|
|
|
|
2019-09-20 20:11:59 +03:00
|
|
|
default help:
|
2012-02-09 13:40:31 +04:00
|
|
|
@echo "nothing is build by default"
|
|
|
|
@echo "available build targets:"
|
2019-07-16 21:47:22 +03:00
|
|
|
@echo " bios -- update bios.bin (seabios)"
|
|
|
|
@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)"
|
|
|
|
@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"
|
2020-09-11 08:20:53 +03:00
|
|
|
@echo " npcm7xx_bootrom -- update vbootrom for npcm7xx"
|
2019-07-16 21:47:22 +03:00
|
|
|
@echo " efi -- update UEFI (edk2) platform firmware"
|
2020-06-22 05:03:17 +03:00
|
|
|
@echo " opensbi32-generic -- update OpenSBI for 32-bit generic machine"
|
|
|
|
@echo " opensbi64-generic -- update OpenSBI for 64-bit generic machine"
|
2020-09-15 15:08:49 +03:00
|
|
|
@echo " qboot -- update qboot"
|
2019-07-16 21:47:22 +03:00
|
|
|
@echo " clean -- delete the files generated by the previous" \
|
|
|
|
"build targets"
|
2012-02-09 13:40:31 +04:00
|
|
|
|
2020-09-15 15:08:50 +03:00
|
|
|
bios: build-seabios-config-seabios-128k \
|
|
|
|
build-seabios-config-seabios-256k \
|
|
|
|
build-seabios-config-seabios-microvm
|
2013-09-30 13:37:12 +04:00
|
|
|
cp seabios/builds/seabios-128k/bios.bin ../pc-bios/bios.bin
|
|
|
|
cp seabios/builds/seabios-256k/bios.bin ../pc-bios/bios-256k.bin
|
2020-09-15 15:08:50 +03:00
|
|
|
cp seabios/builds/seabios-microvm/bios.bin ../pc-bios/bios-microvm.bin
|
2012-02-09 13:40:31 +04:00
|
|
|
|
2018-06-20 13:11:42 +03:00
|
|
|
vgabios seavgabios: $(patsubst %,seavgabios-%,$(vgabios_variants))
|
2012-02-09 13:40:31 +04:00
|
|
|
|
2013-09-24 17:38:28 +04:00
|
|
|
seavgabios-isavga: build-seabios-config-vga-isavga
|
|
|
|
cp seabios/builds/vga-isavga/vgabios.bin ../pc-bios/vgabios.bin
|
|
|
|
|
|
|
|
seavgabios-%: build-seabios-config-vga-%
|
|
|
|
cp seabios/builds/vga-$*/vgabios.bin ../pc-bios/vgabios-$*.bin
|
|
|
|
|
|
|
|
build-seabios-config-%: config.%
|
|
|
|
mkdir -p seabios/builds/$*
|
|
|
|
cp $< seabios/builds/$*/.config
|
2013-12-13 21:13:50 +04:00
|
|
|
$(MAKE) -C seabios \
|
2015-12-17 12:32:24 +03:00
|
|
|
EXTRAVERSION=$(SEABIOS_EXTRAVERSION) \
|
2018-11-21 23:37:21 +03:00
|
|
|
CROSS_PREFIX=$(x86_64_cross_prefix) \
|
2013-09-24 17:38:28 +04:00
|
|
|
KCONFIG_CONFIG=$(CURDIR)/seabios/builds/$*/.config \
|
|
|
|
OUT=$(CURDIR)/seabios/builds/$*/ oldnoconfig
|
2013-12-13 21:13:50 +04:00
|
|
|
$(MAKE) -C seabios \
|
2015-12-17 12:32:24 +03:00
|
|
|
EXTRAVERSION=$(SEABIOS_EXTRAVERSION) \
|
2018-11-21 23:37:21 +03:00
|
|
|
CROSS_PREFIX=$(x86_64_cross_prefix) \
|
2013-09-24 17:38:28 +04:00
|
|
|
KCONFIG_CONFIG=$(CURDIR)/seabios/builds/$*/.config \
|
|
|
|
OUT=$(CURDIR)/seabios/builds/$*/ all
|
2012-02-09 13:40:31 +04:00
|
|
|
|
2013-09-20 16:29:29 +04:00
|
|
|
|
2020-10-20 18:25:12 +03:00
|
|
|
.PHONY: sgabios skiboot qboot
|
2013-09-24 17:46:52 +04:00
|
|
|
sgabios:
|
2013-12-13 21:13:50 +04:00
|
|
|
$(MAKE) -C sgabios
|
2013-09-24 17:46:52 +04:00
|
|
|
cp sgabios/sgabios.bin ../pc-bios
|
|
|
|
|
|
|
|
|
2013-02-08 19:35:08 +04:00
|
|
|
pxerom: $(patsubst %,pxe-rom-%,$(pxerom_variants))
|
|
|
|
|
2013-09-20 17:26:26 +04:00
|
|
|
pxe-rom-%: build-pxe-roms
|
2013-02-08 19:35:08 +04:00
|
|
|
cp ipxe/src/bin/$(VID)$(DID).rom ../pc-bios/pxe-$*.rom
|
2013-02-26 19:45:58 +04:00
|
|
|
|
|
|
|
efirom: $(patsubst %,efi-rom-%,$(pxerom_variants))
|
|
|
|
|
2019-03-07 15:24:41 +03:00
|
|
|
efi-rom-%: build-pxe-roms build-efi-roms edk2-basetools
|
2019-04-09 16:45:35 +03:00
|
|
|
$(EDK2_EFIROM) -f "0x$(VID)" -i "0x$(DID)" -l 0x02 \
|
2013-02-26 19:45:58 +04:00
|
|
|
-b ipxe/src/bin/$(VID)$(DID).rom \
|
|
|
|
-ec ipxe/src/bin-x86_64-efi/$(VID)$(DID).efidrv \
|
|
|
|
-o ../pc-bios/efi-$*.rom
|
2013-03-25 12:07:40 +04:00
|
|
|
|
2015-09-03 15:40:29 +03:00
|
|
|
build-pxe-roms:
|
|
|
|
$(MAKE) -C ipxe/src CONFIG=qemu \
|
2013-09-23 13:05:48 +04:00
|
|
|
CROSS_COMPILE=$(x86_64_cross_prefix) \
|
2013-09-20 17:26:26 +04:00
|
|
|
$(patsubst %,bin/%.rom,$(pxerom_targets))
|
|
|
|
|
2015-09-03 15:40:29 +03:00
|
|
|
build-efi-roms: build-pxe-roms
|
|
|
|
$(MAKE) -C ipxe/src CONFIG=qemu \
|
2013-09-23 13:05:48 +04:00
|
|
|
CROSS_COMPILE=$(x86_64_cross_prefix) \
|
2013-09-20 17:26:26 +04:00
|
|
|
$(patsubst %,bin-x86_64-efi/%.efidrv,$(pxerom_targets))
|
|
|
|
|
2019-05-06 17:19:22 +03:00
|
|
|
# Build scripts can pass compiler/linker flags to the EDK2
|
|
|
|
# build tools via the EDK2_BASETOOLS_OPTFLAGS (CFLAGS) and
|
2019-04-09 16:45:36 +03:00
|
|
|
# EDK2_BASETOOLS_LDFLAGS (LDFLAGS) environment variables.
|
|
|
|
#
|
|
|
|
# Example:
|
|
|
|
#
|
|
|
|
# make -C roms \
|
|
|
|
# EDK2_BASETOOLS_OPTFLAGS='...' \
|
|
|
|
# EDK2_BASETOOLS_LDFLAGS='...' \
|
|
|
|
# efirom
|
|
|
|
#
|
2019-03-07 15:24:41 +03:00
|
|
|
edk2-basetools:
|
2020-09-07 23:13:02 +03:00
|
|
|
cd edk2/BaseTools && git submodule update --init --force
|
2019-04-09 16:45:36 +03:00
|
|
|
$(MAKE) -C edk2/BaseTools \
|
edk2 build scripts: work around TianoCore#1607 without forcing Python 2
It turns out that forcing python2 for running the edk2 "build" utility is
neither necessary nor sufficient.
Forcing python2 is not sufficient for two reasons:
- QEMU is moving away from python2, with python2 nearing EOL,
- according to my most recent testing, the lacking dependency information
in the makefiles that are generated by edk2's "build" utility can cause
parallel build failures even when "build" is executed by python2.
And forcing python2 is not necessary because we can still return to the
original idea of filtering out jobserver-related options from MAKEFLAGS.
So do that.
While at it, cut short edk2's auto-detection of the python3.* minor
version, by setting PYTHON_COMMAND to "python3" (which we expect to be
available wherever we intend to build edk2).
With this patch, the guest UEFI binaries that are used as part of the BIOS
tables test, and the OVMF and ArmVirtQemu platform firmwares, will be
built strictly in a single job, regardless of an outermost "-jN" make
option. Alas, there appears to be no reliable way to build edk2 in an
(outer make, inner make) environment, with a jobserver enabled.
Cc: Eduardo Habkost <ehabkost@redhat.com>
Cc: John Snow <jsnow@redhat.com>
Cc: Philippe Mathieu-Daudé <philmd@redhat.com>
Reported-by: John Snow <jsnow@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Reviewed-by: John Snow <jsnow@redhat.com>
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Message-Id: <20190920083808.21399-3-lersek@redhat.com>
Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
2019-09-20 11:38:08 +03:00
|
|
|
PYTHON_COMMAND=$${EDK2_PYTHON_COMMAND:-python3} \
|
2019-04-09 16:45:36 +03:00
|
|
|
EXTRA_OPTFLAGS='$(EDK2_BASETOOLS_OPTFLAGS)' \
|
|
|
|
EXTRA_LDFLAGS='$(EDK2_BASETOOLS_LDFLAGS)'
|
2013-09-20 17:34:27 +04:00
|
|
|
|
2013-09-20 16:51:10 +04:00
|
|
|
slof:
|
2013-12-13 21:13:50 +04:00
|
|
|
$(MAKE) -C SLOF CROSS=$(powerpc64_cross_prefix) qemu
|
2013-09-20 16:51:10 +04:00
|
|
|
cp SLOF/boot_rom.bin ../pc-bios/slof.bin
|
|
|
|
|
2014-01-20 03:25:40 +04:00
|
|
|
u-boot.e500:
|
|
|
|
$(MAKE) -C u-boot O=build.e500 qemu-ppce500_config
|
|
|
|
$(MAKE) -C u-boot CROSS_COMPILE=$(powerpc_cross_prefix) \
|
|
|
|
O=build.e500
|
|
|
|
$(powerpc_cross_prefix)strip u-boot/build.e500/u-boot -o \
|
|
|
|
../pc-bios/u-boot.e500
|
2013-09-20 16:51:10 +04:00
|
|
|
|
2018-03-02 14:50:14 +03:00
|
|
|
u-boot.sam460:
|
|
|
|
$(MAKE) -C u-boot-sam460ex Sam460ex_config
|
|
|
|
$(MAKE) -C u-boot-sam460ex CROSS_COMPILE=$(powerpc_cross_prefix)
|
|
|
|
cp u-boot-sam460ex/u-boot.bin ../pc-bios/u-boot-sam460-20100605.bin
|
|
|
|
|
2016-10-22 12:46:34 +03:00
|
|
|
skiboot:
|
|
|
|
$(MAKE) -C skiboot CROSS=$(powerpc64_cross_prefix)
|
|
|
|
cp skiboot/skiboot.lid ../pc-bios/skiboot.lid
|
|
|
|
|
2019-03-07 16:57:17 +03:00
|
|
|
efi: edk2-basetools
|
|
|
|
$(MAKE) -f Makefile.edk2
|
|
|
|
|
2020-06-22 05:03:17 +03:00
|
|
|
opensbi32-generic:
|
2019-07-16 21:47:22 +03:00
|
|
|
$(MAKE) -C opensbi \
|
|
|
|
CROSS_COMPILE=$(riscv32_cross_prefix) \
|
2020-06-22 05:03:17 +03:00
|
|
|
PLATFORM="generic"
|
|
|
|
cp opensbi/build/platform/generic/firmware/fw_dynamic.bin ../pc-bios/opensbi-riscv32-generic-fw_dynamic.bin
|
|
|
|
cp opensbi/build/platform/generic/firmware/fw_dynamic.elf ../pc-bios/opensbi-riscv32-generic-fw_dynamic.elf
|
2019-07-16 21:47:22 +03:00
|
|
|
|
2020-06-22 05:03:17 +03:00
|
|
|
opensbi64-generic:
|
2019-07-16 21:47:22 +03:00
|
|
|
$(MAKE) -C opensbi \
|
|
|
|
CROSS_COMPILE=$(riscv64_cross_prefix) \
|
2020-06-22 05:03:17 +03:00
|
|
|
PLATFORM="generic"
|
|
|
|
cp opensbi/build/platform/generic/firmware/fw_dynamic.bin ../pc-bios/opensbi-riscv64-generic-fw_dynamic.bin
|
|
|
|
cp opensbi/build/platform/generic/firmware/fw_dynamic.elf ../pc-bios/opensbi-riscv64-generic-fw_dynamic.elf
|
2019-07-16 21:47:22 +03:00
|
|
|
|
2020-11-20 18:24:08 +03:00
|
|
|
MESON = meson
|
|
|
|
NINJA = ninja
|
2020-09-15 15:08:49 +03:00
|
|
|
qboot:
|
2020-11-20 18:24:08 +03:00
|
|
|
mkdir -p qboot/build
|
|
|
|
$(MESON) setup $(if $(wildcard qboot/build/meson-private),--wipe,) qboot qboot/build
|
|
|
|
$(NINJA) -C qboot/build
|
|
|
|
cp qboot/build/bios.bin ../pc-bios/qboot.rom
|
2019-09-30 18:36:58 +03:00
|
|
|
|
2020-09-11 08:20:53 +03:00
|
|
|
npcm7xx_bootrom:
|
|
|
|
$(MAKE) -C vbootrom CROSS_COMPILE=$(arm_cross_prefix)
|
|
|
|
cp vbootrom/npcm7xx_bootrom.bin ../pc-bios/npcm7xx_bootrom.bin
|
|
|
|
|
2013-09-20 17:34:27 +04:00
|
|
|
clean:
|
2013-09-24 17:38:28 +04:00
|
|
|
rm -rf seabios/.config seabios/out seabios/builds
|
2013-12-13 21:13:50 +04:00
|
|
|
$(MAKE) -C sgabios clean
|
2013-09-24 17:46:52 +04:00
|
|
|
rm -f sgabios/.depend
|
2013-12-13 21:13:50 +04:00
|
|
|
$(MAKE) -C ipxe/src veryclean
|
2019-02-04 19:03:22 +03:00
|
|
|
$(MAKE) -C edk2/BaseTools clean
|
2013-12-13 21:13:50 +04:00
|
|
|
$(MAKE) -C SLOF clean
|
2014-01-20 03:25:40 +04:00
|
|
|
rm -rf u-boot/build.e500
|
2018-03-02 14:50:14 +03:00
|
|
|
$(MAKE) -C u-boot-sam460ex distclean
|
2016-10-22 12:46:34 +03:00
|
|
|
$(MAKE) -C skiboot clean
|
2019-03-07 16:57:17 +03:00
|
|
|
$(MAKE) -f Makefile.edk2 clean
|
2019-07-16 21:47:22 +03:00
|
|
|
$(MAKE) -C opensbi clean
|
2019-09-30 18:36:58 +03:00
|
|
|
$(MAKE) -C qboot clean
|
2020-09-11 08:20:53 +03:00
|
|
|
$(MAKE) -C vbootrom clean
|