Update VERSION for v7.2.0-rc4
[qemu.git] / roms / Makefile.edk2
1 # Makefile for building firmware binaries and variable store templates for a
2 # number of virtual platforms in edk2.
3 #
4 # Copyright (C) 2019 Red Hat, Inc.
5 #
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>.
10 #
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.
13
14 SHELL = /bin/bash
15
16 target = RELEASE
17 toolchain = $(shell source ./edk2-funcs.sh && qemu_edk2_get_toolchain $(1))
18
19 licenses := \
20         edk2/License.txt \
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
25
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.
29 flashdevs := \
30         aarch64-code \
31         arm-code \
32         i386-code \
33         i386-secure-code \
34         x86_64-code \
35         x86_64-secure-code \
36         x86_64-microvm \
37         \
38         arm-vars \
39         i386-vars
40
41 all: $(foreach flashdev,$(flashdevs),../pc-bios/edk2-$(flashdev).fd.bz2) \
42         ../pc-bios/edk2-licenses.txt
43
44 ../pc-bios/edk2-%.fd.bz2: ../pc-bios/edk2-%.fd
45         bzip2 -9 -c $< > $@
46
47 # When the build completes, we need not keep the uncompressed flash device
48 # files.
49 .INTERMEDIATE: $(foreach flashdev,$(flashdevs),../pc-bios/edk2-$(flashdev).fd)
50
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.
54 submodules:
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 \
61                 ; \
62         fi
63
64 # See notes on the ".NOTPARALLEL" target and the "+" indicator in
65 # "tests/uefi-test-tools/Makefile".
66 .NOTPARALLEL:
67
68 ../pc-bios/edk2-aarch64-code.fd: submodules
69         +./edk2-build.sh \
70                 aarch64 \
71                 --arch=AARCH64 \
72                 --platform=ArmVirtPkg/ArmVirtQemu.dsc \
73                 -D NETWORK_IP6_ENABLE \
74                 -D NETWORK_HTTP_BOOT_ENABLE \
75                 -D NETWORK_TLS_ENABLE \
76                 -D TPM2_ENABLE \
77                 -D TPM2_CONFIG_ENABLE
78         cp edk2/Build/ArmVirtQemu-AARCH64/$(target)_$(call toolchain,aarch64)/FV/QEMU_EFI.fd \
79                 $@
80         truncate --size=64M $@
81
82 ../pc-bios/edk2-arm-code.fd: submodules
83         +./edk2-build.sh \
84                 arm \
85                 --arch=ARM \
86                 --platform=ArmVirtPkg/ArmVirtQemu.dsc \
87                 -D NETWORK_IP6_ENABLE \
88                 -D NETWORK_HTTP_BOOT_ENABLE \
89                 -D NETWORK_TLS_ENABLE \
90                 -D TPM2_ENABLE \
91                 -D TPM2_CONFIG_ENABLE
92         cp edk2/Build/ArmVirtQemu-ARM/$(target)_$(call toolchain,arm)/FV/QEMU_EFI.fd \
93                 $@
94         truncate --size=64M $@
95
96 ../pc-bios/edk2-i386-code.fd: submodules
97         +./edk2-build.sh \
98                 i386 \
99                 --arch=IA32 \
100                 --platform=OvmfPkg/OvmfPkgIa32.dsc \
101                 -D NETWORK_IP6_ENABLE \
102                 -D NETWORK_HTTP_BOOT_ENABLE \
103                 -D NETWORK_TLS_ENABLE \
104                 -D TPM_ENABLE \
105                 -D TPM_CONFIG_ENABLE
106         cp edk2/Build/OvmfIa32/$(target)_$(call toolchain,i386)/FV/OVMF_CODE.fd $@
107
108 ../pc-bios/edk2-i386-secure-code.fd: submodules
109         +./edk2-build.sh \
110                 i386 \
111                 --arch=IA32 \
112                 --platform=OvmfPkg/OvmfPkgIa32.dsc \
113                 -D NETWORK_IP6_ENABLE \
114                 -D NETWORK_HTTP_BOOT_ENABLE \
115                 -D NETWORK_TLS_ENABLE \
116                 -D TPM_ENABLE \
117                 -D TPM_CONFIG_ENABLE \
118                 -D SECURE_BOOT_ENABLE \
119                 -D SMM_REQUIRE
120         cp edk2/Build/OvmfIa32/$(target)_$(call toolchain,i386)/FV/OVMF_CODE.fd $@
121
122 ../pc-bios/edk2-x86_64-code.fd: submodules
123         +./edk2-build.sh \
124                 x86_64 \
125                 --arch=X64 \
126                 --platform=OvmfPkg/OvmfPkgX64.dsc \
127                 -D NETWORK_IP6_ENABLE \
128                 -D NETWORK_HTTP_BOOT_ENABLE \
129                 -D NETWORK_TLS_ENABLE \
130                 -D TPM_ENABLE \
131                 -D TPM_CONFIG_ENABLE
132         cp edk2/Build/OvmfX64/$(target)_$(call toolchain,x86_64)/FV/OVMF_CODE.fd $@
133
134 ../pc-bios/edk2-x86_64-secure-code.fd: submodules
135         +./edk2-build.sh \
136                 x86_64 \
137                 --arch=IA32 \
138                 --arch=X64 \
139                 --platform=OvmfPkg/OvmfPkgIa32X64.dsc \
140                 -D NETWORK_IP6_ENABLE \
141                 -D NETWORK_HTTP_BOOT_ENABLE \
142                 -D NETWORK_TLS_ENABLE \
143                 -D TPM_ENABLE \
144                 -D TPM_CONFIG_ENABLE \
145                 -D SECURE_BOOT_ENABLE \
146                 -D SMM_REQUIRE
147         cp edk2/Build/Ovmf3264/$(target)_$(call toolchain,x86_64)/FV/OVMF_CODE.fd $@
148
149 ../pc-bios/edk2-x86_64-microvm.fd: submodules
150         +./edk2-build.sh \
151                 x86_64 \
152                 --arch=X64 \
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 $@
158
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 \
161                 $@
162         truncate --size=64M $@
163
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 $@
166
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) > $@
172         dos2unix $@
173
174 clean:
175         rm -rf edk2/Build
176         cd edk2/Conf && \
177                 rm -rf .cache BuildEnv.sh build_rule.txt target.txt \
178                         tools_def.txt