1 | # $Id: Config.kmk 105075 2024-06-28 15:45:11Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # kBuild Configuration file for VirtualBox Boot Sector Kit 3.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2010-2023 Oracle and/or its affiliates.
|
---|
8 | #
|
---|
9 | # This file is part of VirtualBox base platform packages, as
|
---|
10 | # available from https://www.virtualbox.org.
|
---|
11 | #
|
---|
12 | # This program is free software; you can redistribute it and/or
|
---|
13 | # modify it under the terms of the GNU General Public License
|
---|
14 | # as published by the Free Software Foundation, in version 3 of the
|
---|
15 | # License.
|
---|
16 | #
|
---|
17 | # This program is distributed in the hope that it will be useful, but
|
---|
18 | # WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | # General Public License for more details.
|
---|
21 | #
|
---|
22 | # You should have received a copy of the GNU General Public License
|
---|
23 | # along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | #
|
---|
25 | # The contents of this file may alternatively be used under the terms
|
---|
26 | # of the Common Development and Distribution License Version 1.0
|
---|
27 | # (CDDL), a copy of it is provided in the "COPYING.CDDL" file included
|
---|
28 | # in the VirtualBox distribution, in which case the provisions of the
|
---|
29 | # CDDL are applicable instead of those of the GPL.
|
---|
30 | #
|
---|
31 | # You may elect to license modified versions of this file under the
|
---|
32 | # terms and conditions of either the GPL or the CDDL or both.
|
---|
33 | #
|
---|
34 | # SPDX-License-Identifier: GPL-3.0-only OR CDDL-1.0
|
---|
35 | #
|
---|
36 |
|
---|
37 | VBOX_BOOTSECTORS_CONFIG_KMK_INCLUDED = 1
|
---|
38 |
|
---|
39 | # Include the parent configure file.
|
---|
40 | ifndef VBOX_VALIDATIONKIT_CONFIG_KMK_INCLUDED
|
---|
41 | include $(PATH_ROOT)/src/VBox/ValidationKit/Config.kmk
|
---|
42 | endif
|
---|
43 |
|
---|
44 | # Add our 32-bit and 64-bit C properties.
|
---|
45 | KBUILD_COMPILE_CATEGTORIES += C32 C64
|
---|
46 | PROPS_TOOLS += C32TOOL C64TOOL
|
---|
47 | PROPS_SINGLE += C32TOOL C64TOOL C32OBJSUFF C64OBJSUFF
|
---|
48 | PROPS_ACCUMULATE_R += C32FLAGS C64FLAGS C32DEFS C64DEFS
|
---|
49 | PROPS_ACCUMULATE_L += C32INCS C64INCS
|
---|
50 |
|
---|
51 | if 0 # Adding as few as possible new properties.
|
---|
52 | KBUILD_COMPILE_CATEGTORIES += C16
|
---|
53 | PROPS_TOOLS += C16TOOL
|
---|
54 | PROPS_SINGLE += C16TOOL C16OBJSUFF
|
---|
55 | PROPS_ACCUMULATE_R += C16FLAGS C16DEFS
|
---|
56 | PROPS_ACCUMULATE_L += C16INCS
|
---|
57 | endif
|
---|
58 |
|
---|
59 | # Add noarch to the architectures list (will be there by default in a new kBuild).
|
---|
60 | KBUILD_ARCHES += noarch
|
---|
61 |
|
---|
62 |
|
---|
63 | # The bootsector directory.
|
---|
64 | VBOX_PATH_BOOTSECTORS_SRC = $(VBOX_PATH_VALIDATIONKIT_SRC)/bootsectors
|
---|
65 |
|
---|
66 | # The bs3kit source directory.
|
---|
67 | VBOX_PATH_BS3KIT_SRC = $(VBOX_PATH_BOOTSECTORS_SRC)/bs3kit
|
---|
68 |
|
---|
69 |
|
---|
70 | # The 16-bit code & data segment classes.
|
---|
71 | if 1
|
---|
72 | BS3KIT_CLASS_CODE16 = CODE
|
---|
73 | BS3KIT_SEGNM_DATA16 =
|
---|
74 | BS3KIT_CLASS_DATA16 = DATA
|
---|
75 | BS3KIT_GRPNM_DATA16 = DGROUP
|
---|
76 | BS3KIT_CLASS_BSS16 = BSS
|
---|
77 | else
|
---|
78 | BS3KIT_CLASS_CODE16 = BS3CLASS16CODE
|
---|
79 | BS3KIT_SEGNM_DATA16 = BS3DATA16
|
---|
80 | BS3KIT_CLASS_DATA16 = FAR_DATA
|
---|
81 | BS3KIT_GRPNM_DATA16 = BS3DATA16_GROUP
|
---|
82 | BS3KIT_CLASS_BSS16 = ???
|
---|
83 | endif
|
---|
84 |
|
---|
85 |
|
---|
86 | ##
|
---|
87 | # Macro for generating near-call aliases for one 16-bit C function.
|
---|
88 | # @param 1 The target name.
|
---|
89 | # @param 2 The common function.
|
---|
90 | BS3KIT_FN_GEN_CMN_NEARSTUB = $(evalcall2 def_Bs3KitGenNearStubSource,$1,_$2_c16,_$2_f16)
|
---|
91 |
|
---|
92 | ##
|
---|
93 | # Macro for generating near-call aliases for one 16-bit C mode function.
|
---|
94 | # @param 1 The target name.
|
---|
95 | # @param 2 The mode function.
|
---|
96 | BS3KIT_FN_GEN_MODE_NEARSTUB = $(foreach suff, \
|
---|
97 | _rm \
|
---|
98 | _pe16 \
|
---|
99 | _pe16_v86 \
|
---|
100 | _pe32_16 \
|
---|
101 | _pev86 \
|
---|
102 | _pp16 \
|
---|
103 | _pp16_v86 \
|
---|
104 | _pp32_16 \
|
---|
105 | _ppv86 \
|
---|
106 | _pae16 \
|
---|
107 | _pae16_v86 \
|
---|
108 | _pae32_16 \
|
---|
109 | _paev86 \
|
---|
110 | _lm16 \
|
---|
111 | ,$(evalcall2 def_Bs3KitGenNearStubSource,$1,_$2$(suff),_$2$(suff)_far))
|
---|
112 |
|
---|
113 | # @param 1 The target name.
|
---|
114 | # @param 2 The near function name.
|
---|
115 | # @param 3 The far function name.
|
---|
116 | define def_Bs3KitGenNearStubSource
|
---|
117 | $1_SOURCES += $$($1_0_OUTDIR)/stub$2.asm
|
---|
118 | $1_CLEAN += $$($1_0_OUTDIR)/stub$2.asm
|
---|
119 | #$$$$($1_0_OUTDIR)/stub$2.asm: $$(VBOX_PATH_BOOTSECTORS_SRC)/Config.kmk | $$$$(dir $$$$@)
|
---|
120 | $$$$($1_0_OUTDIR)/stub$2.asm: | $$$$(dir $$$$@)
|
---|
121 | $(QUIET)$(APPEND) -tn $$@ \
|
---|
122 | '%include "bs3kit.mac"' \
|
---|
123 | 'BS3_BEGIN_TEXT16' \
|
---|
124 | ' extern $3' \
|
---|
125 | 'BS3_BEGIN_TEXT16_NEARSTUBS' \
|
---|
126 | 'BS3_GLOBAL_NAME_EX $2, function, 6' \
|
---|
127 | ' pop ax' \
|
---|
128 | ' push cs' \
|
---|
129 | ' push ax' \
|
---|
130 | ' jmp $3 wrt CGROUP16'
|
---|
131 | endef
|
---|
132 |
|
---|
133 |
|
---|
134 | ##
|
---|
135 | # Macro for generating far-call aliases for zero or more 16-bit C or assembly functions.
|
---|
136 | # @param 1 The target name.
|
---|
137 | # @param 2 The common function.
|
---|
138 | # @param 3 The parameter size in bytes.
|
---|
139 | BS3KIT_FN_GEN_CMN_FARSTUB = $(evalcall2 def_Bs3KitGenFarStubSource,$1,$2,_f16,_c16,$3)
|
---|
140 |
|
---|
141 | ##
|
---|
142 | # Macro for generating far-call aliases for zero or more 16-bit C mode functions.
|
---|
143 | # @param 1 The target name.
|
---|
144 | # @param 2 The mode function.
|
---|
145 | # @param 3 The parameter size in bytes.
|
---|
146 | BS3KIT_FN_GEN_MODE_FARSTUB = $(foreach suff, \
|
---|
147 | _rm \
|
---|
148 | _pe16 \
|
---|
149 | _pe16_v86 \
|
---|
150 | _pe32_16 \
|
---|
151 | _pev86 \
|
---|
152 | _pp16 \
|
---|
153 | _pp16_v86 \
|
---|
154 | _pp32_16 \
|
---|
155 | _ppv86 \
|
---|
156 | _pae16 \
|
---|
157 | _pae16_v86 \
|
---|
158 | _pae32_16 \
|
---|
159 | _paev86 \
|
---|
160 | _lm16 \
|
---|
161 | ,$(evalcall2 def_Bs3KitGenFarStubSource,$1,$2,$(suff)_far,$(suff),$3))
|
---|
162 |
|
---|
163 | # @param 1 The target name.
|
---|
164 | # @param 2 The function name.
|
---|
165 | # @param 3 The far function suffix.
|
---|
166 | # @param 4 The near function suffix.
|
---|
167 | # @param 5 The parameter size in bytes.
|
---|
168 | define def_Bs3KitGenFarStubSource
|
---|
169 | $1_SOURCES += $$($1_0_OUTDIR)/stub_$2$3.asm
|
---|
170 | $1_CLEAN += $$($1_0_OUTDIR)/stub_$2$3.asm
|
---|
171 | #$$$$($1_0_OUTDIR)/stub_$2$3.asm: $$(VBOX_PATH_BOOTSECTORS_SRC)/Config.kmk | $$$$(dir $$$$@)
|
---|
172 | $$$$($1_0_OUTDIR)/stub_$2$3.asm: | $$$$(dir $$$$@)
|
---|
173 | $(QUIET)$(APPEND) -tn $$@ \
|
---|
174 | '%include "bs3kit.mac"' \
|
---|
175 | 'BS3_BEGIN_TEXT16' \
|
---|
176 | ' extern _$2$4' \
|
---|
177 | 'BS3_BEGIN_TEXT16_FARSTUBS' \
|
---|
178 | 'BS3_PROC_BEGIN _$2$3' \
|
---|
179 | ' CPU 8086' \
|
---|
180 | ' inc bp' \
|
---|
181 | ' push bp' \
|
---|
182 | ' mov bp, sp' \
|
---|
183 | '%assign offParam $5' \
|
---|
184 | '%rep $5 / 2' \
|
---|
185 | ' push word [bp + 2 + 4 + offParam - 2]' \
|
---|
186 | '%assign offParam offParam - 2' \
|
---|
187 | '%endrep' \
|
---|
188 | ' call _$2$4' \
|
---|
189 | ' add sp, $5' \
|
---|
190 | ' pop bp' \
|
---|
191 | ' dec bp' \
|
---|
192 | ' retf' \
|
---|
193 | 'BS3_PROC_END _$2$3' \
|
---|
194 | ''
|
---|
195 | endef
|
---|
196 |
|
---|
197 |
|
---|
198 | #
|
---|
199 | # Tools Tools Tools
|
---|
200 | # Tools Tools Tools
|
---|
201 | # Tools Tools Tools
|
---|
202 | #
|
---|
203 |
|
---|
204 | if defined(VBOX_USE_KSUBMIT) && "$(KBUILD_HOST)" == "win"
|
---|
205 | VBOX_BS3KIT_KSUBMIT_OBJ_CONV := kmk_builtin_kSubmit --
|
---|
206 | else
|
---|
207 | VBOX_BS3KIT_KSUBMIT_OBJ_CONV :=
|
---|
208 | endif
|
---|
209 |
|
---|
210 | # Dummy CP "linker" tool.
|
---|
211 | TOOL_VBoxBsCpLd = Dummy copy linker.
|
---|
212 | TOOL_VBoxBsCpLd_LINK_MISCBIN_OUTPUT =
|
---|
213 | TOOL_VBoxBsCpLd_LINK_MISCBIN_DEPEND =
|
---|
214 | TOOL_VBoxBsCpLd_LINK_MISCBIN_DEPORD =
|
---|
215 | define TOOL_VBoxBsCpLd_LINK_MISCBIN_CMDS
|
---|
216 | $(CP) -- $(objs) $(othersrc) "$(out)"
|
---|
217 | endef
|
---|
218 |
|
---|
219 | # Dummy exit 1 "linker" tool.
|
---|
220 | TOOL_VBoxBsUnusedLd = Dummy unused linker.
|
---|
221 | TOOL_VBoxBsUnusedLd_LINK_MISCBIN_OUTPUT =
|
---|
222 | TOOL_VBoxBsUnusedLd_LINK_MISCBIN_DEPEND =
|
---|
223 | TOOL_VBoxBsUnusedLd_LINK_MISCBIN_DEPORD =
|
---|
224 | define TOOL_VBoxBsUnusedLd_LINK_MISCBIN_CMDS
|
---|
225 | echo "cannot use this template for linking"
|
---|
226 | exit 1
|
---|
227 | endef
|
---|
228 |
|
---|
229 | # NASM tool with dependency workarounds (change dir to force consistent results; add -MP).
|
---|
230 | # Requires http://permalink.gmane.org/gmane.comp.lang.nasm.devel/3704 to work.
|
---|
231 | include $(KBUILD_PATH)/tools/NASM.kmk
|
---|
232 | TOOL_VBoxNasm = Our version of the NASM tool
|
---|
233 | ifndef TOOL_VBoxNasm_PATH
|
---|
234 | TOOL_VBoxNasm_PATH := $(firstword $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST)/nasm/v*.*)))
|
---|
235 | if "$(TOOL_VBoxNasm_PATH)" == "" && "$(KBUILD_DEVTOOLS_HST_ALT)" != ""
|
---|
236 | TOOL_VBoxNasm_PATH := $(firstword $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST_ALT)/nasm/v*.*)))
|
---|
237 | endif
|
---|
238 | endif
|
---|
239 | ifneq ($(TOOL_VBoxNasm_PATH),)
|
---|
240 | TOOL_VBoxNasm_AS ?= $(TOOL_VBoxNasm_PATH)/nasm$(HOSTSUFF_EXE)
|
---|
241 | else
|
---|
242 | TOOL_VBoxNasm_AS ?= nasm$(HOSTSUFF_EXE)
|
---|
243 | endif
|
---|
244 | TOOL_VBoxNasm_ASFLAGS ?= $(TOOL_NASM_ASFLAGS)
|
---|
245 | TOOL_VBoxNasm_COMPILE_AS_OUTPUT = $(outbase).lst
|
---|
246 | TOOL_VBoxNasm_COMPILE_AS_OUTPUT_MAYBE = $(obj).original
|
---|
247 | TOOL_VBoxNasm_COMPILE_AS_DEPEND = $(VBoxBs3ObjConverter_1_TARGET)
|
---|
248 | TOOL_VBoxNasm_COMPILE_AS_DEPORD =
|
---|
249 | define TOOL_VBoxNasm_COMPILE_AS_CMDS
|
---|
250 | ifdef TOOL_VBoxNasm_USE_KSUBMIT
|
---|
251 | $(QUIET)kmk_builtin_kSubmit -C $(PATH_OUT_BASE) -- $(TOOL_VBoxNasm_AS)\
|
---|
252 | $(flags) $(addsuffix /,$(addprefix -i, $(incs))) $(addprefix -D, $(defs))\
|
---|
253 | -l $(outbase).lst\
|
---|
254 | -o $(obj)\
|
---|
255 | -MD "$(dep)" -MP\
|
---|
256 | $(abspath $(source))
|
---|
257 | else
|
---|
258 | $(QUIET)$(REDIRECT) -C $(PATH_OUT_BASE) -- $(TOOL_VBoxNasm_AS)\
|
---|
259 | $(flags) $(addsuffix /,$(addprefix -i, $(incs))) $(addprefix -D, $(defs))\
|
---|
260 | -l $(outbase).lst\
|
---|
261 | -o $(obj)\
|
---|
262 | -MD "$(dep)" -MP\
|
---|
263 | $(abspath $(source))
|
---|
264 | endif
|
---|
265 | $(QUIET)$(VBOX_BS3KIT_KSUBMIT_OBJ_CONV) $(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
|
---|
266 | endef
|
---|
267 |
|
---|
268 | #
|
---|
269 | # ELF 64-bit compiler tool with object conversion.
|
---|
270 | #
|
---|
271 | # Mac needs cross compiler: sudo port install x86_64-elf-gcc
|
---|
272 | #
|
---|
273 | TOOL_Bs3Gcc64Elf64 := AMD64/ELF64 gcc/g++ (cross) compiler.
|
---|
274 | ifeq ($(KBUILD_HOST),darwin)
|
---|
275 | TOOL_Bs3Gcc64Elf64_CC ?= x86_64-elf-gcc$(HOSTSUFF_EXE) -m64
|
---|
276 | TOOL_Bs3Gcc64Elf64_CXX ?= x86_64-elf-g++$(HOSTSUFF_EXE) -m64
|
---|
277 | else
|
---|
278 | TOOL_Bs3Gcc64Elf64_CC ?= gcc$(HOSTSUFF_EXE) -m64
|
---|
279 | TOOL_Bs3Gcc64Elf64_CXX ?= g++$(HOSTSUFF_EXE) -m64
|
---|
280 | endif
|
---|
281 | ifdef SLKRUNS
|
---|
282 | TOOL_Bs3Gcc64Elf64_CC += -fmessage-length=0
|
---|
283 | TOOL_Bs3Gcc64Elf64_CXX += -fmessage-length=0
|
---|
284 | endif
|
---|
285 | TOOL_Bs3Gcc64Elf64_COBJSUFF = .o64
|
---|
286 | TOOL_Bs3Gcc64Elf64_CFLAGS = -fno-pie -x c $(VBOX_GCC_Wa_cma_nocompress_debug_sections) -ffreestanding
|
---|
287 | TOOL_Bs3Gcc64Elf64_CFLAGS.debug = -g
|
---|
288 | TOOL_Bs3Gcc64Elf64_CFLAGS.profile = -O2 #-g -pg
|
---|
289 | TOOL_Bs3Gcc64Elf64_CFLAGS.release = -O2
|
---|
290 | TOOL_Bs3Gcc64Elf64_CINCS =
|
---|
291 | TOOL_Bs3Gcc64Elf64_CDEFS =
|
---|
292 | TOOL_Bs3Gcc64Elf64_COMPILE_C_DEPEND = $(VBoxBs3ObjConverter_1_TARGET)
|
---|
293 | TOOL_Bs3Gcc64Elf64_COMPILE_C_DEPORD =
|
---|
294 | TOOL_Bs3Gcc64Elf64_COMPILE_C_OUTPUT =
|
---|
295 | TOOL_Bs3Gcc64Elf64_COMPILE_C_OUTPUT_MAYBE = $(obj).original
|
---|
296 | define TOOL_Bs3Gcc64Elf64_COMPILE_C_CMDS
|
---|
297 | $(QUIET)$(TOOL_Bs3Gcc64Elf64_CC) -c\
|
---|
298 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
---|
299 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
300 | -o $(obj)\
|
---|
301 | $(abspath $(source))
|
---|
302 | $(QUIET)$(VBOX_BS3KIT_KSUBMIT_OBJ_CONV) $(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
|
---|
303 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
304 | endef
|
---|
305 |
|
---|
306 | TOOL_Bs3Gcc64Elf64_C64OBJSUFF = $(TOOL_Bs3Gcc64Elf64_COBJSUFF)
|
---|
307 | TOOL_Bs3Gcc64Elf64_C64FLAGS = $(TOOL_Bs3Gcc64Elf64_CFLAGS)
|
---|
308 | TOOL_Bs3Gcc64Elf64_C64FLAGS.debug = $(TOOL_Bs3Gcc64Elf64_CFLAGS.debug)
|
---|
309 | TOOL_Bs3Gcc64Elf64_C64FLAGS.profile = $(TOOL_Bs3Gcc64Elf64_CFLAGS.profile)
|
---|
310 | TOOL_Bs3Gcc64Elf64_C64FLAGS.release = $(TOOL_Bs3Gcc64Elf64_CFLAGS.release)
|
---|
311 | TOOL_Bs3Gcc64Elf64_C64INCS = $(TOOL_Bs3Gcc64Elf64_CINCS)
|
---|
312 | TOOL_Bs3Gcc64Elf64_C64DEFS = $(TOOL_Bs3Gcc64Elf64_CDEFS)
|
---|
313 | TOOL_Bs3Gcc64Elf64_COMPILE_C64_DEPEND = $(TOOL_Bs3Gcc64Elf64_COMPILE_C_DEPEND)
|
---|
314 | TOOL_Bs3Gcc64Elf64_COMPILE_C64_DEPORD = $(TOOL_Bs3Gcc64Elf64_COMPILE_C_DEPORD)
|
---|
315 | TOOL_Bs3Gcc64Elf64_COMPILE_C64_OUTPUT = $(TOOL_Bs3Gcc64Elf64_COMPILE_C_OUTPUT)
|
---|
316 | TOOL_Bs3Gcc64Elf64_COMPILE_C64_OUTPUT_MAYBE = $(TOOL_Bs3Gcc64Elf64_COMPILE_C_OUTPUT_MAYBE)
|
---|
317 | define TOOL_Bs3Gcc64Elf64_COMPILE_C64_CMDS
|
---|
318 | $(TOOL_Bs3Gcc64Elf64_COMPILE_C_CMDS)
|
---|
319 | endef
|
---|
320 |
|
---|
321 | TOOL_Bs3Gcc64Elf64_CXXOBJSUFF ?= .o
|
---|
322 | TOOL_Bs3Gcc64Elf64_CXXFLAGS ?= -fno-pie $(VBOX_GCC_Wa_cma_nocompress_debug_sections) -ffreestanding
|
---|
323 | TOOL_Bs3Gcc64Elf64_CXXFLAGS.debug ?= -g0 # no debug info, thank you
|
---|
324 | TOOL_Bs3Gcc64Elf64_CXXFLAGS.profile ?= -O2 #-g -pg
|
---|
325 | TOOL_Bs3Gcc64Elf64_CXXFLAGS.release ?= -O2
|
---|
326 | TOOL_Bs3Gcc64Elf64_CXXINCS ?=
|
---|
327 | TOOL_Bs3Gcc64Elf64_CXXDEFS ?=
|
---|
328 | TOOL_Bs3Gcc64Elf64_COMPILE_CXX_DEPEND = $(VBoxBs3ObjConverter_1_TARGET)
|
---|
329 | TOOL_Bs3Gcc64Elf64_COMPILE_CXX_DEPORD =
|
---|
330 | TOOL_Bs3Gcc64Elf64_COMPILE_CXX_OUTPUT =
|
---|
331 | TOOL_Bs3Gcc64Elf64_COMPILE_CXX_OUTPUT_MAYBE = $(obj).original
|
---|
332 | define TOOL_Bs3Gcc64Elf64_COMPILE_CXX_CMDS
|
---|
333 | $(QUIET)$(TOOL_Bs3Gcc64Elf64_CXX) -c\
|
---|
334 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
---|
335 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
336 | -o $(obj)\
|
---|
337 | $(abspath $(source))
|
---|
338 | $(QUIET)$(VBOX_BS3KIT_KSUBMIT_OBJ_CONV) $(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
|
---|
339 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
340 | endef
|
---|
341 |
|
---|
342 | #
|
---|
343 | # Visual C++ tool variant that runs the object converter afterwards.
|
---|
344 | #
|
---|
345 | # We also run SED on the assembly listing looking for SSE instructions, since
|
---|
346 | # the compiler doesn't have any known option to suppress SSE optimization. When
|
---|
347 | # the SED script finds something, the source code needs to be tweaked to work
|
---|
348 | # around it. See r160217 for examples.
|
---|
349 | #
|
---|
350 | TOOL_Bs3Vcc64 := Visual C++ 64-bit
|
---|
351 | TOOL_Bs3Vcc64_CC = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_CC)
|
---|
352 | TOOL_Bs3Vcc64_CXX = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_CXX)
|
---|
353 | TOOL_Bs3Vcc64_COBJSUFF = .o64
|
---|
354 | TOOL_Bs3Vcc64_CFLAGS = $(filter-out -TC -Zi,$(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_CFLAGS)) -TC -Z7
|
---|
355 | TOOL_Bs3Vcc64_CFLAGS.debug =
|
---|
356 | TOOL_Bs3Vcc64_CFLAGS.dbgopt = -O1
|
---|
357 | TOOL_Bs3Vcc64_CFLAGS.profile = -O1
|
---|
358 | TOOL_Bs3Vcc64_CFLAGS.release = -O1
|
---|
359 | TOOL_Bs3Vcc64_CINCS = $(PATH_TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_INC)
|
---|
360 | TOOL_Bs3Vcc64_CDEFS =
|
---|
361 | TOOL_Bs3Vcc64_COMPILE_C_DEPEND = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_C_DEPEND) $(VBoxBs3ObjConverter_1_TARGET)
|
---|
362 | TOOL_Bs3Vcc64_COMPILE_C_DEPORD = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_C_DEPORD)
|
---|
363 | TOOL_Bs3Vcc64_COMPILE_C_OUTPUT = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_C_OUTPUT)
|
---|
364 | TOOL_Bs3Vcc64_COMPILE_C_OUTPUT_MAYBE = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_C_OUTPUT_MAYBE) $(obj).original
|
---|
365 | TOOL_Bs3Vcc64_COMPILE_C_OUTPUT_MAYBE_PRECIOUS = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_C_OUTPUT_MAYBE_PRECIOUS) $(outbase)-obj.asm
|
---|
366 | define TOOL_Bs3Vcc64_COMPILE_C_CMDS
|
---|
367 | $(subst -Fo,-Fa$(outbase)-obj.asm -Fo,$(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_C_CMDS))
|
---|
368 | $(QUIET)$(VBOX_BS3KIT_KSUBMIT_OBJ_CONV) $(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
|
---|
369 | $(QUIET)$(SED) -e '/xmm[0-9]/!d' -e 'q11' $(outbase)-obj.asm
|
---|
370 | endef
|
---|
371 |
|
---|
372 | TOOL_Bs3Vcc64_C64OBJSUFF = $(TOOL_Bs3Vcc64_COBJSUFF)
|
---|
373 | TOOL_Bs3Vcc64_C64FLAGS = $(TOOL_Bs3Vcc64_CFLAGS)
|
---|
374 | TOOL_Bs3Vcc64_C64FLAGS.debug = $(TOOL_Bs3Vcc64_CFLAGS.debug)
|
---|
375 | TOOL_Bs3Vcc64_C64FLAGS.dbgopt = $(TOOL_Bs3Vcc64_CFLAGS.dbgopt)
|
---|
376 | TOOL_Bs3Vcc64_C64FLAGS.profile = $(TOOL_Bs3Vcc64_CFLAGS.profile)
|
---|
377 | TOOL_Bs3Vcc64_C64FLAGS.release = $(TOOL_Bs3Vcc64_CFLAGS.release)
|
---|
378 | TOOL_Bs3Vcc64_C64INCS = $(TOOL_Bs3Vcc64_CINCS)
|
---|
379 | TOOL_Bs3Vcc64_C64DEFS = $(TOOL_Bs3Vcc64_CDEFS)
|
---|
380 | TOOL_Bs3Vcc64_COMPILE_C64_DEPEND = $(TOOL_Bs3Vcc64_COMPILE_C_DEPEND)
|
---|
381 | TOOL_Bs3Vcc64_COMPILE_C64_DEPORD = $(TOOL_Bs3Vcc64_COMPILE_C_DEPORD)
|
---|
382 | TOOL_Bs3Vcc64_COMPILE_C64_OUTPUT = $(TOOL_Bs3Vcc64_COMPILE_C_OUTPUT)
|
---|
383 | TOOL_Bs3Vcc64_COMPILE_C64_OUTPUT_MAYBE = $(TOOL_Bs3Vcc64_COMPILE_C_OUTPUT_MAYBE)
|
---|
384 | define TOOL_Bs3Vcc64_COMPILE_C64_CMDS
|
---|
385 | $(TOOL_Bs3Vcc64_COMPILE_C_CMDS)
|
---|
386 | endef
|
---|
387 |
|
---|
388 | TOOL_Bs3Vcc64_CXXOBJSUFF = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_CXXOBJSUFF)
|
---|
389 | TOOL_Bs3Vcc64_CXXFLAGS = $(filter-out -Zi,$(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_CXXFLAGS)) -TP -Z7
|
---|
390 | TOOL_Bs3Vcc64_CXXFLAGS.debug =
|
---|
391 | TOOL_Bs3Vcc64_CXXFLAGS.dbgopt = -O1
|
---|
392 | TOOL_Bs3Vcc64_CXXFLAGS.profile = -O1
|
---|
393 | TOOL_Bs3Vcc64_CXXFLAGS.release = -O1
|
---|
394 | TOOL_Bs3Vcc64_CXXINCS = $(PATH_TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_INC)
|
---|
395 | TOOL_Bs3Vcc64_CXXDEFS =
|
---|
396 | TOOL_Bs3Vcc64_COMPILE_CXX_DEPEND = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_CXX_DEPEND) $(VBoxBs3ObjConverter_1_TARGET)
|
---|
397 | TOOL_Bs3Vcc64_COMPILE_CXX_DEPORD = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_CXX_DEPORD)
|
---|
398 | TOOL_Bs3Vcc64_COMPILE_CXX_OUTPUT = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_CXX_OUTPUT)
|
---|
399 | TOOL_Bs3Vcc64_COMPILE_CXX_OUTPUT_MAYBE = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_CXX_OUTPUT_MAYBE) $(obj).original
|
---|
400 | TOOL_Bs3Vcc64_COMPILE_CXX_OUTPUT_MAYBE_PRECIOUS = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_CXX_OUTPUT_MAYBE_PRECIOUS) $(outbase)-obj.asm
|
---|
401 | define TOOL_Bs3Vcc64_COMPILE_CXX_CMDS
|
---|
402 | $(subst -Fo,-Fa$(outbase)-obj.asm -Fo,$(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_CXX_CMDS))
|
---|
403 | $(QUIET)$(VBOX_BS3KIT_KSUBMIT_OBJ_CONV) $(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
|
---|
404 | $(QUIET)$(SED) -e '/xmm[0-9]/!d' -e 'q11' $(outbase)-obj.asm
|
---|
405 | endef
|
---|
406 |
|
---|
407 | #
|
---|
408 | # 32-bit OpenWatcom C/C++ tool variant that runs the object converter afterwards
|
---|
409 | # to rename intrinsic functions so they don't clash with the 16-bit compiler.
|
---|
410 | #
|
---|
411 | TOOL_Bs3Ow32 := OpenWatcom C/C++ 32-bit with object conversion and import library creation
|
---|
412 | TOOL_Bs3Ow32_EXTENDS = OPENWATCOM
|
---|
413 | TOOL_Bs3Ow32_CC = $(TOOL_OPENWATCOM_CC)
|
---|
414 | TOOL_Bs3Ow32_CXX = $(TOOL_OPENWATCOM_CXX)
|
---|
415 | TOOL_Bs3Ow32_COBJSUFF = .o32
|
---|
416 | TOOL_Bs3Ow32_CFLAGS = $(TOOL_OPENWATCOM_CFLAGS)
|
---|
417 | # -adfs \ - This is too complicated and it doesn't support stubbing files (svn rename fun.h pain.h). Use kDepObj instead.
|
---|
418 | # -ad=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(dep)) \
|
---|
419 | # -adt=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(obj)) \
|
---|
420 | # -add=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(abspath $(source))) \
|
---|
421 | # -adhp=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(dir $(abspath $(source))))
|
---|
422 | TOOL_Bs3Ow32_CFLAGS.debug = $(TOOL_OPENWATCOM_CFLAGS.debug)
|
---|
423 | TOOL_Bs3Ow32_CFLAGS.dbgopt = $(TOOL_OPENWATCOM_CFLAGS.dbgopt)
|
---|
424 | TOOL_Bs3Ow32_CFLAGS.profile = $(TOOL_OPENWATCOM_CFLAGS.profile)
|
---|
425 | TOOL_Bs3Ow32_CFLAGS.release = $(TOOL_OPENWATCOM_CFLAGS.release)
|
---|
426 | TOOL_Bs3Ow32_CINCS = $(TOOL_OPENWATCOM_CINCS)
|
---|
427 | TOOL_Bs3Ow32_CDEFS =
|
---|
428 | TOOL_Bs3Ow32_COMPILE_C_DEPEND = $(TOOL_OPENWATCOM_COMPILE_C_DEPEND) $(VBoxBs3ObjConverter_1_TARGET)
|
---|
429 | TOOL_Bs3Ow32_COMPILE_C_DEPORD = $(TOOL_OPENWATCOM_COMPILE_C_DEPORD)
|
---|
430 | TOOL_Bs3Ow32_COMPILE_C_OUTPUT = $(TOOL_OPENWATCOM_COMPILE_C_OUTPUT)
|
---|
431 | TOOL_Bs3Ow32_COMPILE_C_OUTPUT_MAYBE = $(TOOL_OPENWATCOM_COMPILE_C_OUTPUT_MAYBE) $(obj).original
|
---|
432 | define TOOL_Bs3Ow32_COMPILE_C_CMDS
|
---|
433 | $(TOOL_OPENWATCOM_COMPILE_C_CMDS)
|
---|
434 | $(QUIET)$(VBOX_BS3KIT_KSUBMIT_OBJ_CONV) $(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
|
---|
435 | endef
|
---|
436 |
|
---|
437 | TOOL_Bs3Ow32_C32OBJSUFF = $(TOOL_Bs3Ow32_COBJSUFF)
|
---|
438 | TOOL_Bs3Ow32_C32FLAGS = $(TOOL_Bs3Ow32_CFLAGS)
|
---|
439 | TOOL_Bs3Ow32_C32FLAGS.debug = $(TOOL_Bs3Ow32_CFLAGS.debug)
|
---|
440 | TOOL_Bs3Ow32_C32FLAGS.dbgopt = $(TOOL_Bs3Ow32_CFLAGS.dbgopt)
|
---|
441 | TOOL_Bs3Ow32_C32FLAGS.profile = $(TOOL_Bs3Ow32_CFLAGS.profile)
|
---|
442 | TOOL_Bs3Ow32_C32FLAGS.release = $(TOOL_Bs3Ow32_CFLAGS.release)
|
---|
443 | TOOL_Bs3Ow32_C32INCS = $(TOOL_Bs3Ow32_CINCS)
|
---|
444 | TOOL_Bs3Ow32_C32DEFS =
|
---|
445 | TOOL_Bs3Ow32_COMPILE_C32_DEPEND = $(TOOL_Bs3Ow32_COMPILE_C_DEPEND)
|
---|
446 | TOOL_Bs3Ow32_COMPILE_C32_DEPORD = $(TOOL_Bs3Ow32_COMPILE_C_DEPORD)
|
---|
447 | TOOL_Bs3Ow32_COMPILE_C32_OUTPUT = $(TOOL_Bs3Ow32_COMPILE_C_OUTPUT)
|
---|
448 | TOOL_Bs3Ow32_COMPILE_C32_OUTPUT_MAYBE = $(TOOL_Bs3Ow32_COMPILE_C_OUTPUT_MAYBE)
|
---|
449 | define TOOL_Bs3Ow32_COMPILE_C32_CMDS
|
---|
450 | $(TOOL_Bs3Ow32_COMPILE_C_CMDS)
|
---|
451 | endef
|
---|
452 |
|
---|
453 | TOOL_Bs3Ow32_CXXOBJSUFF = $(TOOL_OPENWATCOM_CXXOBJSUFF)
|
---|
454 | TOOL_Bs3Ow32_CXXFLAGS = $(TOOL_OPENWATCOM_CXXFLAGS) -ad=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(dep)) -adfs
|
---|
455 | TOOL_Bs3Ow32_CXXFLAGS.debug = $(TOOL_OPENWATCOM_CXXFLAGS.debug)
|
---|
456 | TOOL_Bs3Ow32_CXXFLAGS.dbgopt = $(TOOL_OPENWATCOM_CXXFLAGS.dbgopt)
|
---|
457 | TOOL_Bs3Ow32_CXXFLAGS.profile = $(TOOL_OPENWATCOM_CXXFLAGS.profile)
|
---|
458 | TOOL_Bs3Ow32_CXXFLAGS.release = $(TOOL_OPENWATCOM_CXXFLAGS.release)
|
---|
459 | TOOL_Bs3Ow32_CXXINCS = $(TOOL_OPENWATCOM_CXXINCS)
|
---|
460 | TOOL_Bs3Ow32_CXXDEFS =
|
---|
461 | TOOL_Bs3Ow32_COMPILE_CXX_DEPEND = $(TOOL_OPENWATCOM_COMPILE_CXX_DEPEND) $(VBoxBs3ObjConverter_1_TARGET)
|
---|
462 | TOOL_Bs3Ow32_COMPILE_CXX_DEPORD = $(TOOL_OPENWATCOM_COMPILE_CXX_DEPORD)
|
---|
463 | TOOL_Bs3Ow32_COMPILE_CXX_OUTPUT = $(TOOL_OPENWATCOM_COMPILE_CXX_OUTPUT)
|
---|
464 | TOOL_Bs3Ow32_COMPILE_CXX_OUTPUT_MAYBE = $(TOOL_OPENWATCOM_COMPILE_CXX_OUTPUT_MAYBE) $(obj).original
|
---|
465 | define TOOL_Bs3Ow32_COMPILE_CXX_CMDS
|
---|
466 | $(TOOL_OPENWATCOM_COMPILE_CXX_CMDS)
|
---|
467 | $(QUIET)$(VBOX_BS3KIT_KSUBMIT_OBJ_CONV) $(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
|
---|
468 | endef
|
---|
469 |
|
---|
470 |
|
---|
471 | #
|
---|
472 | # 16-bit OpenWatcom C/C++ tool variant that runs the object converter afterwards
|
---|
473 | # to rename intrinsic functions so they don't clash with the 16-bit compiler.
|
---|
474 | #
|
---|
475 | TOOL_Bs3Ow16 := OpenWatcom C/C++ 16-bit with object convertsion
|
---|
476 | TOOL_Bs3Ow16_EXTENDS := OPENWATCOM-16
|
---|
477 | TOOL_Bs3Ow16_CC = $(TOOL_OPENWATCOM-16_CC)
|
---|
478 | TOOL_Bs3Ow16_CXX = $(TOOL_OPENWATCOM-16_CXX)
|
---|
479 | TOOL_Bs3Ow16_COBJSUFF = .o16
|
---|
480 | TOOL_Bs3Ow16_CFLAGS = $(TOOL_OPENWATCOM-16_CFLAGS)
|
---|
481 | TOOL_Bs3Ow16_CFLAGS.debug = $(TOOL_OPENWATCOM-16_CFLAGS.debug)
|
---|
482 | TOOL_Bs3Ow16_CFLAGS.dbgopt = $(TOOL_OPENWATCOM-16_CFLAGS.dbgopt)
|
---|
483 | TOOL_Bs3Ow16_CFLAGS.profile = $(TOOL_OPENWATCOM-16_CFLAGS.profile)
|
---|
484 | TOOL_Bs3Ow16_CFLAGS.release = $(TOOL_OPENWATCOM-16_CFLAGS.release)
|
---|
485 | TOOL_Bs3Ow16_CINCS = $(TOOL_OPENWATCOM-16_CINCS)
|
---|
486 | TOOL_Bs3Ow16_CDEFS =
|
---|
487 | TOOL_Bs3Ow16_COMPILE_C_DEPEND = $(TOOL_OPENWATCOM-16_COMPILE_C_DEPEND) $(VBoxBs3ObjConverter_1_TARGET)
|
---|
488 | TOOL_Bs3Ow16_COMPILE_C_DEPORD = $(TOOL_OPENWATCOM-16_COMPILE_C_DEPORD)
|
---|
489 | TOOL_Bs3Ow16_COMPILE_C_OUTPUT = $(TOOL_OPENWATCOM-16_COMPILE_C_OUTPUT)
|
---|
490 | TOOL_Bs3Ow16_COMPILE_C_OUTPUT_MAYBE = $(TOOL_OPENWATCOM-16_COMPILE_C_OUTPUT_MAYBE) $(obj).original
|
---|
491 | define TOOL_Bs3Ow16_COMPILE_C_CMDS
|
---|
492 | $(TOOL_OPENWATCOM-16_COMPILE_C_CMDS)
|
---|
493 | $(QUIET)$(VBOX_BS3KIT_KSUBMIT_OBJ_CONV) $(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
|
---|
494 | endef
|
---|
495 |
|
---|
496 | TOOL_Bs3Ow16_C16OBJSUFF = $(TOOL_Bs3Ow16_C16OBJSUFF)
|
---|
497 | TOOL_Bs3Ow16_C16FLAGS = $(TOOL_Bs3Ow16_C16FLAGS)
|
---|
498 | TOOL_Bs3Ow16_C16FLAGS.debug = $(TOOL_Bs3Ow16_C16FLAGS.debug)
|
---|
499 | TOOL_Bs3Ow16_C16FLAGS.dbgopt = $(TOOL_Bs3Ow16_C16FLAGS.dbgopt)
|
---|
500 | TOOL_Bs3Ow16_C16FLAGS.profile = $(TOOL_Bs3Ow16_C16FLAGS.profile)
|
---|
501 | TOOL_Bs3Ow16_C16FLAGS.release = $(TOOL_Bs3Ow16_C16FLAGS.release)
|
---|
502 | TOOL_Bs3Ow16_C16INCS = $(TOOL_Bs3Ow16_C16INCS)
|
---|
503 | TOOL_Bs3Ow16_C16DEFS = $(TOOL_Bs3Ow16_C16DEFS)
|
---|
504 | TOOL_Bs3Ow16_COMPILE_C16_DEPEND = $(TOOL_Bs3Ow16_COMPILE_C16_DEPEND)
|
---|
505 | TOOL_Bs3Ow16_COMPILE_C16_DEPORD = $(TOOL_Bs3Ow16_COMPILE_C16_DEPORD)
|
---|
506 | TOOL_Bs3Ow16_COMPILE_C16_OUTPUT = $(TOOL_Bs3Ow16_COMPILE_C16_OUTPUT)
|
---|
507 | TOOL_Bs3Ow16_COMPILE_C16_OUTPUT_MAYBE = $(TOOL_Bs3Ow16_COMPILE_C16_OUTPUT_MAYBE)
|
---|
508 | define TOOL_Bs3Ow16_COMPILE_C16_CMDS
|
---|
509 | $(TOOL_Bs3Ow16_COMPILE_C_CMDS)
|
---|
510 | endef
|
---|
511 |
|
---|
512 | TOOL_Bs3Ow16_CXXOBJSUFF = $(TOOL_OPENWATCOM-16_CXXOBJSUFF)
|
---|
513 | TOOL_Bs3Ow16_CXXFLAGS = $(TOOL_OPENWATCOM-16_CXXFLAGS)
|
---|
514 | TOOL_Bs3Ow16_CXXFLAGS.debug = $(TOOL_OPENWATCOM-16_CXXFLAGS.debug)
|
---|
515 | TOOL_Bs3Ow16_CXXFLAGS.dbgopt = $(TOOL_OPENWATCOM-16_CXXFLAGS.dbgopt)
|
---|
516 | TOOL_Bs3Ow16_CXXFLAGS.profile = $(TOOL_OPENWATCOM-16_CXXFLAGS.profile)
|
---|
517 | TOOL_Bs3Ow16_CXXFLAGS.release = $(TOOL_OPENWATCOM-16_CXXFLAGS.release)
|
---|
518 | TOOL_Bs3Ow16_CXXINCS = $(TOOL_OPENWATCOM-16_CXXINCS)
|
---|
519 | TOOL_Bs3Ow16_CXXDEFS =
|
---|
520 | TOOL_Bs3Ow16_COMPILE_CXX_DEPEND = $(TOOL_OPENWATCOM-16_COMPILE_CXX_DEPEND) $(VBoxBs3ObjConverter_1_TARGET)
|
---|
521 | TOOL_Bs3Ow16_COMPILE_CXX_DEPORD = $(TOOL_OPENWATCOM-16_COMPILE_CXX_DEPORD)
|
---|
522 | TOOL_Bs3Ow16_COMPILE_CXX_OUTPUT = $(TOOL_OPENWATCOM-16_COMPILE_CXX_OUTPUT)
|
---|
523 | TOOL_Bs3Ow16_COMPILE_CXX_OUTPUT_MAYBE = $(TOOL_OPENWATCOM-16_COMPILE_CXX_OUTPUT_MAYBE) $(obj).original
|
---|
524 | define TOOL_Bs3Ow16_COMPILE_CXX_CMDS
|
---|
525 | $(TOOL_OPENWATCOM-16_COMPILE_CXX_CMDS)
|
---|
526 | $(QUIET)$(VBOX_BS3KIT_KSUBMIT_OBJ_CONV) $(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
|
---|
527 | endef
|
---|
528 |
|
---|
529 | TOOL_Bs3Ow16_AR = $(TOOL_OPENWATCOM_AR)
|
---|
530 | TOOL_Bs3Ow16_ARFLAGS = $(TOOL_OPENWATCOM_ARFLAGS) @@replace-me-with-list-option@@
|
---|
531 | TOOL_Bs3Ow16_ARLIBSUFF = $(TOOL_OPENWATCOM_ARLIBSUFF)
|
---|
532 | TOOL_Bs3Ow16_LINK_LIBRARY_OUTPUT = $(outbase)-implib.lib $(outbase)-implib.rsp $(outbase).lst
|
---|
533 | TOOL_Bs3Ow16_LINK_LIBRARY_OUTPUT_MAYBE_PRECIOUS = $(TOOL_OPENWATCOM_LINK_LIBRARY_OUTPUT_MAYBE_PRECIOUS)
|
---|
534 | TOOL_Bs3Ow16_LINK_LIBRARY_OUTPUT_DEPEND = $(TOOL_OPENWATCOM_LINK_LIBRARY_OUTPUT_DEPEND)
|
---|
535 | TOOL_Bs3Ow16_LINK_LIBRARY_OUTPUT_DEPORD = $(TOOL_OPENWATCOM_LINK_LIBRARY_OUTPUT_DEPORD)
|
---|
536 | define TOOL_Bs3Ow16_LINK_LIBRARY_CMDS
|
---|
537 | $(subst @@replace-me-with-list-option@@,-l=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(outbase).lst),$(TOOL_OPENWATCOM_LINK_LIBRARY_CMDS))
|
---|
538 | $(TOOL_Bs3Ow16_AR) -m "$(out)" \
|
---|
539 | | $(SED) \
|
---|
540 | -e '/^ _Bs3[_a-zA-Z0-9]*$$(DOLLAR)/!d' \
|
---|
541 | -e '/_EndProc/d' \
|
---|
542 | -e '/\./d' \
|
---|
543 | -e 's/^ *\(_Bs3[_a-zA-Z0-9]*\)$$(DOLLAR)/++\1.bs3kit/' \
|
---|
544 | --output $(outbase)-implib.rsp
|
---|
545 | $(TOOL_Bs3Ow16_AR) -q -n -io -inn $(call TOOL_OPENWATCOM_FIX_SLASHES,$(outbase)-implib.lib) @$(outbase)-implib.rsp
|
---|
546 | endef
|
---|
547 |
|
---|
548 | # Debug info format depends on what we use for 64-bit.
|
---|
549 | if 1 #1of ($(KBUILD_HOST), win) - wlink dwarf .sym files are useless for binary blobs
|
---|
550 | BS3_OW_DBG_OPT = -hc -d1+
|
---|
551 | #BS3_OW_DBG_OPT = -hd -d1+
|
---|
552 | BS3_OW_DBG_LDOPT = codeview
|
---|
553 | else
|
---|
554 | BS3_OW_DBG_OPT = -hd -d1+
|
---|
555 | BS3_OW_DBG_LDOPT = dwarf
|
---|
556 | endif
|
---|
557 |
|
---|
558 | #
|
---|
559 | # Source handlers for .c16, .c32 and .c64
|
---|
560 | #
|
---|
561 | define VBoxBs3KitImgSrcHandler_16bit_c
|
---|
562 | local type := C
|
---|
563 | $(kb-src-one 2)
|
---|
564 | endef
|
---|
565 |
|
---|
566 | C32TOOL = Bs3Ow32
|
---|
567 | define VBoxBs3KitImgSrcHandler_32bit_c
|
---|
568 | local type := C32
|
---|
569 | $(kb-src-one 2)
|
---|
570 | endef
|
---|
571 |
|
---|
572 | define VBoxBs3KitImgSrcHandler_64bit_c
|
---|
573 | local type := C64
|
---|
574 | $(kb-src-one 2)
|
---|
575 | endef
|
---|
576 |
|
---|
577 | define VBoxBs3KitImgSrcHandler_high_dll
|
---|
578 | local genasm := $($(target)_0_OUTDIR)/high-dll-$(notdir $(basename $(source))).asm
|
---|
579 | $(eval $(target)_CLEAN += $(genasm))
|
---|
580 | $(eval $(target)_GEN_SOURCES_ += $(genasm))
|
---|
581 | $(target)_2_VBOX_BS3KIT_HIGH_DLLS := $($(target)_2_VBOX_BS3KIT_HIGH_DLLS) $(source)
|
---|
582 |
|
---|
583 | $(genasm): $(source) | $(VBoxBs3Linker_1_TARGET) $$(dir $$@)
|
---|
584 | $(VBoxBs3Linker_1_TARGET) --generate-high-dll-import-table "$<" --output "$@"
|
---|
585 | endef
|
---|
586 |
|
---|
587 |
|
---|
588 | #
|
---|
589 | # BS3Kit template for assembly and 16-bit code.
|
---|
590 | #
|
---|
591 | # Note! Using -d1 as -d1+ and -d2 causes suboptimal code to be generated (strlen
|
---|
592 | # reloading string pointer argument all the time).
|
---|
593 | # Update! -d1+ is required for line number information in code living in include
|
---|
594 | # files and any DWARF stuff at all. So, we'll ignore poor code quality.
|
---|
595 | # Note! Optimization options should come after debug stuff as -d2 for instance
|
---|
596 | # disables all optimziations.
|
---|
597 | # Note! We use BS3CLASS16CODE because of wdis code detection heuristics requires the class
|
---|
598 | # of a code segment to be exactly 'CODE', or ending with 'CODE' or 'TEXT' (more
|
---|
599 | # recent wdis have a -c=<clsnm> option, but not the one we currently use ).
|
---|
600 | #
|
---|
601 | #
|
---|
602 | # Compiler options explained:
|
---|
603 | # -nt=xxxx Sets the text segment name.
|
---|
604 | # -nc=xxxx Sets the text segment class name.
|
---|
605 | # -nd=xxxx Sets the data segment name.
|
---|
606 | # -ecc Sets the default calling convension to __cdecl
|
---|
607 | # Update: We don't use this in 16-bit code as it causes unfavorable reloading of DS before calling
|
---|
608 | # inlined functions (e.g. iprt/asm.h). Instead we use -ecw and __cdecl where needed.
|
---|
609 | # Update: With -zdp the DS reloading is gone. Code is slightly larger, but seems to cure stability
|
---|
610 | # issues in bs3CpuBasic2_RaiseXcpt1 (workers ending up with default calling convention).
|
---|
611 | # -ecw Sets the default calling convension to __watcall ()
|
---|
612 | # -q Quiet, no logos or stuff.
|
---|
613 | # -0 Use 8086 instruction set (16-bit only).
|
---|
614 | # -3 Use 386 instruction set (16-bit only).
|
---|
615 | # -e<num> Stop after <num> errors.
|
---|
616 | # -wx Maxium warning level.
|
---|
617 | # -zl Don't emit default library information.
|
---|
618 | # -zdp DS pegged to BS3DATA16_GROUP/DGROUP.
|
---|
619 | # -zu Assume SS != DS.
|
---|
620 | # -mc Compact memory model, far data, small code.
|
---|
621 | # -ml Large memory model, far data, far code.
|
---|
622 | # -mf Flat memory model (32-bit).
|
---|
623 | # -d+ Enabled better /dVAR=XXX parsing, using space as delimiter instead of alpha-numerical/whatever.
|
---|
624 | # -d1 Debug info: Globals and line numbers.
|
---|
625 | # -s No stack overflow checks.
|
---|
626 | # -oa Relaxed aliasing constraints.
|
---|
627 | # -ob Branch prediction.
|
---|
628 | # -of Generate stack frames when needed.
|
---|
629 | # -oi Inline instrinsics functions.
|
---|
630 | # -ol Loop optimizations.
|
---|
631 | # -oh Expensive optimizations. (saves a byte or two)
|
---|
632 | # -or Reorder for best pipeline.
|
---|
633 | # -os Favor size over speed.
|
---|
634 | #
|
---|
635 | TEMPLATE_VBoxBS3KitImg = Template for building BS3Kit test images.
|
---|
636 | TEMPLATE_VBoxBS3KitImg_BLD_TRG = os-agnostic
|
---|
637 | TEMPLATE_VBoxBS3KitImg_BLD_TRG_ARCH = noarch
|
---|
638 | TEMPLATE_VBoxBS3KitImg_INST = $(INST_VALIDATIONKIT)bootsectors/
|
---|
639 | TEMPLATE_VBoxBS3KitImg_BINSUFF = .img
|
---|
640 | TEMPLATE_VBoxBS3KitImg_MODE = 0644
|
---|
641 | TEMPLATE_VBoxBS3KitImg_SRC_HANDLERS = \
|
---|
642 | .c16:VBoxBs3KitImgSrcHandler_16bit_c \
|
---|
643 | .c32:VBoxBs3KitImgSrcHandler_32bit_c \
|
---|
644 | .c64:VBoxBs3KitImgSrcHandler_64bit_c \
|
---|
645 | .high-dll:VBoxBs3KitImgSrcHandler_high_dll
|
---|
646 | TEMPLATE_VBoxBS3KitImg_ASOBJSUFF = .o16
|
---|
647 | TEMPLATE_VBoxBS3KitImg_ASTOOL = VBoxNasm
|
---|
648 | #TEMPLATE_VBoxBS3KitImg_ASFLAGS = -f obj -g $(BS3KIT_NASM_allow_64_bit) -w+orphan-labels
|
---|
649 | TEMPLATE_VBoxBS3KitImg_ASFLAGS = -f obj $(BS3KIT_NASM_allow_64_bit) -w+orphan-labels
|
---|
650 | TEMPLATE_VBoxBS3KitImg_ASDEFS = ASM_FORMAT_OMF RT_NOINC_SEGMENTS __NASM__ ARCH_BITS=16 RT_ARCH_X86 ASM_MODEL_FAR_CODE \
|
---|
651 | BS3CLASS16CODE=$(BS3KIT_CLASS_CODE16) BS3KIT_CLASS_DATA16=$(BS3KIT_CLASS_DATA16) \
|
---|
652 | BS3KIT_GRPNM_DATA16=$(BS3KIT_GRPNM_DATA16) BS3KIT_CLASS_BSS16=$(BS3KIT_CLASS_BSS16)
|
---|
653 | TEMPLATE_VBoxBS3KitImg_DEFS = IN_BS3KIT IPRT_NO_CRT
|
---|
654 | TEMPLATE_VBoxBS3KitImg_DEFS.debug = BS3_STRICT
|
---|
655 |
|
---|
656 | TEMPLATE_VBoxBS3KitImg_ARTOOL = Bs3Ow16
|
---|
657 |
|
---|
658 | TEMPLATE_VBoxBS3KitImg_CTOOL = Bs3Ow16
|
---|
659 | TEMPLATE_VBoxBS3KitImg_CXXTOOL = Bs3Ow16
|
---|
660 | TEMPLATE_VBoxBS3KitImg_CFLAGS = $(if $(BS3KIT_SEGNM_DATA16),-nd=$(BS3KIT_SEGNM_DATA16),) \
|
---|
661 | -nt=BS3TEXT16 -nc=$(BS3KIT_CLASS_CODE16) -ecc -q -0 -e125 -wx -zl -zdp -zu -ml $(BS3_OW_DBG_OPT) -s -oa -ob -of -oi -ol -or -os -oh -d+
|
---|
662 | TEMPLATE_VBoxBS3KitImg_CXXFLAGS = $(if $(BS3KIT_SEGNM_DATA16),-nd=$(BS3KIT_SEGNM_DATA16),) \
|
---|
663 | -nt=BS3TEXT16 -nc=$(BS3KIT_CLASS_CODE16) -ecc -q -0 -e125 -wx -zl -zdp -zu -ml $(BS3_OW_DBG_OPT) -s -oa -ob -of -oi -ol -or -os -oh -d+
|
---|
664 | TEMPLATE_VBoxBS3KitImg_CDEFS = ARCH_BITS=16 RT_ARCH_X86
|
---|
665 |
|
---|
666 | TEMPLATE_VBoxBS3KitImg_TOOL = $(NO_SUCH_VARIABLE)
|
---|
667 | TEMPLATE_VBoxBS3KitImg_C16TOOL = $(TEMPLATE_VBoxBS3KitImg_CTOOL)
|
---|
668 | TEMPLATE_VBoxBS3KitImg_C16FLAGS = $(TEMPLATE_VBoxBS3KitImg_CFLAGS)
|
---|
669 | TEMPLATE_VBoxBS3KitImg_C16DEFS = $(TEMPLATE_VBoxBS3KitImg_CDEFS)
|
---|
670 | TEMPLATE_VBoxBS3KitImg_C32TOOL := Bs3Ow32
|
---|
671 | TEMPLATE_VBoxBS3KitImg_C32FLAGS = $(TEMPLATE_VBoxBS3KitImg32_CFLAGS)
|
---|
672 | TEMPLATE_VBoxBS3KitImg_C32DEFS = ARCH_BITS=32 RT_ARCH_X86
|
---|
673 | TEMPLATE_VBoxBS3KitImg_C64TOOL = $(TEMPLATE_VBoxBS3KitImg64_CTOOL)
|
---|
674 | TEMPLATE_VBoxBS3KitImg_C64FLAGS = $(TEMPLATE_VBoxBS3KitImg64_CFLAGS)
|
---|
675 | TEMPLATE_VBoxBS3KitImg_C64DEFS = ARCH_BITS=64 RT_ARCH_AMD64
|
---|
676 |
|
---|
677 | TEMPLATE_VBoxBS3KitImg_INCS = $(VBOX_PATH_BS3KIT_SRC) .
|
---|
678 | TEMPLATE_VBoxBS3KitImg_LDTOOL = OPENWATCOM-WL
|
---|
679 |
|
---|
680 | # linker options:
|
---|
681 | # system dos: Link a 16-bit DOS binary.
|
---|
682 | # output raw ...: Produce a raw DOS binary for loading at flat address 10000h.
|
---|
683 | # The following is for ordering segments.
|
---|
684 | # option start=_start: The start symbol in bs3-first-xxx.asm.
|
---|
685 | # debug codeview/dwarf all: Full debug information either in codeview or dwarf.
|
---|
686 | # option symfile: Produce a separate symbol file with the debug info.
|
---|
687 | # option map: Produce a map file.
|
---|
688 | # option farcalls: Change intrasegment far calls into 'push cs; seg ds; call symbol' where possible.
|
---|
689 | # option statics: ?
|
---|
690 | # option verbose: Verbose map file?
|
---|
691 | # option disable 1014: Disable warning about 'stack segment not found'.
|
---|
692 | # option disable 1080: Disable warning about '%1 is a 32-bit object file'.
|
---|
693 | #
|
---|
694 | # Note! We're pushing DATA16 to 0x20000 because it's impossible to force wlink
|
---|
695 | # to give us a real-mode + GDT compatible alignment (0ffffff80h), i.e.
|
---|
696 | # real-mode address on the form 0fff8:0000.
|
---|
697 | TEMPLATE_VBoxBS3KitImg_LDFLAGS = system dos \
|
---|
698 | debug $(BS3_OW_DBG_LDOPT) all \
|
---|
699 | option quiet, map, statics, verbose, symfile, start=_start, farcalls \
|
---|
700 | disable 1014, 1080 \
|
---|
701 | \
|
---|
702 | output raw offset=0x10000 \
|
---|
703 | order \
|
---|
704 | clname BS3FLAT segaddr=0x0000 \
|
---|
705 | segment BS3FLAT segaddr=0x0000 \
|
---|
706 | clname $(BS3KIT_CLASS_CODE16) segaddr=0x1000 \
|
---|
707 | segment BS3TEXT16 \
|
---|
708 | segment BS3TEXT16_NEARSTUBS \
|
---|
709 | segment BS3TEXT16_FARSTUBS \
|
---|
710 | segment BS3TEXT16_END \
|
---|
711 | clname BS3SYSTEM16 segaddr=0x2000 \
|
---|
712 | segment BS3SYSTEM16 \
|
---|
713 | $(if-expr "$(BS3KIT_SEGNM_DATA16)" == "", \
|
---|
714 | clname DATA \
|
---|
715 | segment BS3DATA16 segaddr=0x2900 \
|
---|
716 | segment BS3DATA16_DATA \
|
---|
717 | segment DATA \
|
---|
718 | segment _DATA \
|
---|
719 | segment BS3DATA16CONST \
|
---|
720 | segment CONST \
|
---|
721 | segment BS3DATA16CONST2 \
|
---|
722 | segment CONST2 \
|
---|
723 | segment STRINGS \
|
---|
724 | segment BS3DATA16_END \
|
---|
725 | clname BSS \
|
---|
726 | segment BSS \
|
---|
727 | segment _BSS \
|
---|
728 | segment BS3DATA16_END \
|
---|
729 | clname FAR_DATA \
|
---|
730 | segment FAR_DATA \
|
---|
731 | , \
|
---|
732 | clname FAR_DATA \
|
---|
733 | segment BS3DATA16 segaddr=0x2900 \
|
---|
734 | segment FAR_DATA \
|
---|
735 | segment BS3DATA16CONST \
|
---|
736 | segment BS3DATA16CONST2 \
|
---|
737 | segment BS3DATA16_DATA \
|
---|
738 | segment BS3DATA16_END \
|
---|
739 | ) \
|
---|
740 | segment BS3DATA32 \
|
---|
741 | segment BS3DATA32CONST \
|
---|
742 | segment BS3DATA32CONST2 \
|
---|
743 | segment BS3DATA32_DATA \
|
---|
744 | segment BS3DATA32_BSS \
|
---|
745 | segment BS3DATA32_END \
|
---|
746 | \
|
---|
747 | segment BS3DATA64 \
|
---|
748 | segment BS3DATA64CONST \
|
---|
749 | segment BS3DATA64_BSS \
|
---|
750 | segment BS3DATA64_END \
|
---|
751 | clname BS3CLASS16RMCODE \
|
---|
752 | segment BS3RMTEXT16_START \
|
---|
753 | segment BS3RMTEXT16 \
|
---|
754 | segment BS3RMTEXT16_END \
|
---|
755 | clname BS3CLASS16X0CODE \
|
---|
756 | segment BS3X0TEXT16_START \
|
---|
757 | segment BS3X0TEXT16 \
|
---|
758 | segment BS3X0TEXT16_END \
|
---|
759 | clname BS3CLASS16X1CODE \
|
---|
760 | segment BS3X1TEXT16_START \
|
---|
761 | segment BS3X1TEXT16 \
|
---|
762 | segment BS3X1TEXT16_END \
|
---|
763 | clname BS3CLASSSEPARATE16AND32BITCODE \
|
---|
764 | segment BS3SEPARATE16AND32BITCODE \
|
---|
765 | clname BS3CLASS32CODE \
|
---|
766 | segment BS3TEXT32_START \
|
---|
767 | segment BS3TEXT32 \
|
---|
768 | segment BS3TEXT32_END \
|
---|
769 | clname BS3CLASSSEPARATE32AND64BITCODE \
|
---|
770 | segment BS3SEPARATE32AND64BITCODE \
|
---|
771 | clname BS3CLASS64CODE \
|
---|
772 | segment BS3TEXT64_START \
|
---|
773 | segment BS3TEXT64 \
|
---|
774 | segment BS3TEXT64_END \
|
---|
775 | clname BS3HIGHDLLCLASS \
|
---|
776 | segment BS3HIGHDLLEXPORTS \
|
---|
777 | segment BS3HIGHDLLIMPORTS \
|
---|
778 | segment BS3HIGHDLLSTRINGS \
|
---|
779 | segment BS3HIGHDLLTABLE \
|
---|
780 | segment BS3HIGHDLLTABLE_END
|
---|
781 |
|
---|
782 | TEMPLATE_VBoxBS3KitImg_LNK_DEPS = \
|
---|
783 | $(bs3-bootsector_1_TARGET) \
|
---|
784 | $(VBoxBs3Linker_1_TARGET)
|
---|
785 | TEMPLATE_VBoxBS3KitImg_POST_CMDS = $(if $(eq $(tool_do),LINK_LIBRARY) \
|
---|
786 | ,,$(QUIET)$(MV_EXT) -f -- "$(out)" "$(out).tmp" \
|
---|
787 | $$(NLTAB)$(QUIET)$(VBoxBs3Linker_1_TARGET) -o $(out) $(bs3-bootsector_1_TARGET) $(out).tmp $($(target)_2_VBOX_BS3KIT_HIGH_DLLS) \
|
---|
788 | $$(NLTAB)$(QUIET)$(RM_EXT) -f -- "$(out).tmp") \
|
---|
789 | $(eval .PRECIOUS: $(outbase).map) # ugly hack!
|
---|
790 |
|
---|
791 | TEMPLATE_VBoxBS3KitImg_LIBS = \
|
---|
792 | $(PATH_OBJ)/bs3kit-common-16/bs3kit-common-16.lib \
|
---|
793 | $(PATH_OBJ)/bs3kit-common-32/bs3kit-common-32.lib \
|
---|
794 | $(PATH_OBJ)/bs3kit-common-64/bs3kit-common-64.lib \
|
---|
795 | \
|
---|
796 | $(PATH_OBJ)/bs3kit-rm/bs3kit-rm.lib \
|
---|
797 | $(PATH_OBJ)/bs3kit-pe16/bs3kit-pe16.lib \
|
---|
798 | $(PATH_OBJ)/bs3kit-pe16_32/bs3kit-pe16_32.lib \
|
---|
799 | $(PATH_OBJ)/bs3kit-pe16_v86/bs3kit-pe16_v86.lib \
|
---|
800 | $(PATH_OBJ)/bs3kit-pe32/bs3kit-pe32.lib \
|
---|
801 | $(PATH_OBJ)/bs3kit-pe32_16/bs3kit-pe32_16.lib \
|
---|
802 | $(PATH_OBJ)/bs3kit-pev86/bs3kit-pev86.lib \
|
---|
803 | $(PATH_OBJ)/bs3kit-pp16/bs3kit-pp16.lib \
|
---|
804 | $(PATH_OBJ)/bs3kit-pp16_32/bs3kit-pp16_32.lib \
|
---|
805 | $(PATH_OBJ)/bs3kit-pp16_v86/bs3kit-pp16_v86.lib \
|
---|
806 | $(PATH_OBJ)/bs3kit-pp32/bs3kit-pp32.lib \
|
---|
807 | $(PATH_OBJ)/bs3kit-pp32_16/bs3kit-pp32_16.lib \
|
---|
808 | $(PATH_OBJ)/bs3kit-ppv86/bs3kit-ppv86.lib \
|
---|
809 | $(PATH_OBJ)/bs3kit-pae16/bs3kit-pae16.lib \
|
---|
810 | $(PATH_OBJ)/bs3kit-pae16_32/bs3kit-pae16_32.lib \
|
---|
811 | $(PATH_OBJ)/bs3kit-pae16_v86/bs3kit-pae16_v86.lib \
|
---|
812 | $(PATH_OBJ)/bs3kit-pae32/bs3kit-pae32.lib \
|
---|
813 | $(PATH_OBJ)/bs3kit-pae32_16/bs3kit-pae32_16.lib \
|
---|
814 | $(PATH_OBJ)/bs3kit-paev86/bs3kit-paev86.lib \
|
---|
815 | $(PATH_OBJ)/bs3kit-lm16/bs3kit-lm16.lib \
|
---|
816 | $(PATH_OBJ)/bs3kit-lm32/bs3kit-lm32.lib \
|
---|
817 | $(PATH_OBJ)/bs3kit-lm64/bs3kit-lm64.lib
|
---|
818 |
|
---|
819 | # Variant of VBoxBS3KitImg that's for images needing large 32-bit and 64-bit
|
---|
820 | # code segments.
|
---|
821 | TEMPLATE_VBoxBS3KitImgBig = Template for building BS3Kit test images with high 32-bit & 64-bit code
|
---|
822 | TEMPLATE_VBoxBS3KitImgBig_EXTENDS = VBoxBS3KitImg
|
---|
823 | TEMPLATE_VBoxBS3KitImgBig_DEFS = $(TEMPLATE_VBoxBS3KitImg_DEFS) BS3_BIG_IMAGE BS3_TEXT32_ABOVE_1M BS3_TEXT64_ABOVE_1M
|
---|
824 | #TEMPLATE_VBoxBS3KitImgBig_LDFLAGS = \
|
---|
825 | # $(subst BS3CLASS32CODE, BS3CLASS32CODE segaddr=0xa000$(SP), $(TEMPLATE_VBoxBS3KitImg_LDFLAGS))
|
---|
826 | #TEMPLATE_VBoxBS3KitImgBig_POST_CMDS = $(NO_SUCH_VARIABLE)
|
---|
827 |
|
---|
828 | TEMPLATE_VBoxBS3KitImgBig_LNK_DEPS = \
|
---|
829 | $(bs3-bootsector-63MB_1_TARGET) \
|
---|
830 | $(VBoxBs3Linker_1_TARGET)
|
---|
831 | TEMPLATE_VBoxBS3KitImgBig_POST_CMDS = $(if $(eq $(tool_do),LINK_LIBRARY) \
|
---|
832 | ,,$(QUIET)$(MV_EXT) -f -- "$(out)" "$(out).tmp" \
|
---|
833 | $$(NLTAB)$(QUIET)$(VBoxBs3Linker_1_TARGET) -o $(out) $(bs3-bootsector-63MB_1_TARGET) $(out).tmp $($(target)_2_VBOX_BS3KIT_HIGH_DLLS) \
|
---|
834 | $$(NLTAB)$(QUIET)$(RM_EXT) -f -- "$(out).tmp") \
|
---|
835 | $(eval .PRECIOUS: $(outbase).map) # ugly hack!
|
---|
836 |
|
---|
837 |
|
---|
838 | # BS3Kit template for a high image.
|
---|
839 | TEMPLATE_VBoxBS3KitHighImg = Template for building BS3Kit test images, the high DLL.
|
---|
840 | TEMPLATE_VBoxBS3KitHighImg_EXTENDS := VBoxBS3KitImg
|
---|
841 | TEMPLATE_VBoxBS3KitHighImg_INSTTYPE := none
|
---|
842 | TEMPLATE_VBoxBS3KitHighImg_DEFS = $(TEMPLATE_VBoxBS3KitImg_DEFS) BS3_IS_HIGH_IMAGE
|
---|
843 | TEMPLATE_VBoxBS3KitHighImg_ASFLAGS = $(filter-out -g,$(TEMPLATE_VBoxBS3KitImg_ASFLAGS)) # trouble with bs3-cpu-basic-3, nasm produce garbage comment/something.
|
---|
844 | TEMPLATE_VBoxBS3KitHighImg_BINSUFF := .high-dll
|
---|
845 | TEMPLATE_VBoxBS3KitHighImg_LDTOOL := OPENWATCOM-WL
|
---|
846 | TEMPLATE_VBoxBS3KitHighImg_LDFLAGS := system os2v2 flat dll \
|
---|
847 | \
|
---|
848 | segment BS3TEXT16 executeread \
|
---|
849 | segment BS3TEXT16_NEARSTUBS executeread \
|
---|
850 | segment BS3TEXT16_FARSTUBS executeread \
|
---|
851 | segment BS3TEXT16_END executeread \
|
---|
852 | \
|
---|
853 | $(if-expr "$(BS3KIT_SEGNM_DATA16)" == "", \
|
---|
854 | segment BS3DATA16 readwrite \
|
---|
855 | segment BS3DATA16_DATA readwrite \
|
---|
856 | segment DATA readwrite \
|
---|
857 | segment _DATA readwrite \
|
---|
858 | segment BS3DATA16CONST readwrite \
|
---|
859 | segment CONST readwrite \
|
---|
860 | segment BS3DATA16CONST2 readwrite \
|
---|
861 | segment CONST2 readwrite \
|
---|
862 | segment STRINGS readwrite \
|
---|
863 | segment BSS readwrite \
|
---|
864 | segment _BSS readwrite \
|
---|
865 | segment BS3DATA16_END readwrite \
|
---|
866 | , \
|
---|
867 | segment BS3DATA16 readwrite \
|
---|
868 | segment BS3DATA16CONST readwrite \
|
---|
869 | segment BS3DATA16CONST2 readwrite \
|
---|
870 | segment BS3DATA16_DATA readwrite \
|
---|
871 | segment BS3DATA16_END readwrite \
|
---|
872 | ) \
|
---|
873 | \
|
---|
874 | segment BS3TEXT32 executeonly \
|
---|
875 | segment BS3TEXT32_END executeonly \
|
---|
876 | \
|
---|
877 | segment BS3DATA32 readwrite \
|
---|
878 | segment BS3DATA32CONST readwrite \
|
---|
879 | segment BS3DATA32CONST2 readwrite \
|
---|
880 | segment BS3DATA32_DATA readwrite \
|
---|
881 | segment BS3DATA32_BSS readwrite \
|
---|
882 | segment BS3DATA32_END readwrite \
|
---|
883 | \
|
---|
884 | segment BS3TEXT64 executeread \
|
---|
885 | segment BS3TEXT64_END executeread \
|
---|
886 | \
|
---|
887 | segment BS3DATA64 readwrite \
|
---|
888 | segment BS3DATA64CONST readwrite \
|
---|
889 | segment BS3DATA64_BSS readwrite \
|
---|
890 | segment BS3DATA64_END readwrite \
|
---|
891 | \
|
---|
892 | debug $(BS3_OW_DBG_LDOPT) all \
|
---|
893 | \
|
---|
894 | option quiet, map, statics, verbose, symfile, objalign=4096, offset=0x800000 \
|
---|
895 | disable 1014, 1080
|
---|
896 |
|
---|
897 | TEMPLATE_VBoxBS3KitHighImg_LIBS = \
|
---|
898 | $(PATH_OBJ)/bs3kit-common-16/bs3kit-common-16-implib.lib \
|
---|
899 | $(PATH_OBJ)/bs3kit-common-32/bs3kit-common-32-implib.lib \
|
---|
900 | $(PATH_OBJ)/bs3kit-common-64/bs3kit-common-64-implib.lib \
|
---|
901 | \
|
---|
902 | $(PATH_OBJ)/bs3kit-pe16/bs3kit-pe16-implib.lib \
|
---|
903 | $(PATH_OBJ)/bs3kit-pe16_32/bs3kit-pe16_32-implib.lib \
|
---|
904 | $(PATH_OBJ)/bs3kit-pe32/bs3kit-pe32-implib.lib \
|
---|
905 | $(PATH_OBJ)/bs3kit-pe32_16/bs3kit-pe32_16-implib.lib \
|
---|
906 | $(PATH_OBJ)/bs3kit-pev86/bs3kit-pev86-implib.lib \
|
---|
907 | $(PATH_OBJ)/bs3kit-pp16/bs3kit-pp16-implib.lib \
|
---|
908 | $(PATH_OBJ)/bs3kit-pp16_32/bs3kit-pp16_32-implib.lib \
|
---|
909 | $(PATH_OBJ)/bs3kit-pp32/bs3kit-pp32-implib.lib \
|
---|
910 | $(PATH_OBJ)/bs3kit-pp32_16/bs3kit-pp32_16-implib.lib \
|
---|
911 | $(PATH_OBJ)/bs3kit-pae16/bs3kit-pae16-implib.lib \
|
---|
912 | $(PATH_OBJ)/bs3kit-pae16_32/bs3kit-pae16_32-implib.lib \
|
---|
913 | $(PATH_OBJ)/bs3kit-pae32/bs3kit-pae32-implib.lib \
|
---|
914 | $(PATH_OBJ)/bs3kit-pae32_16/bs3kit-pae32_16-implib.lib \
|
---|
915 | $(PATH_OBJ)/bs3kit-lm16/bs3kit-lm16-implib.lib \
|
---|
916 | $(PATH_OBJ)/bs3kit-lm32/bs3kit-lm32-implib.lib \
|
---|
917 | $(PATH_OBJ)/bs3kit-lm64/bs3kit-lm64-implib.lib
|
---|
918 |
|
---|
919 | TEMPLATE_VBoxBS3KitHighImg_POST_CMDS = $(NO_SUCH_VARIABLE)
|
---|
920 |
|
---|
921 | # BS3Kit template for 32-bit code.
|
---|
922 | TEMPLATE_VBoxBS3KitImg32 = Template for building BS3Kit test images.
|
---|
923 | TEMPLATE_VBoxBS3KitImg32_BLD_TRG = os-agnostic
|
---|
924 | TEMPLATE_VBoxBS3KitImg32_BLD_TRG_ARCH = x86
|
---|
925 | TEMPLATE_VBoxBS3KitImg32_INSTTYPE = none
|
---|
926 | TEMPLATE_VBoxBS3KitImg32_ASTOOL = VBoxNasm
|
---|
927 | TEMPLATE_VBoxBS3KitImg32_ASOBJSUFF = .o32
|
---|
928 | TEMPLATE_VBoxBS3KitImg32_ASFLAGS = -f obj -g $(BS3KIT_NASM_allow_64_bit) -w+orphan-labels
|
---|
929 | TEMPLATE_VBoxBS3KitImg32_ASDEFS = ASM_FORMAT_OMF RT_NOINC_SEGMENTS __NASM__ \
|
---|
930 | BS3CLASS16CODE=$(BS3KIT_CLASS_CODE16) BS3KIT_CLASS_DATA16=$(BS3KIT_CLASS_DATA16) \
|
---|
931 | BS3KIT_GRPNM_DATA16=$(BS3KIT_GRPNM_DATA16) BS3KIT_CLASS_BSS16=$(BS3KIT_CLASS_BSS16)
|
---|
932 | TEMPLATE_VBoxBS3KitImg32_DEFS = ARCH_BITS=32 IN_BS3KIT IPRT_NO_CRT
|
---|
933 | TEMPLATE_VBoxBS3KitImg32_DEFS.debug = BS3_STRICT
|
---|
934 | TEMPLATE_VBoxBS3KitImg32_ARTOOL = Bs3Ow16
|
---|
935 | TEMPLATE_VBoxBS3KitImg32_CTOOL = Bs3Ow32
|
---|
936 | TEMPLATE_VBoxBS3KitImg32_CXXTOOL = Bs3Ow32
|
---|
937 | TEMPLATE_VBoxBS3KitImg32_CFLAGS = \
|
---|
938 | -nt=BS3TEXT32 -nd=BS3DATA32 -nc=BS3CLASS32CODE -ecc -q -e125 -wx -zl -mf $(BS3_OW_DBG_OPT) -s -oa -ob -of -oi -ol -or -os -d+
|
---|
939 | TEMPLATE_VBoxBS3KitImg32_CXXFLAGS = \
|
---|
940 | -nt=BS3TEXT32 -nd=BS3DATA32 -nc=BS3CLASS32CODE -ecc -q -e125 -wx -zl -mf $(BS3_OW_DBG_OPT) -s -oa -ob -of -oi -ol -or -os -d+
|
---|
941 | TEMPLATE_VBoxBS3KitImg32_INCS = $(VBOX_PATH_BS3KIT_SRC) .
|
---|
942 | TEMPLATE_VBoxBS3KitImg32_LDTOOL = VBoxBsUnusedLd
|
---|
943 |
|
---|
944 | # BS3Kit template for 64-bit code.
|
---|
945 | TEMPLATE_VBoxBS3KitImg64 = Template for building BS3Kit test images.
|
---|
946 | TEMPLATE_VBoxBS3KitImg64_BLD_TRG = os-agnostic
|
---|
947 | TEMPLATE_VBoxBS3KitImg64_BLD_TRG_ARCH = amd64
|
---|
948 | TEMPLATE_VBoxBS3KitImg64_INSTTYPE = none
|
---|
949 | TEMPLATE_VBoxBS3KitImg64_ASTOOL = VBoxNasm
|
---|
950 | TEMPLATE_VBoxBS3KitImg64_ASOBJSUFF = .o64
|
---|
951 | TEMPLATE_VBoxBS3KitImg64_ASFLAGS = -f obj -g $(BS3KIT_NASM_allow_64_bit) -w+orphan-labels
|
---|
952 | TEMPLATE_VBoxBS3KitImg64_ASDEFS = ASM_FORMAT_OMF ASM_CALL64_MSC RT_NOINC_SEGMENTS __NASM__ \
|
---|
953 | BS3CLASS16CODE=$(BS3KIT_CLASS_CODE16) BS3KIT_CLASS_DATA16=$(BS3KIT_CLASS_DATA16) \
|
---|
954 | BS3KIT_GRPNM_DATA16=$(BS3KIT_GRPNM_DATA16) BS3KIT_CLASS_BSS16=$(BS3KIT_CLASS_BSS16)
|
---|
955 | TEMPLATE_VBoxBS3KitImg64_DEFS = IN_BS3KIT ARCH_BITS=64 IPRT_NO_CRT
|
---|
956 | TEMPLATE_VBoxBS3KitImg64_DEFS.debug = BS3_STRICT
|
---|
957 | TEMPLATE_VBoxBS3KitImg64_ARTOOL = Bs3Ow16
|
---|
958 | TEMPLATE_VBoxBS3KitImg64_INCS = $(VBOX_PATH_BS3KIT_SRC) .
|
---|
959 | if1of ($(KBUILD_HOST), win)
|
---|
960 | ifndef TOOL_VCC100AMD64 # For win.x86 builds.
|
---|
961 | include $(KBUILD_PATH)/tools/$(VBOX_VCC_TOOL_STEM)AMD64.kmk
|
---|
962 | endif
|
---|
963 | TEMPLATE_VBoxBS3KitImg64_CTOOL := Bs3Vcc64
|
---|
964 | TEMPLATE_VBoxBS3KitImg64_CXXTOOL := Bs3Vcc64
|
---|
965 | TEMPLATE_VBoxBS3KitImg64_CFLAGS = -Z7 -O1 -Oi -GF -GS- -Gy- -Gs65536
|
---|
966 | TEMPLATE_VBoxBS3KitImg64_CXXFLAGS = -Z7 -O1 -Oi -GF -GS- -Gy- -Gs65536
|
---|
967 | else
|
---|
968 | TEMPLATE_VBoxBS3KitImg64_CTOOL := Bs3Gcc64Elf64
|
---|
969 | TEMPLATE_VBoxBS3KitImg64_CXXTOOL := Bs3Gcc64Elf64
|
---|
970 | # Note! -mx32 would be exactly what we needed here, however it causes internal compiler errors with 4.8.4 on gentoo.
|
---|
971 | TEMPLATE_VBoxBS3KitImg64_CFLAGS = -m64 -maccumulate-outgoing-args -g -Os -fno-omit-frame-pointer $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_WARN_PEDANTIC_C) \
|
---|
972 | -msoft-float -fno-exceptions -mno-sse -mno-mmx -mno-sse2 -mno-3dnow $(VBOX_GCC_fno-stack-protector)
|
---|
973 | TEMPLATE_VBoxBS3KitImg64_CXXFLAGS = -m64 -maccumulate-outgoing-args -g -Os -fno-omit-frame-pointer $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_WARN_PEDANTIC_CXX) \
|
---|
974 | -msoft-float -fno-exceptions -mno-sse -mno-mmx -mno-sse2 -mno-3dnow $(VBOX_GCC_fno-stack-protector)
|
---|
975 | endif
|
---|
976 | TEMPLATE_VBoxBS3KitImg64_LDTOOL = VBoxBsUnusedLd
|
---|
977 |
|
---|
978 | # BS3Kit template for the bootsector.
|
---|
979 | TEMPLATE_VBoxBS3KitBS = Template for building BS3Kit test images.
|
---|
980 | TEMPLATE_VBoxBS3KitBS_BLD_TRG = os-agnostic
|
---|
981 | TEMPLATE_VBoxBS3KitBS_BLD_TRG_ARCH = x86
|
---|
982 | TEMPLATE_VBoxBS3KitBS_INST = $(INST_VALIDATIONKIT)bootsectors/
|
---|
983 | TEMPLATE_VBoxBS3KitBS_INSTTYPE = none
|
---|
984 | TEMPLATE_VBoxBS3KitBS_BINSUFF = .img
|
---|
985 | TEMPLATE_VBoxBS3KitBS_MODE = 0644
|
---|
986 | TEMPLATE_VBoxBS3KitBS_ASTOOL = YASM
|
---|
987 | TEMPLATE_VBoxBS3KitBS_ASFLAGS = -f bin --mapfile
|
---|
988 | TEMPLATE_VBoxBS3KitBS_ASDEFS = ASM_FORMAT_BIN RT_NOINC_SEGMENTS ARCH_BITS=16 __YASM__ \
|
---|
989 | BS3CLASS16CODE=$(BS3KIT_CLASS_CODE16) BS3KIT_CLASS_DATA16=$(BS3KIT_CLASS_DATA16) \
|
---|
990 | BS3KIT_GRPNM_DATA16=$(BS3KIT_GRPNM_DATA16) BS3KIT_CLASS_BSS16=$(BS3KIT_CLASS_BSS16)
|
---|
991 | TEMPLATE_VBoxBS3KitBS_INCS = $(VBOX_PATH_BS3KIT_SRC) .
|
---|
992 | TEMPLATE_VBoxBS3KitBS_LDTOOL = VBoxBsCpLd
|
---|
993 |
|
---|
994 |
|
---|
995 |
|
---|
996 | #
|
---|
997 | # Extends VBoxBS3KitImg
|
---|
998 | # User must starts SOURCES with: $(VBOX_PATH_BS3KIT_SRC)/bs3-first-dosexe.asm
|
---|
999 | ## disable 1014, 1080, 1150
|
---|
1000 | #
|
---|
1001 | TEMPLATE_VBoxBS3KitUtil = Utility using bs3kit code.
|
---|
1002 | TEMPLATE_VBoxBS3KitUtil_EXTENDS = VBoxBS3KitImg
|
---|
1003 | TEMPLATE_VBoxBS3KitUtil_BINSUFF = .exe
|
---|
1004 | TEMPLATE_VBoxBS3KitUtil_DEFS = $(TEMPLATE_VBoxBS3KitImg_DEFS) BS3_IS_DOS_EXE
|
---|
1005 | TEMPLATE_VBoxBS3KitUtil_CFLAGS = $(filter-out -zl,$(TEMPLATE_VBoxBS3KitImg_CFLAGS))
|
---|
1006 | TEMPLATE_VBoxBS3KitUtil_CXXFLAGS = $(filter-out -zl,$(TEMPLATE_VBoxBS3KitImg_CXXFLAGS))
|
---|
1007 | TEMPLATE_VBoxBS3KitUtil_LDFLAGS = system dos \
|
---|
1008 | debug $(BS3_OW_DBG_LDOPT) all \
|
---|
1009 | option quiet, map, statics, verbose, symfile \
|
---|
1010 | disable 1080 \
|
---|
1011 | order \
|
---|
1012 | clname $(BS3KIT_CLASS_CODE16) \
|
---|
1013 | segment BEGTEXT \
|
---|
1014 | segment BS3TEXT16 \
|
---|
1015 | segment _TEXT \
|
---|
1016 | segment BS3TEXT16_NEARSTUBS \
|
---|
1017 | segment BS3TEXT16_FARSTUBS \
|
---|
1018 | segment BS3TEXT16_END \
|
---|
1019 | clname BS3SYSTEM16 \
|
---|
1020 | segment BS3SYSTEM16 \
|
---|
1021 | \
|
---|
1022 | clname BEGDATA \
|
---|
1023 | segment _NULL \
|
---|
1024 | segment _AFTERNULL \
|
---|
1025 | clname DATA \
|
---|
1026 | $(if-expr "$(BS3KIT_SEGNM_DATA16)" == "", \
|
---|
1027 | segment BS3DATA16 \
|
---|
1028 | segment BS3DATA16CONST \
|
---|
1029 | segment CONST \
|
---|
1030 | segment BS3DATA16CONST2 \
|
---|
1031 | segment CONST2 \
|
---|
1032 | , \
|
---|
1033 | segment CONST \
|
---|
1034 | segment CONST2 \
|
---|
1035 | ) \
|
---|
1036 | segment _DATA \
|
---|
1037 | segment XIB \
|
---|
1038 | segment XI \
|
---|
1039 | segment XIE \
|
---|
1040 | segment YIB \
|
---|
1041 | segment YI \
|
---|
1042 | segment YIE \
|
---|
1043 | segment STRINGS \
|
---|
1044 | $(if-expr "$(BS3KIT_SEGNM_DATA16)" == "", \
|
---|
1045 | segment BS3DATA16_DATA \
|
---|
1046 | ,) \
|
---|
1047 | segment DATA \
|
---|
1048 | clname BSS \
|
---|
1049 | segment _BSS \
|
---|
1050 | segment BSS \
|
---|
1051 | segment BS3DATA16_END \
|
---|
1052 | clname STACK \
|
---|
1053 | segment STACK \
|
---|
1054 | \
|
---|
1055 | clname FAR_DATA \
|
---|
1056 | $(if-expr "$(BS3KIT_SEGNM_DATA16)" != "", \
|
---|
1057 | segment BS3DATA16 \
|
---|
1058 | segment BS3DATA16_DATA \
|
---|
1059 | segment BS3DATA16CONST \
|
---|
1060 | segment BS3DATA16CONST2 \
|
---|
1061 | segment FAR_DATA \
|
---|
1062 | segment BS3DATA16_END \
|
---|
1063 | , \
|
---|
1064 | segment FAR_DATA \
|
---|
1065 | ) \
|
---|
1066 | segment BS3DATA32 \
|
---|
1067 | segment BS3DATA32CONST \
|
---|
1068 | segment BS3DATA32CONST2 \
|
---|
1069 | segment BS3DATA32_DATA \
|
---|
1070 | segment BS3DATA32_BSS \
|
---|
1071 | segment BS3DATA32_END \
|
---|
1072 | \
|
---|
1073 | segment BS3DATA64 \
|
---|
1074 | segment BS3DATA64CONST \
|
---|
1075 | segment BS3DATA64_BSS \
|
---|
1076 | segment BS3DATA64_END \
|
---|
1077 | clname BS3CLASS16RMCODE \
|
---|
1078 | segment BS3RMTEXT16_START \
|
---|
1079 | segment BS3RMTEXT16 \
|
---|
1080 | segment BS3RMTEXT16_END \
|
---|
1081 | clname BS3CLASS16X0CODE \
|
---|
1082 | segment BS3X0TEXT16_START \
|
---|
1083 | segment BS3X0TEXT16 \
|
---|
1084 | segment BS3X0TEXT16_END \
|
---|
1085 | clname BS3CLASS16X1CODE \
|
---|
1086 | segment BS3X1TEXT16_START \
|
---|
1087 | segment BS3X1TEXT16 \
|
---|
1088 | segment BS3X1TEXT16_END \
|
---|
1089 | clname BS3CLASSSEPARATE16AND32BITCODE \
|
---|
1090 | segment BS3SEPARATE16AND32BITCODE \
|
---|
1091 | clname BS3CLASS32CODE \
|
---|
1092 | segment BS3TEXT32 \
|
---|
1093 | segment BS3TEXT32_END \
|
---|
1094 | clname BS3CLASSSEPARATE32AND64BITCODE \
|
---|
1095 | segment BS3SEPARATE32AND64BITCODE \
|
---|
1096 | clname BS3CLASS64CODE \
|
---|
1097 | segment BS3TEXT64 \
|
---|
1098 | segment BS3TEXT64_END
|
---|
1099 | # clname BS3FLAT segaddr=0x0000 \
|
---|
1100 | # segment BS3FLAT segaddr=0x0000
|
---|
1101 |
|
---|
1102 | TEMPLATE_VBoxBS3KitUtil_LNK_DEPS = $(NO_SUCH_VARIABLE)
|
---|
1103 | TEMPLATE_VBoxBS3KitUtil_POST_CMDS = $(NO_SUCH_VARIABLE)
|
---|
1104 |
|
---|