]>
Commit | Line | Data |
---|---|---|
536d2173 LE |
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 | ||
ca260415 | 16 | target = RELEASE |
536d2173 LE |
17 | toolchain = $(shell source ./edk2-funcs.sh && qemu_edk2_get_toolchain $(1)) |
18 | ||
19 | licenses := \ | |
20 | edk2/License.txt \ | |
9153b9d7 | 21 | edk2/License-History.txt \ |
536d2173 | 22 | edk2/OvmfPkg/License.txt \ |
9153b9d7 | 23 | edk2/ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3/COPYING.txt \ |
536d2173 LE |
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 | \ | |
37 | arm-vars \ | |
38 | i386-vars | |
39 | ||
40 | all: $(foreach flashdev,$(flashdevs),../pc-bios/edk2-$(flashdev).fd.bz2) \ | |
41 | ../pc-bios/edk2-licenses.txt | |
42 | ||
43 | ../pc-bios/edk2-%.fd.bz2: ../pc-bios/edk2-%.fd | |
44 | bzip2 -9 -c $< > $@ | |
45 | ||
46 | # When the build completes, we need not keep the uncompressed flash device | |
47 | # files. | |
48 | .INTERMEDIATE: $(foreach flashdev,$(flashdevs),../pc-bios/edk2-$(flashdev).fd) | |
49 | ||
f3e330e3 MR |
50 | # Fetch edk2 submodule's submodules. If it is not in a git tree, assume |
51 | # we're building from a tarball and that they've already been fetched by | |
52 | # make-release/tarball scripts. | |
536d2173 | 53 | submodules: |
f3e330e3 | 54 | if test -d edk2/.git; then \ |
bd0da3a3 PMD |
55 | cd edk2 && git submodule update --init --force -- \ |
56 | ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3 \ | |
57 | BaseTools/Source/C/BrotliCompress/brotli \ | |
58 | CryptoPkg/Library/OpensslLib/openssl \ | |
59 | MdeModulePkg/Library/BrotliCustomDecompressLib/brotli \ | |
60 | ; \ | |
f3e330e3 | 61 | fi |
536d2173 LE |
62 | |
63 | # See notes on the ".NOTPARALLEL" target and the "+" indicator in | |
64 | # "tests/uefi-test-tools/Makefile". | |
65 | .NOTPARALLEL: | |
66 | ||
67 | ../pc-bios/edk2-aarch64-code.fd: submodules | |
68 | +./edk2-build.sh \ | |
69 | aarch64 \ | |
70 | --arch=AARCH64 \ | |
71 | --platform=ArmVirtPkg/ArmVirtQemu.dsc \ | |
72 | -D NETWORK_IP6_ENABLE \ | |
374680ac LE |
73 | -D NETWORK_HTTP_BOOT_ENABLE \ |
74 | -D NETWORK_TLS_ENABLE \ | |
75 | -D TPM2_ENABLE \ | |
76 | -D TPM2_CONFIG_ENABLE | |
ca260415 | 77 | cp edk2/Build/ArmVirtQemu-AARCH64/$(target)_$(call toolchain,aarch64)/FV/QEMU_EFI.fd \ |
536d2173 LE |
78 | $@ |
79 | truncate --size=64M $@ | |
80 | ||
81 | ../pc-bios/edk2-arm-code.fd: submodules | |
82 | +./edk2-build.sh \ | |
83 | arm \ | |
84 | --arch=ARM \ | |
85 | --platform=ArmVirtPkg/ArmVirtQemu.dsc \ | |
86 | -D NETWORK_IP6_ENABLE \ | |
374680ac LE |
87 | -D NETWORK_HTTP_BOOT_ENABLE \ |
88 | -D NETWORK_TLS_ENABLE \ | |
89 | -D TPM2_ENABLE \ | |
90 | -D TPM2_CONFIG_ENABLE | |
ca260415 | 91 | cp edk2/Build/ArmVirtQemu-ARM/$(target)_$(call toolchain,arm)/FV/QEMU_EFI.fd \ |
536d2173 LE |
92 | $@ |
93 | truncate --size=64M $@ | |
94 | ||
95 | ../pc-bios/edk2-i386-code.fd: submodules | |
96 | +./edk2-build.sh \ | |
97 | i386 \ | |
98 | --arch=IA32 \ | |
99 | --platform=OvmfPkg/OvmfPkgIa32.dsc \ | |
100 | -D NETWORK_IP6_ENABLE \ | |
b1625c66 | 101 | -D NETWORK_HTTP_BOOT_ENABLE \ |
b1625c66 | 102 | -D NETWORK_TLS_ENABLE \ |
504fffb9 | 103 | -D TPM_ENABLE \ |
e105de75 | 104 | -D TPM_CONFIG_ENABLE |
ca260415 | 105 | cp edk2/Build/OvmfIa32/$(target)_$(call toolchain,i386)/FV/OVMF_CODE.fd $@ |
536d2173 LE |
106 | |
107 | ../pc-bios/edk2-i386-secure-code.fd: submodules | |
108 | +./edk2-build.sh \ | |
109 | i386 \ | |
110 | --arch=IA32 \ | |
111 | --platform=OvmfPkg/OvmfPkgIa32.dsc \ | |
112 | -D NETWORK_IP6_ENABLE \ | |
b1625c66 | 113 | -D NETWORK_HTTP_BOOT_ENABLE \ |
b1625c66 | 114 | -D NETWORK_TLS_ENABLE \ |
504fffb9 LE |
115 | -D TPM_ENABLE \ |
116 | -D TPM_CONFIG_ENABLE \ | |
536d2173 LE |
117 | -D SECURE_BOOT_ENABLE \ |
118 | -D SMM_REQUIRE | |
ca260415 | 119 | cp edk2/Build/OvmfIa32/$(target)_$(call toolchain,i386)/FV/OVMF_CODE.fd $@ |
536d2173 LE |
120 | |
121 | ../pc-bios/edk2-x86_64-code.fd: submodules | |
122 | +./edk2-build.sh \ | |
123 | x86_64 \ | |
124 | --arch=X64 \ | |
125 | --platform=OvmfPkg/OvmfPkgX64.dsc \ | |
126 | -D NETWORK_IP6_ENABLE \ | |
b1625c66 | 127 | -D NETWORK_HTTP_BOOT_ENABLE \ |
b1625c66 | 128 | -D NETWORK_TLS_ENABLE \ |
504fffb9 | 129 | -D TPM_ENABLE \ |
e105de75 | 130 | -D TPM_CONFIG_ENABLE |
ca260415 | 131 | cp edk2/Build/OvmfX64/$(target)_$(call toolchain,x86_64)/FV/OVMF_CODE.fd $@ |
536d2173 LE |
132 | |
133 | ../pc-bios/edk2-x86_64-secure-code.fd: submodules | |
134 | +./edk2-build.sh \ | |
135 | x86_64 \ | |
136 | --arch=IA32 \ | |
137 | --arch=X64 \ | |
138 | --platform=OvmfPkg/OvmfPkgIa32X64.dsc \ | |
139 | -D NETWORK_IP6_ENABLE \ | |
b1625c66 | 140 | -D NETWORK_HTTP_BOOT_ENABLE \ |
b1625c66 | 141 | -D NETWORK_TLS_ENABLE \ |
504fffb9 LE |
142 | -D TPM_ENABLE \ |
143 | -D TPM_CONFIG_ENABLE \ | |
536d2173 LE |
144 | -D SECURE_BOOT_ENABLE \ |
145 | -D SMM_REQUIRE | |
ca260415 | 146 | cp edk2/Build/Ovmf3264/$(target)_$(call toolchain,x86_64)/FV/OVMF_CODE.fd $@ |
536d2173 LE |
147 | |
148 | ../pc-bios/edk2-arm-vars.fd: ../pc-bios/edk2-arm-code.fd | |
ca260415 | 149 | cp edk2/Build/ArmVirtQemu-ARM/$(target)_$(call toolchain,arm)/FV/QEMU_VARS.fd \ |
536d2173 LE |
150 | $@ |
151 | truncate --size=64M $@ | |
152 | ||
153 | ../pc-bios/edk2-i386-vars.fd: ../pc-bios/edk2-i386-code.fd | |
ca260415 | 154 | cp edk2/Build/OvmfIa32/$(target)_$(call toolchain,i386)/FV/OVMF_VARS.fd $@ |
536d2173 LE |
155 | |
156 | # The license file accumulates several individual licenses from under edk2, | |
157 | # prefixing each individual license with a header (generated by "tail") that | |
158 | # states its pathname. | |
159 | ../pc-bios/edk2-licenses.txt: submodules | |
160 | tail -n $(shell cat $(licenses) | wc -l) $(licenses) > $@ | |
161 | dos2unix $@ | |
162 | ||
163 | clean: | |
164 | rm -rf edk2/Build | |
165 | cd edk2/Conf && \ | |
166 | rm -rf .cache BuildEnv.sh build_rule.txt target.txt \ | |
167 | tools_def.txt |