VirtualBox

source: vbox/trunk/src/VBox/ValidationKit/bootsectors/Config.kmk@ 59894

Last change on this file since 59894 was 59863, checked in by vboxsync, 9 years ago

bs3kit: Updates.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 23.4 KB
Line 
1# $Id: Config.kmk 59863 2016-02-26 20:59:52Z vboxsync $
2## @file
3# kBuild Configuration file for VirtualBox Boot Sector Kit 3.
4#
5
6#
7# Copyright (C) 2010-2016 Oracle Corporation
8#
9# This file is part of VirtualBox Open Source Edition (OSE), as
10# available from http://www.virtualbox.org. This file is free software;
11# you can redistribute it and/or modify it under the terms of the GNU
12# General Public License (GPL) as published by the Free Software
13# Foundation, in version 2 as it comes in the "COPYING" file of the
14# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16#
17# The contents of this file may alternatively be used under the terms
18# of the Common Development and Distribution License Version 1.0
19# (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20# VirtualBox OSE distribution, in which case the provisions of the
21# CDDL are applicable instead of those of the GPL.
22#
23# You may elect to license modified versions of this file under the
24# terms and conditions of either the GPL or the CDDL or both.
25#
26
27VBOX_BOOTSECTORS_CONFIG_KMK_INCLUDED = 1
28
29# Include the parent configure file.
30ifndef VBOX_VALIDATIONKIT_CONFIG_KMK_INCLUDED
31 include $(PATH_ROOT)/src/VBox/ValidationKit/Config.kmk
32endif
33
34# The bs3kit source directory.
35VBOX_PATH_BS3KIT_SRC = $(VBOX_PATH_VALIDATIONKIT_SRC)/bootsectors/bs3kit
36
37# Dummy CP "linker" tool.
38TOOL_VBoxBsCpLd = Dummy copy linker.
39TOOL_VBoxBsCpLd_LINK_MISCBIN_OUTPUT =
40TOOL_VBoxBsCpLd_LINK_MISCBIN_DEPEND =
41TOOL_VBoxBsCpLd_LINK_MISCBIN_DEPORD =
42define TOOL_VBoxBsCpLd_LINK_MISCBIN_CMDS
43 $(CP) -- $(objs) $(othersrc) "$(out)"
44endef
45
46# Dummy exit 1 "linker" tool.
47TOOL_VBoxBsUnusedLd = Dummy unused linker.
48TOOL_VBoxBsUnusedLd_LINK_MISCBIN_OUTPUT =
49TOOL_VBoxBsUnusedLd_LINK_MISCBIN_DEPEND =
50TOOL_VBoxBsUnusedLd_LINK_MISCBIN_DEPORD =
51define TOOL_VBoxBsUnusedLd_LINK_MISCBIN_CMDS
52 echo "cannot use this template for linking"
53 exit 1
54endef
55
56# NASM tool with dependency workarounds (change dir to force consistent results; add -MP).
57# Requires http://permalink.gmane.org/gmane.comp.lang.nasm.devel/3704 to work.
58include $(KBUILD_PATH)/tools/NASM.kmk
59TOOL_VBoxNasm = Our version of the NASM tool
60ifndef TOOL_VBoxNasm_PATH
61 TOOL_VBoxNasm_PATH := $(firstword $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST)/nasm/v*.*)))
62 if "$(TOOL_VBoxNasm_PATH)" == "" && "$(KBUILD_DEVTOOLS_HST_ALT)" != ""
63 TOOL_VBoxNasm_PATH := $(firstword $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST_ALT)/nasm/v*.*)))
64 endif
65endif
66ifneq ($(TOOL_VBoxNasm_PATH),)
67 TOOL_VBoxNasm_AS ?= $(TOOL_VBoxNasm_PATH)/nasm$(HOSTSUFF_EXE)
68else
69 TOOL_VBoxNasm_AS ?= nasm$(HOSTSUFF_EXE)
70endif
71TOOL_VBoxNasm_ASFLAGS ?= $(TOOL_NASM_ASFLAGS)
72TOOL_VBoxNasm_COMPILE_AS_OUTPUT = $(outbase).lst
73TOOL_VBoxNasm_COMPILE_AS_DEPEND =
74TOOL_VBoxNasm_COMPILE_AS_DEPORD =
75define TOOL_VBoxNasm_COMPILE_AS_CMDS
76 $(QUIET)$(REDIRECT) -C $(PATH_OUT_BASE) -- $(TOOL_VBoxNasm_AS)\
77 $(flags) $(addsuffix /,$(addprefix -i, $(incs))) $(addprefix -D, $(defs))\
78 -l $(outbase).lst\
79 -o $(obj)\
80 $(abspath $(source))
81 $(QUIET)$(REDIRECT) -C $(PATH_OUT_BASE) -wo $(dep) -- $(TOOL_VBoxNasm_AS)\
82 $(flags) $(addsuffix /,$(addprefix -i, $(incs))) $(addprefix -D, $(defs))\
83 -l $(outbase).lst\
84 -o $(obj)\
85 $(abspath $(source)) \
86 -M -MP
87endef
88
89# Dropped by the time 2.12 rc7 got out. Just struggling rebuilding nasm.
90if "$(KBUILD_TARGET)" == "darwin"
91 BS3KIT_NASM_allow_64_bit = --allow-64-bit
92endif
93
94#
95# ELF 64-bit compiler tool with object conversion.
96#
97# Mac needs cross compiler: sudo port install x86_64-elf-gcc
98#
99TOOL_Bs3Gcc64Elf64 := AMD64/ELF64 gcc/g++ (cross) compiler.
100ifeq ($(KBUILD_HOST),darwin)
101 TOOL_Bs3Gcc64Elf64_CC ?= x86_64-elf-gcc$(HOSTSUFF_EXE) -m64
102 TOOL_Bs3Gcc64Elf64_CXX ?= x86_64-elf-g++$(HOSTSUFF_EXE) -m64
103else
104 TOOL_Bs3Gcc64Elf64_CC ?= gcc$(HOSTSUFF_EXE) -m64
105 TOOL_Bs3Gcc64Elf64_CXX ?= g++$(HOSTSUFF_EXE) -m64
106endif
107ifdef SLKRUNS
108 TOOL_Bs3Gcc64Elf64_CC += -fmessage-length=0
109 TOOL_Bs3Gcc64Elf64_CXX += -fmessage-length=0
110endif
111TOOL_Bs3Gcc64Elf64_COBJSUFF ?= .o
112TOOL_Bs3Gcc64Elf64_CFLAGS ?=
113TOOL_Bs3Gcc64Elf64_CFLAGS.debug ?= -g
114TOOL_Bs3Gcc64Elf64_CFLAGS.profile ?= -O2 #-g -pg
115TOOL_Bs3Gcc64Elf64_CFLAGS.release ?= -O2
116TOOL_Bs3Gcc64Elf64_CINCS ?=
117TOOL_Bs3Gcc64Elf64_CDEFS ?=
118TOOL_Bs3Gcc64Elf64_COMPILE_C_DEPEND = $(VBoxBs3ObjConverter_1_TARGET)
119TOOL_Bs3Gcc64Elf64_COMPILE_C_DEPORD =
120TOOL_Bs3Gcc64Elf64_COMPILE_C_OUTPUT =
121define TOOL_Bs3Gcc64Elf64_COMPILE_C_CMDS
122 $(QUIET)$(TOOL_Bs3Gcc64Elf64_CC) -c\
123 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
124 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
125 -o $(obj)\
126 $(abspath $(source))
127 $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
128 $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
129endef
130
131TOOL_Bs3Gcc64Elf64_CXXOBJSUFF ?= .o
132TOOL_Bs3Gcc64Elf64_CXXOBJSUFF ?= .o
133TOOL_Bs3Gcc64Elf64_CXXFLAGS ?=
134TOOL_Bs3Gcc64Elf64_CXXFLAGS.debug ?= -g0 # no debug info, thank you
135TOOL_Bs3Gcc64Elf64_CXXFLAGS.profile ?= -O2 #-g -pg
136TOOL_Bs3Gcc64Elf64_CXXFLAGS.release ?= -O2
137TOOL_Bs3Gcc64Elf64_CXXINCS ?=
138TOOL_Bs3Gcc64Elf64_CXXDEFS ?=
139TOOL_Bs3Gcc64Elf64_COMPILE_CXX_DEPEND = $(VBoxBs3ObjConverter_1_TARGET)
140TOOL_Bs3Gcc64Elf64_COMPILE_CXX_DEPORD =
141TOOL_Bs3Gcc64Elf64_COMPILE_CXX_OUTPUT =
142define TOOL_Bs3Gcc64Elf64_COMPILE_CXX_CMDS
143 $(QUIET)$(TOOL_Bs3Gcc64Elf64_CXX) -c\
144 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
145 -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
146 -o $(obj)\
147 $(abspath $(source))
148 $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
149 $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
150endef
151
152#
153# Visual C++ tool variant that runs the object converter afterwards.
154#
155TOOL_Bs3Vcc64 := Visual C++ 64-bit
156TOOL_Bs3Vcc64_CC = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_CC)
157TOOL_Bs3Vcc64_CXX = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_CXX)
158TOOL_Bs3Vcc64_COBJSUFF = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COBJSUFF)
159TOOL_Bs3Vcc64_CFLAGS = $(filter-out -TC,$(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_CFLAGS)) -TP # compile as C++
160TOOL_Bs3Vcc64_CFLAGS.debug =
161TOOL_Bs3Vcc64_CFLAGS.dbgopt = -O1
162TOOL_Bs3Vcc64_CFLAGS.profile = -O1
163TOOL_Bs3Vcc64_CFLAGS.release = -O1
164TOOL_Bs3Vcc64_CINCS = $(PATH_TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_INC)
165TOOL_Bs3Vcc64_CDEFS =
166TOOL_Bs3Vcc64_COMPILE_C_DEPEND = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_C_DEPEND) $(VBoxBs3ObjConverter_1_TARGET)
167TOOL_Bs3Vcc64_COMPILE_C_DEPORD = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_C_DEPORD)
168TOOL_Bs3Vcc64_COMPILE_C_OUTPUT = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_C_OUTPUT)
169TOOL_Bs3Vcc64_COMPILE_C_OUTPUT_MAYBE = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_C_OUTPUT_MAYBE)
170define TOOL_Bs3Vcc64_COMPILE_C_CMDS
171$(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_C_CMDS)
172 $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
173endef
174
175TOOL_Bs3Vcc64_CXXOBJSUFF = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_CXXOBJSUFF)
176TOOL_Bs3Vcc64_CXXFLAGS = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_CXXFLAGS)
177TOOL_Bs3Vcc64_CXXFLAGS.debug =
178TOOL_Bs3Vcc64_CXXFLAGS.dbgopt = -O1
179TOOL_Bs3Vcc64_CXXFLAGS.profile = -O1
180TOOL_Bs3Vcc64_CXXFLAGS.release = -O1
181TOOL_Bs3Vcc64_CXXINCS = $(PATH_TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_INC)
182TOOL_Bs3Vcc64_CXXDEFS =
183TOOL_Bs3Vcc64_COMPILE_CXX_DEPEND = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_CXX_DEPEND) $(VBoxBs3ObjConverter_1_TARGET)
184TOOL_Bs3Vcc64_COMPILE_CXX_DEPORD = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_CXX_DEPORD)
185TOOL_Bs3Vcc64_COMPILE_CXX_OUTPUT = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_CXX_OUTPUT)
186TOOL_Bs3Vcc64_COMPILE_CXX_OUTPUT_MAYBE = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_CXX_OUTPUT_MAYBE)
187define TOOL_Bs3Vcc64_COMPILE_CXX_CMDS
188$(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_CXX_CMDS)
189 $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
190endef
191
192#
193# 32-bit OpenWatcom C/C++ tool variant that runs the object converter afterwards
194# to rename intrinsic functions so they don't clash with the 16-bit compiler.
195#
196TOOL_Bs3Ow32 := OpenWatcom C/C++ 32-bit with object convertsion
197TOOL_Bs3Ow32_CC = $(TOOL_OPENWATCOM_CC)
198TOOL_Bs3Ow32_CXX = $(TOOL_OPENWATCOM_CXX)
199TOOL_Bs3Ow32_COBJSUFF = $(TOOL_OPENWATCOM_COBJSUFF)
200TOOL_Bs3Ow32_CFLAGS = $(TOOL_OPENWATCOM_CFLAGS)
201# -adfs \ - This is too complicated and it doesn't support stubbing files (svn rename fun.h pain.h). Use kDepObj instead.
202# -ad=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(dep)) \
203# -adt=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(obj)) \
204# -add=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(abspath $(source))) \
205# -adhp=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(dir $(abspath $(source))))
206TOOL_Bs3Ow32_CFLAGS.debug = $(TOOL_OPENWATCOM_CFLAGS.debug)
207TOOL_Bs3Ow32_CFLAGS.dbgopt = $(TOOL_OPENWATCOM_CFLAGS.dbgopt)
208TOOL_Bs3Ow32_CFLAGS.profile = $(TOOL_OPENWATCOM_CFLAGS.profile)
209TOOL_Bs3Ow32_CFLAGS.release = $(TOOL_OPENWATCOM_CFLAGS.release)
210TOOL_Bs3Ow32_CINCS = $(TOOL_OPENWATCOM_CINCS)
211TOOL_Bs3Ow32_CDEFS =
212TOOL_Bs3Ow32_COMPILE_C_DEPEND = $(TOOL_OPENWATCOM_COMPILE_C_DEPEND) $(VBoxBs3ObjConverter_1_TARGET)
213TOOL_Bs3Ow32_COMPILE_C_DEPORD = $(TOOL_OPENWATCOM_COMPILE_C_DEPORD)
214TOOL_Bs3Ow32_COMPILE_C_OUTPUT = $(TOOL_OPENWATCOM_COMPILE_C_OUTPUT)
215TOOL_Bs3Ow32_COMPILE_C_OUTPUT_MAYBE = $(TOOL_OPENWATCOM_COMPILE_C_OUTPUT_MAYBE)
216define TOOL_Bs3Ow32_COMPILE_C_CMDS
217$(TOOL_OPENWATCOM_COMPILE_C_CMDS)
218 $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
219 $(QUIET)$(REDIRECT) -wo /dev/null -- $(KBUILD_BIN_PATH)/kDepObj$(HOSTSUFF_EXE) -s -f -q -o "$(dep)" -t "$(obj)" "$(obj)"
220endef
221
222TOOL_Bs3Ow32_CXXOBJSUFF = $(TOOL_OPENWATCOM_CXXOBJSUFF)
223TOOL_Bs3Ow32_CXXFLAGS = $(TOOL_OPENWATCOM_CXXFLAGS) -ad=$(call TOOL_OPENWATCOM_FIX_SLASHES,$(dep)) -adfs
224TOOL_Bs3Ow32_CXXFLAGS.debug = $(TOOL_OPENWATCOM_CXXFLAGS.debug)
225TOOL_Bs3Ow32_CXXFLAGS.dbgopt = $(TOOL_OPENWATCOM_CXXFLAGS.dbgopt)
226TOOL_Bs3Ow32_CXXFLAGS.profile = $(TOOL_OPENWATCOM_CXXFLAGS.profile)
227TOOL_Bs3Ow32_CXXFLAGS.release = $(TOOL_OPENWATCOM_CXXFLAGS.release)
228TOOL_Bs3Ow32_CXXINCS = $(TOOL_OPENWATCOM_CXXINCS)
229TOOL_Bs3Ow32_CXXDEFS =
230TOOL_Bs3Ow32_COMPILE_CXX_DEPEND = $(TOOL_OPENWATCOM_COMPILE_CXX_DEPEND) $(VBoxBs3ObjConverter_1_TARGET)
231TOOL_Bs3Ow32_COMPILE_CXX_DEPORD = $(TOOL_OPENWATCOM_COMPILE_CXX_DEPORD)
232TOOL_Bs3Ow32_COMPILE_CXX_OUTPUT = $(TOOL_OPENWATCOM_COMPILE_CXX_OUTPUT)
233TOOL_Bs3Ow32_COMPILE_CXX_OUTPUT_MAYBE = $(TOOL_OPENWATCOM_COMPILE_CXX_OUTPUT_MAYBE)
234define TOOL_Bs3Ow32_COMPILE_CXX_CMDS
235$(TOOL_OPENWATCOM_COMPILE_CXX_CMDS)
236 $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
237 $(QUIET)$(REDIRECT) -wo /dev/null -- $(KBUILD_BIN_PATH)/kDepObj$(HOSTSUFF_EXE) -s -f -q -o "$(dep)" -t "$(obj)" "$(obj)"
238endef
239
240
241#
242# 16-bit OpenWatcom C/C++ tool variant that runs the object converter afterwards
243# to rename intrinsic functions so they don't clash with the 16-bit compiler.
244#
245TOOL_Bs3Ow16 := OpenWatcom C/C++ 16-bit with object convertsion
246TOOL_Bs3Ow16_CC = $(TOOL_OPENWATCOM-16_CC)
247TOOL_Bs3Ow16_CXX = $(TOOL_OPENWATCOM-16_CXX)
248TOOL_Bs3Ow16_COBJSUFF = $(TOOL_OPENWATCOM-16_COBJSUFF)
249TOOL_Bs3Ow16_CFLAGS = $(TOOL_OPENWATCOM-16_CFLAGS)
250TOOL_Bs3Ow16_CFLAGS.debug = $(TOOL_OPENWATCOM-16_CFLAGS.debug)
251TOOL_Bs3Ow16_CFLAGS.dbgopt = $(TOOL_OPENWATCOM-16_CFLAGS.dbgopt)
252TOOL_Bs3Ow16_CFLAGS.profile = $(TOOL_OPENWATCOM-16_CFLAGS.profile)
253TOOL_Bs3Ow16_CFLAGS.release = $(TOOL_OPENWATCOM-16_CFLAGS.release)
254TOOL_Bs3Ow16_CINCS = $(TOOL_OPENWATCOM-16_CINCS)
255TOOL_Bs3Ow16_CDEFS =
256TOOL_Bs3Ow16_COMPILE_C_DEPEND = $(TOOL_OPENWATCOM-16_COMPILE_C_DEPEND) $(VBoxBs3ObjConverter_1_TARGET)
257TOOL_Bs3Ow16_COMPILE_C_DEPORD = $(TOOL_OPENWATCOM-16_COMPILE_C_DEPORD)
258TOOL_Bs3Ow16_COMPILE_C_OUTPUT = $(TOOL_OPENWATCOM-16_COMPILE_C_OUTPUT)
259TOOL_Bs3Ow16_COMPILE_C_OUTPUT_MAYBE = $(TOOL_OPENWATCOM-16_COMPILE_C_OUTPUT_MAYBE)
260define TOOL_Bs3Ow16_COMPILE_C_CMDS
261$(TOOL_OPENWATCOM-16_COMPILE_C_CMDS)
262 $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
263 $(QUIET)$(REDIRECT) -wo /dev/null -- $(KBUILD_BIN_PATH)/kDepObj$(HOSTSUFF_EXE) -s -f -q -o "$(dep)" -t "$(obj)" "$(obj)"
264endef
265
266TOOL_Bs3Ow16_CXXOBJSUFF = $(TOOL_OPENWATCOM-16_CXXOBJSUFF)
267TOOL_Bs3Ow16_CXXFLAGS = $(TOOL_OPENWATCOM-16_CXXFLAGS)
268TOOL_Bs3Ow16_CXXFLAGS.debug = $(TOOL_OPENWATCOM-16_CXXFLAGS.debug)
269TOOL_Bs3Ow16_CXXFLAGS.dbgopt = $(TOOL_OPENWATCOM-16_CXXFLAGS.dbgopt)
270TOOL_Bs3Ow16_CXXFLAGS.profile = $(TOOL_OPENWATCOM-16_CXXFLAGS.profile)
271TOOL_Bs3Ow16_CXXFLAGS.release = $(TOOL_OPENWATCOM-16_CXXFLAGS.release)
272TOOL_Bs3Ow16_CXXINCS = $(TOOL_OPENWATCOM-16_CXXINCS)
273TOOL_Bs3Ow16_CXXDEFS =
274TOOL_Bs3Ow16_COMPILE_CXX_DEPEND = $(TOOL_OPENWATCOM-16_COMPILE_CXX_DEPEND) $(VBoxBs3ObjConverter_1_TARGET)
275TOOL_Bs3Ow16_COMPILE_CXX_DEPORD = $(TOOL_OPENWATCOM-16_COMPILE_CXX_DEPORD)
276TOOL_Bs3Ow16_COMPILE_CXX_OUTPUT = $(TOOL_OPENWATCOM-16_COMPILE_CXX_OUTPUT)
277TOOL_Bs3Ow16_COMPILE_CXX_OUTPUT_MAYBE = $(TOOL_OPENWATCOM-16_COMPILE_CXX_OUTPUT_MAYBE)
278define TOOL_Bs3Ow16_COMPILE_CXX_CMDS
279$(TOOL_OPENWATCOM-16_COMPILE_CXX_CMDS)
280 $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
281 $(QUIET)$(REDIRECT) -wo /dev/null -- $(KBUILD_BIN_PATH)/kDepObj$(HOSTSUFF_EXE) -s -f -q -o "$(dep)" -t "$(obj)" "$(obj)"
282endef
283
284# Debug info format depends on what we use for 64-bit.
285if1of ($(KBUILD_HOST), win)
286 BS3_OW_DBG_OPT = -hc
287 BS3_OW_DBG_LDOPT = codeview
288else
289 BS3_OW_DBG_OPT = -hd
290 BS3_OW_DBG_LDOPT = dwarf
291endif
292
293#
294# BS3Kit template for assembly and 16-bit code.
295#
296# Note! Using -d1 as -d1+ and -d2 causes suboptimal code to be generated (strlen
297# reloading string pointer argument all the time).
298# Note! Optimization options should come after debug stuff as -d2 for instance
299# disables all optimziations.
300#
301# Compiler options explained:
302# -nt=xxxx Sets the text segment name.
303# -nc=xxxx Sets the text segment class name.
304# -nd=xxxx Sets the data segment name.
305# -ecc Sets the default calling convension to __cdecl
306# Update: We don't use this in 16-bit code as it causes unfavorable reloading of DS before calling
307# inlined functions (e.g. iprt/asm.h). Instead we use -ecw and __cdecl where needed.
308# -ecw Sets the default calling convension to __watcall ()
309# -q Quiet, no logos or stuff.
310# -0 Use 8086 instruction set (16-bit only).
311# -3 Use 386 instruction set (16-bit only).
312# -wx Maxium warning level.
313# -zl Don't emit default library information.
314# -zu Assume SS != DS.
315# -mc Compact memory model, far data, small code.
316# -mf Flat memory model (32-bit).
317# -d1 Debug info: Globals and line numbers.
318# -s No stack overflow checks.
319# -oa Relaxed aliasing constraints.
320# -ob Branch prediction.
321# -of Generate stack frames when needed.
322# -oi Inline instrinsics functions.
323# -ol Loop optimizations.
324# -or Reorder for best pipeline.
325# -os Favor size over speed.
326#
327TEMPLATE_VBoxBS3KitImg = Template for building BS3Kit test images.
328TEMPLATE_VBoxBS3KitImg_BLD_TRG = os-agnostic
329TEMPLATE_VBoxBS3KitImg_BLD_TRG_ARCH = x86
330TEMPLATE_VBoxBS3KitImg_INST = $(INST_VALIDATIONKIT)bootsectors/
331TEMPLATE_VBoxBS3KitImg_BINSUFF = .img
332TEMPLATE_VBoxBS3KitImg_MODE = 0644
333TEMPLATE_VBoxBS3KitImg_ASTOOL = VBoxNasm
334TEMPLATE_VBoxBS3KitImg_ASFLAGS = -f obj -g $(BS3KIT_NASM_allow_64_bit) -w+orphan-labels
335TEMPLATE_VBoxBS3KitImg_ASDEFS = ASM_FORMAT_OMF RT_NOINC_SEGMENTS __NASM__
336TEMPLATE_VBoxBS3KitImg_DEFS = ARCH_BITS=16 IN_BS3KIT
337TEMPLATE_VBoxBS3KitImg_DEFS.debug = BS3_STRICT
338TEMPLATE_VBoxBS3KitImg_ARTOOL = OPENWATCOM-16
339TEMPLATE_VBoxBS3KitImg_CTOOL = Bs3Ow16
340TEMPLATE_VBoxBS3KitImg_CXXTOOL = Bs3Ow16
341TEMPLATE_VBoxBS3KitImg_CFLAGS = \
342 -nt=BS3TEXT16 -nd=BS3DATA16 -nc=BS3CODE16 -ecw -q -0 -wx -zl -zu -mc $(BS3_OW_DBG_OPT) -d1 -s -oa -ob -of -oi -ol -or -os
343TEMPLATE_VBoxBS3KitImg_CXXFLAGS = \
344 -nt=BS3TEXT16 -nd=BS3DATA16 -nc=BS3CODE16 -ecw -q -0 -wx -zl -zu -mc $(BS3_OW_DBG_OPT) -d1 -s -oa -ob -of -oi -ol -or -os
345TEMPLATE_VBoxBS3KitImg_INCS = $(VBOX_PATH_BS3KIT_SRC) .
346TEMPLATE_VBoxBS3KitImg_LDTOOL = OPENWATCOM-WL
347# option quiet, nofarcalls\
348# disable 1014, 1023, 2120, 1080
349
350# linker options:
351# system dos: Link a 16-bit DOS binary.
352# output raw ...: Produce a raw DOS binary for loading at flat address 10000h.
353# The following is for ordering segments.
354# option start=_start: The start symbol in bs3-first-xxx.asm.
355# debug codeview/dwarf all: Full debug information either in codeview or dwarf.
356# option symfile: Produce a separate symbol file with the debug info.
357# option map: Produce a map file.
358# option statics: ?
359# option verbose: Verbose map file?
360# option disable 1014: Disable warning about
361# option disable 1080: Disable warning about
362# option disable 1150: Disable warning about
363#
364# Note! We're pushing DATA16 to 0x20000 because it's impossible to force wlink
365# to give us a real-mode + GDT compatible alignment (0ffffff80h), i.e.
366# real-mode address on the form 0fff8:0000.
367TEMPLATE_VBoxBS3KitImg_LDFLAGS = system dos \
368 debug $(BS3_OW_DBG_LDOPT) all \
369 option quiet, map, statics, verbose, symfile, start=_start \
370 disable 1014, 1080, 1150 \
371 \
372 output raw offset=0x10000 \
373 order \
374 clname BS3FLAT segaddr=0x0000 \
375 segment BS3FLAT segaddr=0x0000 \
376 clname BS3CODE16 segaddr=0x1000 \
377 segment BS3TEXT16 \
378 segment BS3TEXT16_END \
379 clname BS3SYSTEM16 segaddr=0x2000 \
380 segment BS3SYSTEM16 \
381 clname FAR_DATA \
382 segment BS3DATA16 segaddr=0x2700 \
383 segment BS3DATA16CONST \
384 segment BS3DATA16CONST2 \
385 segment BS3DATA16_DATA \
386 segment BS3DATA16_END \
387 segment BS3DATA32 \
388 segment BS3DATA32_CONST \
389 segment BS3DATA32_CONST2 \
390 segment BS3DATA32_DATA \
391 segment DATA32 \
392 clname BS3CODE32 \
393 segment BS3TEXT32 \
394 segment TEXT32 \
395 clname CODE \
396 segment BS3TEXT64 \
397 segment TEXT64 \
398 segment .text \
399 segment .rdata \
400 clname DATA \
401 segment BS3DATA64 \
402 segment DATA64 \
403 segment .data \
404 segment .pdata \
405 segment .xdata \
406
407TEMPLATE_VBoxBS3KitImg_DEPS = \
408 $(bs3-bootsector_1_TARGET) \
409 $(VBoxBs3Linker_1_TARGET)
410TEMPLATE_VBoxBS3KitImg_POST_CMDS = $(if $(eq $(tool_do),LINK_LIBRARY)\
411 ,,$(QUIET)$(MV_EXT) -f -- "$(out)" "$(out).tmp" \
412 $$(NLTAB)$(QUIET)$(VBoxBs3Linker_1_TARGET) -o $(out) $(bs3-bootsector_1_TARGET) $(out).tmp \
413 $$(NLTAB)$(QUIET)$(RM_EXT) -f -- "$(out).tmp")
414
415TEMPLATE_VBoxBS3KitImg_LIBS = \
416 $(PATH_OBJ)/bs3kit-common-16/bs3kit-common-16.lib \
417 $(PATH_OBJ)/bs3kit-common-32/bs3kit-common-32.lib \
418 $(PATH_OBJ)/bs3kit-common-64-asm/bs3kit-common-64-asm.lib \
419 $(PATH_OBJ)/bs3kit-common-64-c/bs3kit-common-64-c.lib \
420 \
421 $(PATH_OBJ)/bs3kit-rm/bs3kit-rm.lib \
422 $(PATH_OBJ)/bs3kit-pe16/bs3kit-pe16.lib \
423 $(PATH_OBJ)/bs3kit-pe32/bs3kit-pe32.lib \
424 $(PATH_OBJ)/bs3kit-pev86/bs3kit-pev86.lib \
425 $(PATH_OBJ)/bs3kit-pp16/bs3kit-pp16.lib \
426 $(PATH_OBJ)/bs3kit-pp32/bs3kit-pp32.lib \
427 $(PATH_OBJ)/bs3kit-ppv86/bs3kit-ppv86.lib \
428 $(PATH_OBJ)/bs3kit-pae16/bs3kit-pae16.lib \
429 $(PATH_OBJ)/bs3kit-pae32/bs3kit-pae32.lib \
430 $(PATH_OBJ)/bs3kit-paev86/bs3kit-paev86.lib \
431 $(PATH_OBJ)/bs3kit-lm16/bs3kit-lm16.lib \
432 $(PATH_OBJ)/bs3kit-lm32/bs3kit-lm32.lib \
433 $(PATH_OBJ)/bs3kit-lm64-asm/bs3kit-lm64-asm.lib \
434 $(PATH_OBJ)/bs3kit-lm64-c/bs3kit-lm64-c.lib
435
436# BS3Kit template for 32-bit code.
437TEMPLATE_VBoxBS3KitImg32 = Template for building BS3Kit test images.
438TEMPLATE_VBoxBS3KitImg32_BLD_TRG = os-agnostic
439TEMPLATE_VBoxBS3KitImg32_BLD_TRG_ARCH = x86
440TEMPLATE_VBoxBS3KitImg32_INSTTYPE = none
441TEMPLATE_VBoxBS3KitImg32_ASTOOL = VBoxNasm
442TEMPLATE_VBoxBS3KitImg32_ASFLAGS = -f obj -g $(BS3KIT_NASM_allow_64_bit) -w+orphan-labels
443TEMPLATE_VBoxBS3KitImg32_ASDEFS = ASM_FORMAT_OMF RT_NOINC_SEGMENTS __NASM__
444TEMPLATE_VBoxBS3KitImg32_DEFS = ARCH_BITS=32 IN_BS3KIT
445TEMPLATE_VBoxBS3KitImg32_DEFS.debug = BS3_STRICT
446TEMPLATE_VBoxBS3KitImg32_ARTOOL = OPENWATCOM
447TEMPLATE_VBoxBS3KitImg32_CTOOL = Bs3Ow32
448TEMPLATE_VBoxBS3KitImg32_CXXTOOL = Bs3Ow32
449TEMPLATE_VBoxBS3KitImg32_CFLAGS = \
450 -nt=BS3TEXT32 -nd=BS3DATA32 -nc=BS3CODE32 -ecc -q -wx -zl -mf $(BS3_OW_DBG_OPT) -d1 -s -oa -ob -of -oi -ol -or -os
451TEMPLATE_VBoxBS3KitImg32_CXXFLAGS = \
452 -nt=BS3TEXT32 -nd=BS3DATA32 -nc=BS3CODE32 -ecc -q -wx -zl -mf $(BS3_OW_DBG_OPT) -d1 -s -oa -ob -of -oi -ol -or -os
453TEMPLATE_VBoxBS3KitImg32_INCS = $(VBOX_PATH_BS3KIT_SRC) .
454TEMPLATE_VBoxBS3KitImg32_LDTOOL = VBoxBsUnusedLd
455
456# BS3Kit template for 64-bit code.
457TEMPLATE_VBoxBS3KitImg64 = Template for building BS3Kit test images.
458TEMPLATE_VBoxBS3KitImg64_BLD_TRG = os-agnostic
459TEMPLATE_VBoxBS3KitImg64_BLD_TRG_ARCH = amd64
460TEMPLATE_VBoxBS3KitImg64_INSTTYPE = none
461TEMPLATE_VBoxBS3KitImg64_ASTOOL = VBoxNasm
462TEMPLATE_VBoxBS3KitImg64_ASFLAGS = -f obj -g $(BS3KIT_NASM_allow_64_bit) -w+orphan-labels
463TEMPLATE_VBoxBS3KitImg64_ASDEFS = ASM_FORMAT_OMF RT_NOINC_SEGMENTS __NASM__
464TEMPLATE_VBoxBS3KitImg64_DEFS = IN_BS3KIT ARCH_BITS=64
465TEMPLATE_VBoxBS3KitImg64_DEFS.debug = BS3_STRICT
466TEMPLATE_VBoxBS3KitImg64_ARTOOL = OPENWATCOM
467TEMPLATE_VBoxBS3KitImg64_INCS = $(VBOX_PATH_BS3KIT_SRC) .
468if1of ($(KBUILD_HOST), win)
469 ifndef TOOL_VCC100AMD64 # For win.x86 builds.
470 include $(KBUILD_PATH)/tools/$(VBOX_VCC_TOOL_STEM)AMD64.kmk
471 endif
472 TEMPLATE_VBoxBS3KitImg64_CTOOL := Bs3Vcc64
473 TEMPLATE_VBoxBS3KitImg64_CXXTOOL := Bs3Vcc64
474 TEMPLATE_VBoxBS3KitImg64_CFLAGS = -Zi -O1 -Oi -GF -GS- -Gy -Gs65536
475 TEMPLATE_VBoxBS3KitImg64_CXXFLAGS = -Zi -O1 -Oi -GF -GS- -Gy -Gs65536
476else
477 TEMPLATE_VBoxBS3KitImg64_CTOOL := Bs3Gcc64Elf64
478 TEMPLATE_VBoxBS3KitImg64_CXXTOOL := Bs3Gcc64Elf64
479 # Note! -mx32 would be exactly what we needed here, however it causes internal compiler errors with 4.8.4 on gentoo.
480 TEMPLATE_VBoxBS3KitImg64_CFLAGS = -m64 -maccumulate-outgoing-args -g -Os -fno-omit-frame-pointer $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_WARN_PEDANTIC_C)
481 TEMPLATE_VBoxBS3KitImg64_CXXFLAGS = -m64 -maccumulate-outgoing-args -g -Os -fno-omit-frame-pointer $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_WARN_PEDANTIC_CXX)
482endif
483TEMPLATE_VBoxBS3KitImg64_LDTOOL = VBoxBsUnusedLd
484
485# BS3Kit template for the bootsector.
486TEMPLATE_VBoxBS3KitBS = Template for building BS3Kit test images.
487TEMPLATE_VBoxBS3KitBS_BLD_TRG = os-agnostic
488TEMPLATE_VBoxBS3KitBS_BLD_TRG_ARCH = x86
489TEMPLATE_VBoxBS3KitBS_INST = $(INST_VALIDATIONKIT)bootsectors/
490TEMPLATE_VBoxBS3KitBS_INSTTYPE = none
491TEMPLATE_VBoxBS3KitBS_BINSUFF = .img
492TEMPLATE_VBoxBS3KitBS_MODE = 0644
493TEMPLATE_VBoxBS3KitBS_ASTOOL = YASM
494TEMPLATE_VBoxBS3KitBS_ASFLAGS = -f bin --mapfile
495TEMPLATE_VBoxBS3KitBS_ASDEFS = ASM_FORMAT_BIN RT_NOINC_SEGMENTS ARCH_BITS=16 __YASM__
496TEMPLATE_VBoxBS3KitBS_INCS = $(VBOX_PATH_BS3KIT_SRC) .
497TEMPLATE_VBoxBS3KitBS_LDTOOL = VBoxBsCpLd
498
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette