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