]> git.proxmox.com Git - mirror_qemu.git/blob - roms/Makefile.edk2
roms/Makefile.edk2: define edk2-stable201905 network feature test macros
[mirror_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 toolchain = $(shell source ./edk2-funcs.sh && qemu_edk2_get_toolchain $(1))
17
18 licenses := \
19 edk2/License.txt \
20 edk2/OvmfPkg/License.txt \
21 edk2/CryptoPkg/Library/OpensslLib/openssl/LICENSE
22
23 # The "edk2-arm-vars.fd" varstore template is suitable for aarch64 as well.
24 # Similarly, the "edk2-i386-vars.fd" varstore template is suitable for x86_64
25 # as well, independently of "secure" too.
26 flashdevs := \
27 aarch64-code \
28 arm-code \
29 i386-code \
30 i386-secure-code \
31 x86_64-code \
32 x86_64-secure-code \
33 \
34 arm-vars \
35 i386-vars
36
37 all: $(foreach flashdev,$(flashdevs),../pc-bios/edk2-$(flashdev).fd.bz2) \
38 ../pc-bios/edk2-licenses.txt
39
40 ../pc-bios/edk2-%.fd.bz2: ../pc-bios/edk2-%.fd
41 bzip2 -9 -c $< > $@
42
43 # When the build completes, we need not keep the uncompressed flash device
44 # files.
45 .INTERMEDIATE: $(foreach flashdev,$(flashdevs),../pc-bios/edk2-$(flashdev).fd)
46
47 submodules:
48 cd edk2 && git submodule update --init --force
49
50 # See notes on the ".NOTPARALLEL" target and the "+" indicator in
51 # "tests/uefi-test-tools/Makefile".
52 .NOTPARALLEL:
53
54 ../pc-bios/edk2-aarch64-code.fd: submodules
55 +./edk2-build.sh \
56 aarch64 \
57 --arch=AARCH64 \
58 --platform=ArmVirtPkg/ArmVirtQemu.dsc \
59 -D NETWORK_IP6_ENABLE \
60 -D NETWORK_HTTP_BOOT_ENABLE \
61 -D HTTP_BOOT_ENABLE
62 cp edk2/Build/ArmVirtQemu-AARCH64/DEBUG_$(call toolchain,aarch64)/FV/QEMU_EFI.fd \
63 $@
64 truncate --size=64M $@
65
66 ../pc-bios/edk2-arm-code.fd: submodules
67 +./edk2-build.sh \
68 arm \
69 --arch=ARM \
70 --platform=ArmVirtPkg/ArmVirtQemu.dsc \
71 -D NETWORK_IP6_ENABLE \
72 -D NETWORK_HTTP_BOOT_ENABLE \
73 -D HTTP_BOOT_ENABLE
74 cp edk2/Build/ArmVirtQemu-ARM/DEBUG_$(call toolchain,arm)/FV/QEMU_EFI.fd \
75 $@
76 truncate --size=64M $@
77
78 ../pc-bios/edk2-i386-code.fd: submodules
79 +./edk2-build.sh \
80 i386 \
81 --arch=IA32 \
82 --platform=OvmfPkg/OvmfPkgIa32.dsc \
83 -D NETWORK_IP6_ENABLE \
84 -D NETWORK_HTTP_BOOT_ENABLE \
85 -D HTTP_BOOT_ENABLE \
86 -D NETWORK_TLS_ENABLE \
87 -D TLS_ENABLE \
88 -D TPM2_ENABLE \
89 -D TPM2_CONFIG_ENABLE
90 cp edk2/Build/OvmfIa32/DEBUG_$(call toolchain,i386)/FV/OVMF_CODE.fd $@
91
92 ../pc-bios/edk2-i386-secure-code.fd: submodules
93 +./edk2-build.sh \
94 i386 \
95 --arch=IA32 \
96 --platform=OvmfPkg/OvmfPkgIa32.dsc \
97 -D NETWORK_IP6_ENABLE \
98 -D NETWORK_HTTP_BOOT_ENABLE \
99 -D HTTP_BOOT_ENABLE \
100 -D NETWORK_TLS_ENABLE \
101 -D TLS_ENABLE \
102 -D TPM2_ENABLE \
103 -D TPM2_CONFIG_ENABLE \
104 -D SECURE_BOOT_ENABLE \
105 -D SMM_REQUIRE
106 cp edk2/Build/OvmfIa32/DEBUG_$(call toolchain,i386)/FV/OVMF_CODE.fd $@
107
108 ../pc-bios/edk2-x86_64-code.fd: submodules
109 +./edk2-build.sh \
110 x86_64 \
111 --arch=X64 \
112 --platform=OvmfPkg/OvmfPkgX64.dsc \
113 -D NETWORK_IP6_ENABLE \
114 -D NETWORK_HTTP_BOOT_ENABLE \
115 -D HTTP_BOOT_ENABLE \
116 -D NETWORK_TLS_ENABLE \
117 -D TLS_ENABLE \
118 -D TPM2_ENABLE \
119 -D TPM2_CONFIG_ENABLE
120 cp edk2/Build/OvmfX64/DEBUG_$(call toolchain,x86_64)/FV/OVMF_CODE.fd $@
121
122 ../pc-bios/edk2-x86_64-secure-code.fd: submodules
123 +./edk2-build.sh \
124 x86_64 \
125 --arch=IA32 \
126 --arch=X64 \
127 --platform=OvmfPkg/OvmfPkgIa32X64.dsc \
128 -D NETWORK_IP6_ENABLE \
129 -D NETWORK_HTTP_BOOT_ENABLE \
130 -D HTTP_BOOT_ENABLE \
131 -D NETWORK_TLS_ENABLE \
132 -D TLS_ENABLE \
133 -D TPM2_ENABLE \
134 -D TPM2_CONFIG_ENABLE \
135 -D SECURE_BOOT_ENABLE \
136 -D SMM_REQUIRE
137 cp edk2/Build/Ovmf3264/DEBUG_$(call toolchain,x86_64)/FV/OVMF_CODE.fd $@
138
139 ../pc-bios/edk2-arm-vars.fd: ../pc-bios/edk2-arm-code.fd
140 cp edk2/Build/ArmVirtQemu-ARM/DEBUG_$(call toolchain,arm)/FV/QEMU_VARS.fd \
141 $@
142 truncate --size=64M $@
143
144 ../pc-bios/edk2-i386-vars.fd: ../pc-bios/edk2-i386-code.fd
145 cp edk2/Build/OvmfIa32/DEBUG_$(call toolchain,i386)/FV/OVMF_VARS.fd $@
146
147 # The license file accumulates several individual licenses from under edk2,
148 # prefixing each individual license with a header (generated by "tail") that
149 # states its pathname.
150 ../pc-bios/edk2-licenses.txt: submodules
151 tail -n $(shell cat $(licenses) | wc -l) $(licenses) > $@
152 dos2unix $@
153
154 clean:
155 rm -rf edk2/Build
156 cd edk2/Conf && \
157 rm -rf .cache BuildEnv.sh build_rule.txt target.txt \
158 tools_def.txt