1 | # $Id: Makefile.kmk 48674 2013-09-25 08:26:15Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Toplevel sub-makefile for the EFI firmwares.
|
---|
4 | #
|
---|
5 | # Note! kBuild is only used for the build tools, the rest is handled by the
|
---|
6 | # very custom EFI build system.
|
---|
7 | #
|
---|
8 |
|
---|
9 | #
|
---|
10 | # Copyright (C) 2013 Oracle Corporation
|
---|
11 | #
|
---|
12 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
13 | # available from http://www.virtualbox.org. This file is free software;
|
---|
14 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
15 | # General Public License (GPL) as published by the Free Software
|
---|
16 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
17 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
18 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
19 | #
|
---|
20 | # The contents of this file may alternatively be used under the terms
|
---|
21 | # of the Common Development and Distribution License Version 1.0
|
---|
22 | # (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
23 | # VirtualBox OSE distribution, in which case the provisions of the
|
---|
24 | # CDDL are applicable instead of those of the GPL.
|
---|
25 | #
|
---|
26 | # You may elect to license modified versions of this file under the
|
---|
27 | # terms and conditions of either the GPL or the CDDL or both.
|
---|
28 | #
|
---|
29 |
|
---|
30 | SUB_DEPTH = ../../../../..
|
---|
31 | include $(KBUILD_PATH)/subheader.kmk
|
---|
32 |
|
---|
33 | #
|
---|
34 | # Make sure our Config.kmk is included.
|
---|
35 | #
|
---|
36 | ifndef VBOX_EFI_FIRMWARE_CONFIG_KMK_INCLUDED
|
---|
37 | include $(PATH_SUB_CURRENT)/Config.kmk
|
---|
38 | endif
|
---|
39 |
|
---|
40 |
|
---|
41 | #
|
---|
42 | # Include sub-makefiles.
|
---|
43 | #
|
---|
44 | VBOX_EFI_BLDPROGS := $(BLDPROGS)
|
---|
45 | include $(PATH_SUB_CURRENT)/BaseTools/Makefile.kmk
|
---|
46 | VBOX_EFI_BLDPROGS := $(filter-out $(VBOX_EFI_BLDPROGS),$(BLDPROGS)) VBoxEfiBldPythonWrappers
|
---|
47 |
|
---|
48 | #
|
---|
49 | # Binary wrappers for python scripts.
|
---|
50 | #
|
---|
51 | VBOX_EFI_PYTHON_WRAPPERS = \
|
---|
52 | BPDG \
|
---|
53 | build \
|
---|
54 | Ecc \
|
---|
55 | GenFds \
|
---|
56 | GenPatchPcdTable \
|
---|
57 | PatchPcdValue \
|
---|
58 | Trim \
|
---|
59 | TargetTool \
|
---|
60 | UPT
|
---|
61 |
|
---|
62 | INSTALLS += VBoxEfiBldPythonWrappers
|
---|
63 | VBoxEfiBldPythonWrappers_TEMPLATE = VBoxEfiBldProg
|
---|
64 | if1of ($(KBUILD_HOST), win os2)
|
---|
65 | VBoxEfiBldPythonWrappers_EXEC_SOURCES = \
|
---|
66 | $(foreach PyWrap,$(VBOX_EFI_PYTHON_WRAPPERS),$(VBoxEfiBldPythonWrappers_0_OUTDIR)/$(PyWrap).cmd)
|
---|
67 | else
|
---|
68 | VBoxEfiBldPythonWrappers_EXEC_SOURCES = \
|
---|
69 | $(addprefix $(VBoxEfiBldPythonWrappers_0_OUTDIR)/,$(VBOX_EFI_PYTHON_WRAPPERS))
|
---|
70 | endif
|
---|
71 | VBoxEfiBldPythonWrappers_CLEAN = $(VBoxEfiBldPythonWrappers_SOURCES)
|
---|
72 |
|
---|
73 | if1of ($(KBUILD_HOST), win os2)
|
---|
74 | define VBoxEfiBldPythonWrappersRuleTemplate
|
---|
75 | $$$$(VBoxEfiBldPythonWrappers_0_OUTDIR)/$(PyWrap).cmd: | $$$$(dir $$$$@)
|
---|
76 | $$(APPEND) -tn "$$@" \
|
---|
77 | '@SET PYTHONPATH=$$(VBOX_PATH_EFI_FIRMWARE)/BaseTools/Source/Python' \
|
---|
78 | '@"$$(VBOX_BLD_PYTHON)" "$$(VBOX_PATH_EFI_FIRMWARE)/BaseTools/Source/Python/$(PyWrap)/$(PyWrap).py" %*'
|
---|
79 | endef
|
---|
80 | else
|
---|
81 | define VBoxEfiBldPythonWrappersRuleTemplate
|
---|
82 | $$$$(VBoxEfiBldPythonWrappers_0_OUTDIR)/$(PyWrap): | $$$$(dir $$$$@)
|
---|
83 | $$(APPEND) -tn "$$@" \
|
---|
84 | '#!$(ASH)' \
|
---|
85 | 'export PYTHONPATH="$$(VBOX_PATH_EFI_FIRMWARE)/BaseTools/Source/Python"' \
|
---|
86 | 'exec "$$(VBOX_BLD_PYTHON)" "$$(VBOX_PATH_EFI_FIRMWARE)/BaseTools/Source/Python/$(PyWrap)/$(PyWrap).py" "$$(DOLLAR)@"'
|
---|
87 | $$(CHMOD) a+x "$$@"
|
---|
88 | endef
|
---|
89 | endif
|
---|
90 | $(foreach PyWrap,$(VBOX_EFI_PYTHON_WRAPPERS),$(eval $(VBoxEfiBldPythonWrappersRuleTemplate)))
|
---|
91 |
|
---|
92 | #
|
---|
93 | # Rules for building and installing the VBox EFI firmware images.
|
---|
94 | #
|
---|
95 | INSTALLS += VBoxEfiFirmware
|
---|
96 | VBoxEfiFirmware_INST = $(INST_BIN)
|
---|
97 | VBoxEfiFirmware_MODE = 0644
|
---|
98 | VBoxEfiFirmware_SOURCES = \
|
---|
99 | $(VBoxEfiFirmware_0_OUTDIR)/x86/$(VBOX_EFI_OUTPUT_SUBDIR)/FV/OVMF.fd=>VBoxEFI32.fd \
|
---|
100 | $(VBoxEfiFirmware_0_OUTDIR)/amd64/$(VBOX_EFI_OUTPUT_SUBDIR)/FV/OVMF.fd=>VBoxEFI64.fd
|
---|
101 | VBoxEfiFirmware_BLDDIRS = \
|
---|
102 | $(VBoxEfiFirmware_0_OUTDIR)/x86/ \
|
---|
103 | $(VBoxEfiFirmware_0_OUTDIR)/x86/Conf/ \
|
---|
104 | $(VBoxEfiFirmware_0_OUTDIR)/amd64/ \
|
---|
105 | $(VBoxEfiFirmware_0_OUTDIR)/amd64/Conf/
|
---|
106 | VBoxEfiFirmware_CLEAN = \
|
---|
107 | $(VBoxEfiFirmware_0_OUTDIR)/x86/Conf/target.txt \
|
---|
108 | $(VBoxEfiFirmware_0_OUTDIR)/x86/Conf/tools_def.txt \
|
---|
109 | $(VBoxEfiFirmware_0_OUTDIR)/amd64/Conf/target.txt \
|
---|
110 | $(VBoxEfiFirmware_0_OUTDIR)/amd64/Conf/tools_def.txt
|
---|
111 |
|
---|
112 | # Install the debug info.
|
---|
113 | INSTALLS += VBoxEfiFirmwareDbg32
|
---|
114 | VBoxEfiFirmwareDbg32_INST = $(INST_VBOXDBG_SYMS)x86/
|
---|
115 | VBoxEfiFirmwareDbg32_MODE = 0644
|
---|
116 | if1of ($(KBUILD_HOST), win)
|
---|
117 | VBoxEfiFirmwareDbg32_SOURCES = \
|
---|
118 | $(foreach mod,$(VBOX_EFI_MODULES),$(VBoxEfiFirmware_0_OUTDIR)/x86/$(VBOX_EFI_OUTPUT_SUBDIR)/IA32/$(mod).pdb)
|
---|
119 | else
|
---|
120 | VBoxEfiFirmwareDbg32_SOURCES = \
|
---|
121 | $(foreach mod,$(VBOX_EFI_MODULES_FLAT),$(VBoxEfiFirmware_0_OUTDIR)/x86/$(VBOX_EFI_OUTPUT_SUBDIR)/IA32/$(mod).debug)
|
---|
122 | endif
|
---|
123 |
|
---|
124 | INSTALLS += VBoxEfiFirmwareDbg64
|
---|
125 | VBoxEfiFirmwareDbg64_INST = $(INST_VBOXDBG_SYMS)amd64/
|
---|
126 | VBoxEfiFirmwareDbg64_MODE = 0644
|
---|
127 | if1of ($(KBUILD_HOST), win)
|
---|
128 | VBoxEfiFirmwareDbg64_SOURCES = \
|
---|
129 | $(foreach mod,$(VBOX_EFI_MODULES),$(VBoxEfiFirmware_0_OUTDIR)/amd64/$(VBOX_EFI_OUTPUT_SUBDIR)/X64/$(mod).pdb)
|
---|
130 | else
|
---|
131 | VBoxEfiFirmwareDbg64_SOURCES = \
|
---|
132 | $(foreach mod,$(VBOX_EFI_MODULES_FLAT),$(VBoxEfiFirmware_0_OUTDIR)/amd64/$(VBOX_EFI_OUTPUT_SUBDIR)/X64/$(mod).debug)
|
---|
133 | endif
|
---|
134 |
|
---|
135 |
|
---|
136 | #
|
---|
137 | # Install a custom clean up rule for dealing with the EFI build system output.
|
---|
138 | #
|
---|
139 | PASS_CLEAN_trgs += VBoxEfiFirmwareCleanup
|
---|
140 | VBoxEfiFirmwareCleanup:
|
---|
141 | $(if $(VBoxEfiFirmware_0_OUTDIR),,exit 1)
|
---|
142 | $(RM) -Rf -- "$(VBoxEfiFirmware_0_OUTDIR)/amd64/" "$(VBoxEfiFirmware_0_OUTDIR)/x86/"
|
---|
143 | .PHONY: VBoxEfiFirmwareCleanup
|
---|
144 |
|
---|
145 |
|
---|
146 | #
|
---|
147 | # The reset vector code.
|
---|
148 | #
|
---|
149 |
|
---|
150 | # Dummy Linker.
|
---|
151 | TOOL_VBoxEfiResetVectorLd = Dummy linker for the EFI reset vectors.
|
---|
152 | TOOL_VBoxEfiResetVectorLd_LINK_MISCBIN_OUTPUT =
|
---|
153 | TOOL_VBoxEfiResetVectorLd_LINK_MISCBIN_DEPEND =
|
---|
154 | TOOL_VBoxEfiResetVectorLd_LINK_MISCBIN_DEPORD =
|
---|
155 | define TOOL_VBoxEfiResetVectorLd_LINK_MISCBIN_CMDS
|
---|
156 | $(VBOX_BLD_PYTHON) $(VBOX_PATH_EFI_FIRMWARE)/UefiCpuPkg/ResetVector/Vtf0/Tools/FixupForRawSection.py \
|
---|
157 | "--only-padd-image" \
|
---|
158 | "$(objs)" \
|
---|
159 | "$(out)"
|
---|
160 | endef
|
---|
161 |
|
---|
162 | # Makes a boot sector test image.
|
---|
163 | TEMPLATE_VBoxEfiResetVectorRaw = kBuild tool config for building the EFI reset vectors.
|
---|
164 | TEMPLATE_VBoxEfiResetVectorRaw_INSTTYPE = none
|
---|
165 | TEMPLATE_VBoxEfiResetVectorRaw_BINSUFF = .raw
|
---|
166 | TEMPLATE_VBoxEfiResetVectorRaw_MODE = 0644
|
---|
167 | TEMPLATE_VBoxEfiResetVectorRaw_ASTOOL = YASM
|
---|
168 | TEMPLATE_VBoxEfiResetVectorRaw_ASFLAGS:= -f bin $(VBOX_YASM_Wno-segreg-in-64bit) --mapfile
|
---|
169 | TEMPLATE_VBoxEfiResetVectorRaw_ASDEFS = ASM_FORMAT_BIN __YASM__
|
---|
170 | TEMPLATE_VBoxEfiResetVectorRaw_LDTOOL = VBoxEfiResetVectorLd
|
---|
171 |
|
---|
172 | MISCBINS += VBoxEfiResetVector-x86
|
---|
173 | VBoxEfiResetVector-x86_TEMPLATE = VBoxEfiResetVectorRaw
|
---|
174 | VBoxEfiResetVector-x86_DEFS = ARCH_IA32 RT_ARCH_X86 DEBUG_NONE
|
---|
175 | VBoxEfiResetVector-x86_SOURCES = UefiCpuPkg/ResetVector/Vtf0/ResetVectorCode.asm
|
---|
176 |
|
---|
177 | MISCBINS += VBoxEfiResetVector-amd64
|
---|
178 | VBoxEfiResetVector-amd64_TEMPLATE = VBoxEfiResetVectorRaw
|
---|
179 | VBoxEfiResetVector-amd64_DEFS = ARCH_X64 RT_ARCH_AMD64 DEBUG_NONE
|
---|
180 | VBoxEfiResetVector-amd64_SOURCES = UefiCpuPkg/ResetVector/Vtf0/ResetVectorCode.asm
|
---|
181 |
|
---|
182 |
|
---|
183 | #
|
---|
184 | # Include the footer early so that we can use VBoxEfiFirmware_0_OUTDIR below.
|
---|
185 | #
|
---|
186 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
187 |
|
---|
188 |
|
---|
189 | #
|
---|
190 | # The common build.py invocation part.
|
---|
191 | #
|
---|
192 | if1of ($(KBUILD_HOST), win)
|
---|
193 | VBOX_EFI_REDIRECT_E_EQUAL:=$(EQUAL)
|
---|
194 | VBOX_EFI_BUILD_CMD = $(REDIRECT) \
|
---|
195 | -E 'PATH=$(VBOX_PATH_STAGE_EFI_BLDPROGS)$(VBOX_SEP)$(PATH)' \
|
---|
196 | -E 'INCLUDE=$(PATH_ROOT)/include$(VBOX_SEP)$(PATH_OUT)$(VBOX_SEP)$(VBOX_SEP)$(PATH_TOOL_$(VBOX_VCC_TOOL)_INC)$(INCLUDE)' \
|
---|
197 | -E 'COMSPEC=$(windir)\system32\cmd.exe'
|
---|
198 | else
|
---|
199 | VBOX_EFI_REDIRECT_E_EQUAL:=
|
---|
200 | VBOX_EFI_BUILD_CMD = $(REDIRECT) \
|
---|
201 | -E "PATH=$(VBOX_PATH_STAGE_EFI_BLDPROGS)$(VBOX_SEP)$(PATH)" \
|
---|
202 | -E "C_INCLUDE_PATH=$(PATH_ROOT)/include$(VBOX_SEP)$(PATH_OUT)$(VBOX_SEP)$(C_INCLUDE_PATH)" \
|
---|
203 | -E "CPLUS_INCLUDE_PATH=$(PATH_ROOT)/include$(VBOX_SEP)$(PATH_OUT)$(VBOX_SEP)$(C_INCLUDE_PATH)"
|
---|
204 | endif
|
---|
205 | VBOX_EFI_BUILD_CMD += \
|
---|
206 | -E 'PYTHONPATH=$(VBOX_PATH_EFI_FIRMWARE)/BaseTools/Source/Python' \
|
---|
207 | -E 'PYTHONDONTWRITEBYTECODE=1' \
|
---|
208 | -E 'IASL_BIN=$(VBOX_IASLCMD)' \
|
---|
209 | -E 'WORKSPACE=$(VBOX_PATH_EFI_FIRMWARE)' \
|
---|
210 | -E 'EDK_TOOLS_PATH=$(VBOX_PATH_EFI_FIRMWARE)/BaseTools' \
|
---|
211 | -E 'EFI_SOURCE$(VBOX_EFI_REDIRECT_E_EQUAL)' \
|
---|
212 | -E 'ECP_SOURCE$(VBOX_EFI_REDIRECT_E_EQUAL)' \
|
---|
213 | -E 'EDK_SOURCE$(VBOX_EFI_REDIRECT_E_EQUAL)' \
|
---|
214 | -E 'X64_PETOOLS_PREFIX$(VBOX_EFI_REDIRECT_E_EQUAL)' \
|
---|
215 | -E 'ARCH$(VBOX_EFI_REDIRECT_E_EQUAL)' \
|
---|
216 | -E 'IPF_PETOOLS_PREFIX=__no_ipf__' \
|
---|
217 | -E $(if-expr "$(EFI_QUIET)" != "" || "$(KBUILD_VERBOSE)" != "",'EFI_QUIET=','EFI_QUIET=@') \
|
---|
218 | -C '$(VBOX_PATH_EFI_FIRMWARE)' \
|
---|
219 | -- $(VBOX_BLD_PYTHON) "$(VBOX_PATH_EFI_FIRMWARE)/BaseTools/Source/Python/build/build.py" \
|
---|
220 | -D VBOX_WITH_EDK2_REV=13361 \
|
---|
221 | -D VBOX=1 \
|
---|
222 | -D VBOX_WITH_OVMF=1 \
|
---|
223 | -D BUILD_NEW_SHELL=1 \
|
---|
224 | -D VBOX_REV=$(VBOX_SVN_REV) \
|
---|
225 | -D "VBOX_OUTPUT_BASE_DIR=$(VBoxEfiFirmware_0_OUTDIR)" \
|
---|
226 | -D "VBOX_PATH_ROOT=$(PATH_ROOT)" \
|
---|
227 | -D "VBOX_RESET_VECTOR_X86=$(VBoxEfiResetVector-x86_1_TARGET)" \
|
---|
228 | -D "VBOX_RESET_VECTOR_AMD64=$(VBoxEfiResetVector-amd64_1_TARGET)" \
|
---|
229 | $(if $(VBOX_OSE),-D "VBOX_OSE=1") \
|
---|
230 | --no-cache \
|
---|
231 | --buildtarget $(VBOX_EFI_BUILD_TARGET) \
|
---|
232 | --tagname $(VBOX_EFI_TOOL_CHAIN)
|
---|
233 |
|
---|
234 |
|
---|
235 | #
|
---|
236 | # VBoxEFI32
|
---|
237 | #
|
---|
238 |
|
---|
239 | $(VBoxEfiFirmware_0_OUTDIR)/x86/Conf/target.txt: $(MAKEFILE) | $$(dir $$@) $(VBOX_EFI_BLDPROGS)
|
---|
240 | $(APPEND) -tn "$@" \
|
---|
241 | "# Automatically generated, do not edit" \
|
---|
242 | "" \
|
---|
243 | "# These variables cannot be overriden by the build.py command line." \
|
---|
244 | "TOOL_CHAIN_CONF = $(VBoxEfiFirmware_0_OUTDIR)/x86/Conf/tools_def.txt" \
|
---|
245 | "BUILD_RULE_CONF = BaseTools/Conf/build_rule.template" \
|
---|
246 | "" \
|
---|
247 | "# These variables are overridden and this is just for show." \
|
---|
248 | "ACTIVE_PLATFORM = OvmfPkg/OvmfPkgIa32.dsc" \
|
---|
249 | "TARGET = $(VBOX_EFI_BUILD_TARGET)" \
|
---|
250 | "TARGET_ARCH = IA32" \
|
---|
251 | "TOOL_CHAIN_TAG = $(VBOX_EFI_TOOL_CHAIN)" \
|
---|
252 | "MAX_CONCURRENT_THREAD_NUMBER = 1"
|
---|
253 |
|
---|
254 | $(VBoxEfiFirmware_0_OUTDIR)/x86/Conf/tools_def.txt: \
|
---|
255 | $(VBOX_PATH_EFI_FIRMWARE)/BaseTools/Conf/tools_def.template \
|
---|
256 | $(MAKEFILE) | $$(dir $$@)
|
---|
257 | $(RM) -f -- "$@"
|
---|
258 | ifeq ($(VBOX_EFI_TOOL_CHAIN),UNIXGCC)
|
---|
259 | $(SED) \
|
---|
260 | -e 's,^DEFINE UNIXGCC_IA32_PETOOLS_PREFIX.*$(DOLLAR),DEFINE UNIXGCC_IA32_PETOOLS_PREFIX = $(VBOX_PATH_PREFIX_MINGW32),' \
|
---|
261 | -e 's,^DEFINE UNIXGCC_X64_PETOOLS_PREFIX.*$(DOLLAR),DEFINE UNIXGCC_X64_PETOOLS_PREFIX = $(VBOX_PATH_PREFIX_MINGW64),' \
|
---|
262 | -e 's,^DEFINE UNIX_IASL_BIN.*$(DOLLAR),DEFINE UNIX_IASL_BIN = $(VBOX_IASLCMD),' \
|
---|
263 | -e 's,^\(DEFINE GCC_ALL_CC_FLAGS.*$(DOLLAR)\),\1 -Wno-address $(VBOX_MINGW32_Wno-unused-but-set-variable) $(VBOX_MINGW32_Wno-maybe-uninitialized),' \
|
---|
264 | $(if $(VBOX_MINGW32_Wno-array-bounds),,-e 's,-Wno-array-bounds,,g') \
|
---|
265 | -e 's,=[[:space:]]*make$(DOLLAR),= $(MAKE),' \
|
---|
266 | $(if-expr "$(VBOX_EFI_BUILD_TARGET)" == "DEBUG", -e 's/ -O2 / /g',) \
|
---|
267 | --output $@ $<
|
---|
268 | else if ($(VBOX_EFI_TOOL_CHAIN),VS2010)
|
---|
269 | $(SED) \
|
---|
270 | -e 's,^DEFINE VS2010_BIN[[:space:]]*=.*$(DOLLAR),DEFINE VS2010_BIN = $(PATH_TOOL_$(VBOX_VCC_TOOL))/bin,' \
|
---|
271 | -e 's,^DEFINE VS2010_DLL[[:space:]]*=.*$(DOLLAR),DEFINE VS2010_DLL = DEF(VS2010_BIN),' \
|
---|
272 | --output $@ $<
|
---|
273 | else
|
---|
274 | $(error Unexpected VBOX_EFI_TOOL_CHAIN value "$(VBOX_EFI_TOOL_CHAIN)")
|
---|
275 | endif
|
---|
276 |
|
---|
277 | ## @todo 32-bit DEBUG is busted, image to big.
|
---|
278 | $(VBoxEfiFirmware_0_OUTDIR)/x86/$(VBOX_EFI_OUTPUT_SUBDIR)/FV/OVMF.fd \
|
---|
279 | + $(VBoxEfiFirmwareDbg32_SOURCES): \
|
---|
280 | $(VBoxEfiFirmware_0_OUTDIR)/x86/Conf/target.txt \
|
---|
281 | $(VBoxEfiFirmware_0_OUTDIR)/x86/Conf/tools_def.txt \
|
---|
282 | $$(VBoxEfiResetVector-x86_1_TARGET)
|
---|
283 | + $(VBOX_EFI_BUILD_CMD) \
|
---|
284 | --vbox-target-conf "$(VBoxEfiFirmware_0_OUTDIR)/x86/Conf/target.txt" \
|
---|
285 | --arch IA32 \
|
---|
286 | --platform OvmfPkg/OvmfPkgIa32.dsc \
|
---|
287 | -n 1 # -v
|
---|
288 |
|
---|
289 | #
|
---|
290 | # VBoxEFI64
|
---|
291 | #
|
---|
292 |
|
---|
293 | $(VBoxEfiFirmware_0_OUTDIR)/amd64/Conf/target.txt: $(MAKEFILE) | $$(dir $$@) $(VBOX_EFI_BLDPROGS)
|
---|
294 | $(APPEND) -tn "$@" \
|
---|
295 | "# Automatically generated, do not edit" \
|
---|
296 | "" \
|
---|
297 | "# These variables cannot be overriden by the build.py command line." \
|
---|
298 | "TOOL_CHAIN_CONF = $(VBoxEfiFirmware_0_OUTDIR)/amd64/Conf/tools_def.txt" \
|
---|
299 | "BUILD_RULE_CONF = BaseTools/Conf/build_rule.template" \
|
---|
300 | "" \
|
---|
301 | "# These variables are overridden and this is just for show." \
|
---|
302 | "ACTIVE_PLATFORM = OvmfPkg/OvmfPkgX64.dsc" \
|
---|
303 | "TARGET = $(VBOX_EFI_BUILD_TARGET)" \
|
---|
304 | "TARGET_ARCH = X64" \
|
---|
305 | "TOOL_CHAIN_TAG = $(VBOX_EFI_TOOL_CHAIN)" \
|
---|
306 | "MAX_CONCURRENT_THREAD_NUMBER = 1"
|
---|
307 |
|
---|
308 | # Hack! Drop an underscore from the entrypoint, or SecMain won't work.
|
---|
309 | $(VBoxEfiFirmware_0_OUTDIR)/amd64/Conf/tools_def.txt: \
|
---|
310 | $(VBOX_PATH_EFI_FIRMWARE)/BaseTools/Conf/tools_def.template \
|
---|
311 | $(MAKEFILE) | $$(dir $$@)
|
---|
312 | $(RM) -f -- "$@"
|
---|
313 | ifeq ($(VBOX_EFI_TOOL_CHAIN),UNIXGCC)
|
---|
314 | $(SED) \
|
---|
315 | -e 's,^DEFINE UNIXGCC_IA32_PETOOLS_PREFIX.*$(DOLLAR),DEFINE UNIXGCC_IA32_PETOOLS_PREFIX = $(VBOX_PATH_PREFIX_MINGW32),' \
|
---|
316 | -e 's,^DEFINE UNIXGCC_X64_PETOOLS_PREFIX.*$(DOLLAR),DEFINE UNIXGCC_X64_PETOOLS_PREFIX = $(VBOX_PATH_PREFIX_MINGW64),' \
|
---|
317 | -e 's,^DEFINE UNIX_IASL_BIN.*$(DOLLAR),DEFINE UNIX_IASL_BIN = $(VBOX_IASLCMD),' \
|
---|
318 | -e 's,^\(DEFINE GCC_ALL_CC_FLAGS.*$(DOLLAR)\),\1 -Wno-address $(VBOX_MINGW64_Wno-unused-but-set-variable) $(VBOX_MINGW64_Wno-maybe-uninitialized),' \
|
---|
319 | $(if $(VBOX_MINGW64_Wno-array-bounds),,-e 's,-Wno-array-bounds,,g') \
|
---|
320 | -e 's,=[[:space:]]*make$(DOLLAR),= $(MAKE),' \
|
---|
321 | -e 's,^\(DEFINE GCC_IA32_X64_DLINK_COMMON.*\)$(DOLLAR),\1 --fatal-warnings,' \
|
---|
322 | $(if $(VBOX_MINGW64_USER_LABEL_PREFIX),,-e 's,^\(DEFINE GCC_IA32_X64_DLINK_FLAGS.* --entry \)_,\1,') \
|
---|
323 | --output $@ $<
|
---|
324 | else if ($(VBOX_EFI_TOOL_CHAIN),VS2010)
|
---|
325 | $(SED) \
|
---|
326 | -e 's,^DEFINE VS2010_BIN[[:space:]]*=.*$(DOLLAR),DEFINE VS2010_BIN = $(PATH_TOOL_$(VBOX_VCC_TOOL))/bin,' \
|
---|
327 | -e 's,^DEFINE VS2010_DLL[[:space:]]*=.*$(DOLLAR),DEFINE VS2010_DLL = DEF(VS2010_BIN),' \
|
---|
328 | -e 's,^\([^=]*_VS2010[a-zA-Z_0-9]*_CC_FLAGS[[:space:]]*=.*\) /X \(.*\)$(DOLLAR),\1 \2,' \
|
---|
329 | --output $@ $<
|
---|
330 | else
|
---|
331 | $(error Unexpected VBOX_EFI_TOOL_CHAIN value "$(VBOX_EFI_TOOL_CHAIN)")
|
---|
332 | endif
|
---|
333 |
|
---|
334 | $(VBoxEfiFirmware_0_OUTDIR)/amd64/$(VBOX_EFI_OUTPUT_SUBDIR)/FV/OVMF.fd \
|
---|
335 | + $(VBoxEfiFirmwareDbg64_SOURCES): \
|
---|
336 | $(VBoxEfiFirmware_0_OUTDIR)/amd64/Conf/target.txt \
|
---|
337 | $(VBoxEfiFirmware_0_OUTDIR)/amd64/Conf/tools_def.txt \
|
---|
338 | $$(VBoxEfiResetVector-amd64_1_TARGET)
|
---|
339 | + $(VBOX_EFI_BUILD_CMD) \
|
---|
340 | --vbox-target-conf "$(VBoxEfiFirmware_0_OUTDIR)/amd64/Conf/target.txt" \
|
---|
341 | --arch X64 \
|
---|
342 | --platform OvmfPkg/OvmfPkgX64.dsc \
|
---|
343 | -n 1 # -v
|
---|
344 |
|
---|
345 | #
|
---|
346 | # Some aliases.
|
---|
347 | #
|
---|
348 | build-efi-x86: $$(filter %VBoxEFI32.fd,$$(VBoxEfiFirmware_2_STAGE_TARGETS))
|
---|
349 | build-efi-amd64: $$(filter %VBoxEFI64.fd,$$(VBoxEfiFirmware_2_STAGE_TARGETS))
|
---|
350 |
|
---|