2012-02-09 10:40:31 +01:00
|
|
|
|
2014-09-10 13:04:17 +02:00
|
|
|
vgabios_variants := stdvga cirrus vmware qxl isavga virtio
|
2013-09-20 14:35:31 +02:00
|
|
|
vgabios_targets := $(subst -isavga,,$(patsubst %,vgabios-%.bin,$(vgabios_variants)))
|
2016-06-24 13:53:02 +02: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 16:35:08 +01:00
|
|
|
|
2013-02-26 16:45:58 +01:00
|
|
|
pxe-rom-e1000 efi-rom-e1000 : VID := 8086
|
|
|
|
pxe-rom-e1000 efi-rom-e1000 : DID := 100e
|
2016-06-24 13:51:16 +02:00
|
|
|
pxe-rom-e1000e efi-rom-e1000e : VID := 8086
|
|
|
|
pxe-rom-e1000e efi-rom-e1000e : DID := 10d3
|
2013-02-26 16:45:58 +01: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 13:53:02 +02:00
|
|
|
pxe-rom-vmxnet3 efi-rom-vmxnet3 : VID := 15ad
|
|
|
|
pxe-rom-vmxnet3 efi-rom-vmxnet3 : DID := 07b0
|
2013-02-26 16:45:58 +01:00
|
|
|
|
2013-09-20 14:51:10 +02: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))))
|
|
|
|
|
|
|
|
powerpc64_cross_prefix := $(call find-cross-prefix,powerpc64)
|
2014-01-20 00:25:40 +01:00
|
|
|
powerpc_cross_prefix := $(call find-cross-prefix,powerpc)
|
2013-09-23 11:05:48 +02:00
|
|
|
x86_64_cross_prefix := $(call find-cross-prefix,x86_64)
|
2013-09-20 14:51:10 +02:00
|
|
|
|
2015-06-17 09:24:55 +02:00
|
|
|
# tag our seabios builds
|
2015-12-17 10:32:24 +01:00
|
|
|
SEABIOS_EXTRAVERSION="-prebuilt.qemu-project.org"
|
2015-06-17 09:24:55 +02:00
|
|
|
|
2013-02-26 16:45:58 +01: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.
|
|
|
|
#
|
|
|
|
# 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)
|
2012-02-09 10:40:31 +01:00
|
|
|
|
2012-02-09 10:40:31 +01:00
|
|
|
default:
|
|
|
|
@echo "nothing is build by default"
|
|
|
|
@echo "available build targets:"
|
|
|
|
@echo " bios -- update bios.bin (seabios)"
|
2012-02-09 10:40:31 +01:00
|
|
|
@echo " seavgabios -- update vgabios binaries (seabios)"
|
|
|
|
@echo " lgplvgabios -- update vgabios binaries (lgpl)"
|
2013-09-24 15:46:52 +02:00
|
|
|
@echo " sgabios -- update sgabios binaries"
|
2013-02-08 16:35:08 +01:00
|
|
|
@echo " pxerom -- update nic roms (bios only)"
|
2013-02-26 16:45:58 +01:00
|
|
|
@echo " efirom -- update nic roms (bios+efi, this needs"
|
|
|
|
@echo " the EfiRom utility from edk2 / tianocore)"
|
2013-09-20 14:51:10 +02:00
|
|
|
@echo " slof -- update slof.bin"
|
2016-10-22 11:46:34 +02:00
|
|
|
@echo " skiboot -- update skiboot.lid"
|
2014-01-20 00:25:40 +01:00
|
|
|
@echo " u-boot.e500 -- update u-boot.e500"
|
2012-02-09 10:40:31 +01:00
|
|
|
|
2013-09-30 11:37:12 +02:00
|
|
|
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/seabios-256k/bios.bin ../pc-bios/bios-256k.bin
|
2012-02-09 10:40:31 +01:00
|
|
|
|
|
|
|
seavgabios: $(patsubst %,seavgabios-%,$(vgabios_variants))
|
|
|
|
|
2013-09-24 15:38:28 +02: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 18:13:50 +01:00
|
|
|
$(MAKE) -C seabios \
|
2015-12-17 10:32:24 +01:00
|
|
|
EXTRAVERSION=$(SEABIOS_EXTRAVERSION) \
|
2013-10-15 17:05:55 +02:00
|
|
|
CROSS_COMPILE=$(x86_64_cross_prefix) \
|
2013-09-24 15:38:28 +02:00
|
|
|
KCONFIG_CONFIG=$(CURDIR)/seabios/builds/$*/.config \
|
|
|
|
OUT=$(CURDIR)/seabios/builds/$*/ oldnoconfig
|
2013-12-13 18:13:50 +01:00
|
|
|
$(MAKE) -C seabios \
|
2015-12-17 10:32:24 +01:00
|
|
|
EXTRAVERSION=$(SEABIOS_EXTRAVERSION) \
|
2013-10-15 17:05:55 +02:00
|
|
|
CROSS_COMPILE=$(x86_64_cross_prefix) \
|
2013-09-24 15:38:28 +02:00
|
|
|
KCONFIG_CONFIG=$(CURDIR)/seabios/builds/$*/.config \
|
|
|
|
OUT=$(CURDIR)/seabios/builds/$*/ all
|
2012-02-09 10:40:31 +01:00
|
|
|
|
2013-09-20 14:29:29 +02:00
|
|
|
|
2012-02-09 10:40:31 +01:00
|
|
|
lgplvgabios: $(patsubst %,lgplvgabios-%,$(vgabios_variants))
|
|
|
|
|
2013-09-20 14:35:31 +02:00
|
|
|
lgplvgabios-isavga: build-lgplvgabios
|
|
|
|
cp vgabios/VGABIOS-lgpl-latest.bin ../pc-bios/vgabios.bin
|
2013-09-20 14:29:29 +02:00
|
|
|
lgplvgabios-%: build-lgplvgabios
|
2012-02-09 10:40:31 +01:00
|
|
|
cp vgabios/VGABIOS-lgpl-latest.$*.bin ../pc-bios/vgabios-$*.bin
|
2013-02-08 16:35:08 +01:00
|
|
|
|
2013-09-20 14:29:29 +02:00
|
|
|
build-lgplvgabios:
|
2013-12-13 18:13:50 +01:00
|
|
|
$(MAKE) -C vgabios $(vgabios_targets)
|
2013-09-20 14:29:29 +02:00
|
|
|
|
|
|
|
|
2016-10-22 11:46:34 +02:00
|
|
|
.PHONY: sgabios skiboot
|
2013-09-24 15:46:52 +02:00
|
|
|
sgabios:
|
2013-12-13 18:13:50 +01:00
|
|
|
$(MAKE) -C sgabios
|
2013-09-24 15:46:52 +02:00
|
|
|
cp sgabios/sgabios.bin ../pc-bios
|
|
|
|
|
|
|
|
|
2013-02-08 16:35:08 +01:00
|
|
|
pxerom: $(patsubst %,pxe-rom-%,$(pxerom_variants))
|
|
|
|
|
2013-09-20 15:26:26 +02:00
|
|
|
pxe-rom-%: build-pxe-roms
|
2013-02-08 16:35:08 +01:00
|
|
|
cp ipxe/src/bin/$(VID)$(DID).rom ../pc-bios/pxe-$*.rom
|
2013-02-26 16:45:58 +01:00
|
|
|
|
|
|
|
efirom: $(patsubst %,efi-rom-%,$(pxerom_variants))
|
|
|
|
|
2013-09-20 15:26:26 +02:00
|
|
|
efi-rom-%: build-pxe-roms build-efi-roms
|
2013-02-26 16:45:58 +01:00
|
|
|
$(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 \
|
|
|
|
-o ../pc-bios/efi-$*.rom
|
2013-03-25 09:07:40 +01:00
|
|
|
|
2015-09-03 14:40:29 +02:00
|
|
|
build-pxe-roms:
|
|
|
|
$(MAKE) -C ipxe/src CONFIG=qemu \
|
2013-09-23 11:05:48 +02:00
|
|
|
CROSS_COMPILE=$(x86_64_cross_prefix) \
|
2013-09-20 15:26:26 +02:00
|
|
|
$(patsubst %,bin/%.rom,$(pxerom_targets))
|
|
|
|
|
2015-09-03 14:40:29 +02:00
|
|
|
build-efi-roms: build-pxe-roms
|
|
|
|
$(MAKE) -C ipxe/src CONFIG=qemu \
|
2013-09-23 11:05:48 +02:00
|
|
|
CROSS_COMPILE=$(x86_64_cross_prefix) \
|
2013-09-20 15:26:26 +02:00
|
|
|
$(patsubst %,bin-i386-efi/%.efidrv,$(pxerom_targets)) \
|
|
|
|
$(patsubst %,bin-x86_64-efi/%.efidrv,$(pxerom_targets))
|
|
|
|
|
2013-09-20 15:34:27 +02:00
|
|
|
|
2013-09-20 14:51:10 +02:00
|
|
|
slof:
|
2013-12-13 18:13:50 +01:00
|
|
|
$(MAKE) -C SLOF CROSS=$(powerpc64_cross_prefix) qemu
|
2013-09-20 14:51:10 +02:00
|
|
|
cp SLOF/boot_rom.bin ../pc-bios/slof.bin
|
|
|
|
|
2014-01-20 00:25:40 +01: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 14:51:10 +02:00
|
|
|
|
2016-10-22 11:46:34 +02:00
|
|
|
skiboot:
|
|
|
|
$(MAKE) -C skiboot CROSS=$(powerpc64_cross_prefix)
|
|
|
|
cp skiboot/skiboot.lid ../pc-bios/skiboot.lid
|
|
|
|
|
2013-09-20 15:34:27 +02:00
|
|
|
clean:
|
2013-09-24 15:38:28 +02:00
|
|
|
rm -rf seabios/.config seabios/out seabios/builds
|
2013-12-13 18:13:50 +01:00
|
|
|
$(MAKE) -C vgabios clean
|
2013-09-20 15:34:27 +02:00
|
|
|
rm -f vgabios/VGABIOS-lgpl-latest*
|
2013-12-13 18:13:50 +01:00
|
|
|
$(MAKE) -C sgabios clean
|
2013-09-24 15:46:52 +02:00
|
|
|
rm -f sgabios/.depend
|
2013-12-13 18:13:50 +01:00
|
|
|
$(MAKE) -C ipxe/src veryclean
|
|
|
|
$(MAKE) -C SLOF clean
|
2014-01-20 00:25:40 +01:00
|
|
|
rm -rf u-boot/build.e500
|
2016-10-22 11:46:34 +02:00
|
|
|
$(MAKE) -C skiboot clean
|