1 # Makefile for building firmware binaries and variable store templates for a
2 # number of virtual platforms in edk2.
4 # Copyright (C) 2019 Red Hat, Inc.
6 # This program and the accompanying materials are licensed and made available
7 # under the terms and conditions of the BSD License that accompanies this
8 # distribution. The full text of the license may be found at
9 # <http://opensource.org/licenses/bsd-license.php>.
11 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
12 # WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
17 toolchain = $(shell source ./edk2-funcs.sh && qemu_edk2_get_toolchain $(1))
21 edk2/License-History.txt \
22 edk2/OvmfPkg/License.txt \
23 edk2/ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3/COPYING.txt \
24 edk2/CryptoPkg/Library/OpensslLib/openssl/LICENSE
26 # The "edk2-arm-vars.fd" varstore template is suitable for aarch64 as well.
27 # Similarly, the "edk2-i386-vars.fd" varstore template is suitable for x86_64
28 # as well, independently of "secure" too.
41 all: $(foreach flashdev,$(flashdevs),../pc-bios/edk2-$(flashdev).fd.bz2) \
42 ../pc-bios/edk2-licenses.txt
44 ../pc-bios/edk2-%.fd.bz2: ../pc-bios/edk2-%.fd
47 # When the build completes, we need not keep the uncompressed flash device
49 .INTERMEDIATE: $(foreach flashdev,$(flashdevs),../pc-bios/edk2-$(flashdev).fd)
51 # Fetch edk2 submodule's submodules. If it is not in a git tree, assume
52 # we're building from a tarball and that they've already been fetched by
53 # make-release/tarball scripts.
55 if test -e edk2/.git; then \
56 cd edk2 && git submodule update --init --force -- \
57 ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3 \
58 BaseTools/Source/C/BrotliCompress/brotli \
59 CryptoPkg/Library/OpensslLib/openssl \
60 MdeModulePkg/Library/BrotliCustomDecompressLib/brotli \
64 # See notes on the ".NOTPARALLEL" target and the "+" indicator in
65 # "tests/uefi-test-tools/Makefile".
68 ../pc-bios/edk2-aarch64-code.fd: submodules
72 --platform=ArmVirtPkg/ArmVirtQemu.dsc \
73 -D NETWORK_IP6_ENABLE \
74 -D NETWORK_HTTP_BOOT_ENABLE \
75 -D NETWORK_TLS_ENABLE \
78 cp edk2/Build/ArmVirtQemu-AARCH64/$(target)_$(call toolchain,aarch64)/FV/QEMU_EFI.fd \
80 truncate --size=64M $@
82 ../pc-bios/edk2-arm-code.fd: submodules
86 --platform=ArmVirtPkg/ArmVirtQemu.dsc \
87 -D NETWORK_IP6_ENABLE \
88 -D NETWORK_HTTP_BOOT_ENABLE \
89 -D NETWORK_TLS_ENABLE \
92 cp edk2/Build/ArmVirtQemu-ARM/$(target)_$(call toolchain,arm)/FV/QEMU_EFI.fd \
94 truncate --size=64M $@
96 ../pc-bios/edk2-i386-code.fd: submodules
100 --platform=OvmfPkg/OvmfPkgIa32.dsc \
101 -D NETWORK_IP6_ENABLE \
102 -D NETWORK_HTTP_BOOT_ENABLE \
103 -D NETWORK_TLS_ENABLE \
106 cp edk2/Build/OvmfIa32/$(target)_$(call toolchain,i386)/FV/OVMF_CODE.fd $@
108 ../pc-bios/edk2-i386-secure-code.fd: submodules
112 --platform=OvmfPkg/OvmfPkgIa32.dsc \
113 -D NETWORK_IP6_ENABLE \
114 -D NETWORK_HTTP_BOOT_ENABLE \
115 -D NETWORK_TLS_ENABLE \
117 -D TPM_CONFIG_ENABLE \
118 -D SECURE_BOOT_ENABLE \
120 cp edk2/Build/OvmfIa32/$(target)_$(call toolchain,i386)/FV/OVMF_CODE.fd $@
122 ../pc-bios/edk2-x86_64-code.fd: submodules
126 --platform=OvmfPkg/OvmfPkgX64.dsc \
127 -D NETWORK_IP6_ENABLE \
128 -D NETWORK_HTTP_BOOT_ENABLE \
129 -D NETWORK_TLS_ENABLE \
132 cp edk2/Build/OvmfX64/$(target)_$(call toolchain,x86_64)/FV/OVMF_CODE.fd $@
134 ../pc-bios/edk2-x86_64-secure-code.fd: submodules
139 --platform=OvmfPkg/OvmfPkgIa32X64.dsc \
140 -D NETWORK_IP6_ENABLE \
141 -D NETWORK_HTTP_BOOT_ENABLE \
142 -D NETWORK_TLS_ENABLE \
144 -D TPM_CONFIG_ENABLE \
145 -D SECURE_BOOT_ENABLE \
147 cp edk2/Build/Ovmf3264/$(target)_$(call toolchain,x86_64)/FV/OVMF_CODE.fd $@
149 ../pc-bios/edk2-x86_64-microvm.fd: submodules
153 --platform=OvmfPkg/Microvm/MicrovmX64.dsc \
154 -D NETWORK_IP6_ENABLE \
155 -D NETWORK_HTTP_BOOT_ENABLE \
156 -D NETWORK_TLS_ENABLE
157 cp edk2/Build/MicrovmX64/$(target)_$(call toolchain,x86_64)/FV/MICROVM.fd $@
159 ../pc-bios/edk2-arm-vars.fd: ../pc-bios/edk2-arm-code.fd
160 cp edk2/Build/ArmVirtQemu-ARM/$(target)_$(call toolchain,arm)/FV/QEMU_VARS.fd \
162 truncate --size=64M $@
164 ../pc-bios/edk2-i386-vars.fd: ../pc-bios/edk2-i386-code.fd
165 cp edk2/Build/OvmfIa32/$(target)_$(call toolchain,i386)/FV/OVMF_VARS.fd $@
167 # The license file accumulates several individual licenses from under edk2,
168 # prefixing each individual license with a header (generated by "tail") that
169 # states its pathname.
170 ../pc-bios/edk2-licenses.txt: submodules
171 tail -n $(shell cat $(licenses) | wc -l) $(licenses) > $@
177 rm -rf .cache BuildEnv.sh build_rule.txt target.txt \