1 | # $Id: Makefile.kmk 58785 2015-11-19 23:30:50Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # VirtualBox Validation Kit - Bootsector Kit v3
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006-2015 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 |
|
---|
27 | SUB_DEPTH = ../../../../..
|
---|
28 | include $(KBUILD_PATH)/subheader.kmk
|
---|
29 |
|
---|
30 |
|
---|
31 | #
|
---|
32 | # ----- Config.kmk: start -----
|
---|
33 | #
|
---|
34 |
|
---|
35 | # The bs3kit source directory.
|
---|
36 | VBOX_PATH_BS3KIT_SRC = $(VBOX_PATH_VALIDATIONKIT_SRC)/bootsectors/bs3kit
|
---|
37 |
|
---|
38 | # Boot Sector post-link tool used below.
|
---|
39 | BLDPROGS += VBoxBs3Linker
|
---|
40 | VBoxBs3Linker_TEMPLATE = VBoxBldProg
|
---|
41 | VBoxBs3Linker_SOURCES = $(VBOX_PATH_BS3KIT_SRC)/VBoxBs3Linker.cpp
|
---|
42 |
|
---|
43 | # 64-bit relocation conversion tool
|
---|
44 | BLDPROGS += VBoxBs3ObjConverter
|
---|
45 | VBoxBs3ObjConverter_TEMPLATE = VBoxBldProg
|
---|
46 | VBoxBs3ObjConverter_SOURCES = $(VBOX_PATH_BS3KIT_SRC)/VBoxBs3ObjConverter.cpp
|
---|
47 |
|
---|
48 | # Dummy CP "linker" tool.
|
---|
49 | TOOL_VBoxBsCpLd = Dummy copy linker.
|
---|
50 | TOOL_VBoxBsCpLd_LINK_MISCBIN_OUTPUT =
|
---|
51 | TOOL_VBoxBsCpLd_LINK_MISCBIN_DEPEND =
|
---|
52 | TOOL_VBoxBsCpLd_LINK_MISCBIN_DEPORD =
|
---|
53 | define TOOL_VBoxBsCpLd_LINK_MISCBIN_CMDS
|
---|
54 | $(CP) -- $(objs) $(othersrc) "$(out)"
|
---|
55 | endef
|
---|
56 |
|
---|
57 | # Dummy exit 1 "linker" tool.
|
---|
58 | TOOL_VBoxBsUnusedLd = Dummy unused linker.
|
---|
59 | TOOL_VBoxBsUnusedLd_LINK_MISCBIN_OUTPUT =
|
---|
60 | TOOL_VBoxBsUnusedLd_LINK_MISCBIN_DEPEND =
|
---|
61 | TOOL_VBoxBsUnusedLd_LINK_MISCBIN_DEPORD =
|
---|
62 | define TOOL_VBoxBsUnusedLd_LINK_MISCBIN_CMDS
|
---|
63 | echo "cannot use this template for linking"
|
---|
64 | exit 1
|
---|
65 | endef
|
---|
66 |
|
---|
67 | #
|
---|
68 | # elf cross compiling 64-bit gcc (mac): sudo port install x86_64-elf-gcc
|
---|
69 | #
|
---|
70 | TOOL_Bs3Gcc64Elf64 := AMD64/ELF64 gcc/g++ cross compiler for mac.
|
---|
71 | TOOL_Bs3Gcc64Elf64_CC ?= x86_64-elf-gcc$(HOSTSUFF_EXE) -m64
|
---|
72 | TOOL_Bs3Gcc64Elf64_CXX ?= x86_64-elf-g++$(HOSTSUFF_EXE) -m64
|
---|
73 | ifdef SLKRUNS
|
---|
74 | TOOL_Bs3Gcc64Elf64_CC += -fmessage-length=0
|
---|
75 | TOOL_Bs3Gcc64Elf64_CXX += -fmessage-length=0
|
---|
76 | endif
|
---|
77 | TOOL_Bs3Gcc64Elf64_COBJSUFF ?= .o
|
---|
78 | TOOL_Bs3Gcc64Elf64_CFLAGS ?=
|
---|
79 | TOOL_Bs3Gcc64Elf64_CFLAGS.debug ?= -g
|
---|
80 | TOOL_Bs3Gcc64Elf64_CFLAGS.profile ?= -O2 #-g -pg
|
---|
81 | TOOL_Bs3Gcc64Elf64_CFLAGS.release ?= -O2
|
---|
82 | TOOL_Bs3Gcc64Elf64_CINCS ?=
|
---|
83 | TOOL_Bs3Gcc64Elf64_CDEFS ?=
|
---|
84 | TOOL_Bs3Gcc64Elf64_COMPILE_C_DEPEND = $(VBoxBs3ObjConverter_1_TARGET)
|
---|
85 | TOOL_Bs3Gcc64Elf64_COMPILE_C_DEPORD =
|
---|
86 | TOOL_Bs3Gcc64Elf64_COMPILE_C_OUTPUT =
|
---|
87 | define TOOL_Bs3Gcc64Elf64_COMPILE_C_CMDS
|
---|
88 | $(QUIET)$(TOOL_Bs3Gcc64Elf64_CC) -c\
|
---|
89 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
---|
90 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
91 | -o $(obj)\
|
---|
92 | $(abspath $(source))
|
---|
93 | $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
|
---|
94 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
95 | endef
|
---|
96 |
|
---|
97 | TOOL_Bs3Gcc64Elf64_CXXOBJSUFF ?= .o
|
---|
98 | TOOL_Bs3Gcc64Elf64_CXXOBJSUFF ?= .o
|
---|
99 | TOOL_Bs3Gcc64Elf64_CXXFLAGS ?=
|
---|
100 | TOOL_Bs3Gcc64Elf64_CXXFLAGS.debug ?= -g0 # no debug info, thank you
|
---|
101 | TOOL_Bs3Gcc64Elf64_CXXFLAGS.profile ?= -O2 #-g -pg
|
---|
102 | TOOL_Bs3Gcc64Elf64_CXXFLAGS.release ?= -O2
|
---|
103 | TOOL_Bs3Gcc64Elf64_CXXINCS ?=
|
---|
104 | TOOL_Bs3Gcc64Elf64_CXXDEFS ?=
|
---|
105 | TOOL_Bs3Gcc64Elf64_COMPILE_CXX_DEPEND = $(VBoxBs3ObjConverter_1_TARGET)
|
---|
106 | TOOL_Bs3Gcc64Elf64_COMPILE_CXX_DEPORD =
|
---|
107 | TOOL_Bs3Gcc64Elf64_COMPILE_CXX_OUTPUT =
|
---|
108 | define TOOL_Bs3Gcc64Elf64_COMPILE_CXX_CMDS
|
---|
109 | $(QUIET)$(TOOL_Bs3Gcc64Elf64_CXX) -c\
|
---|
110 | $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
|
---|
111 | -Wp,-MD,$(dep) -Wp,-MT,$(obj) -Wp,-MP\
|
---|
112 | -o $(obj)\
|
---|
113 | $(abspath $(source))
|
---|
114 | $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
|
---|
115 | $(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
|
---|
116 | endef
|
---|
117 |
|
---|
118 | #
|
---|
119 | # VCC elf cross compiling 64-bit gcc (mac): sudo port install x86_64-elf-gcc
|
---|
120 | #
|
---|
121 | TOOL_Bs3Vcc64 := Visual C++ 64-bit
|
---|
122 | TOOL_Bs3Vcc64_CC = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_CC)
|
---|
123 | TOOL_Bs3Vcc64_CXX = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_CXX)
|
---|
124 | TOOL_Bs3Vcc64_COBJSUFF = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COBJSUFF)
|
---|
125 | TOOL_Bs3Vcc64_CFLAGS = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_CFLAGS)
|
---|
126 | TOOL_Bs3Vcc64_CFLAGS.debug =
|
---|
127 | TOOL_Bs3Vcc64_CFLAGS.dbgopt = -O1
|
---|
128 | TOOL_Bs3Vcc64_CFLAGS.profile = -O1
|
---|
129 | TOOL_Bs3Vcc64_CFLAGS.release = -O1
|
---|
130 | TOOL_Bs3Vcc64_CINCS = $(PATH_TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_INC)
|
---|
131 | TOOL_Bs3Vcc64_CDEFS =
|
---|
132 | TOOL_Bs3Vcc64_COMPILE_C_DEPEND = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_C_DEPEND) $(VBoxBs3ObjConverter_1_TARGET)
|
---|
133 | TOOL_Bs3Vcc64_COMPILE_C_DEPORD = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_C_DEPORD)
|
---|
134 | TOOL_Bs3Vcc64_COMPILE_C_OUTPUT = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_C_OUTPUT)
|
---|
135 | TOOL_Bs3Vcc64_COMPILE_C_OUTPUT_MAYBE = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_C_OUTPUT_MAYBE)
|
---|
136 | define TOOL_Bs3Vcc64_COMPILE_C_CMDS
|
---|
137 | $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_C_CMDS)
|
---|
138 | $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
|
---|
139 | endef
|
---|
140 |
|
---|
141 | TOOL_Bs3Vcc64_CXXOBJSUFF = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_CXXOBJSUFF)
|
---|
142 | TOOL_Bs3Vcc64_CXXFLAGS = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_CXXFLAGS)
|
---|
143 | TOOL_Bs3Vcc64_CXXFLAGS.debug =
|
---|
144 | TOOL_Bs3Vcc64_CXXFLAGS.dbgopt = -O1
|
---|
145 | TOOL_Bs3Vcc64_CXXFLAGS.profile = -O1
|
---|
146 | TOOL_Bs3Vcc64_CXXFLAGS.release = -O1
|
---|
147 | TOOL_Bs3Vcc64_CXXINCS = $(PATH_TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_INC)
|
---|
148 | TOOL_Bs3Vcc64_CXXDEFS =
|
---|
149 | TOOL_Bs3Vcc64_COMPILE_CXX_DEPEND = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_CXX_DEPEND) $(VBoxBs3ObjConverter_1_TARGET)
|
---|
150 | TOOL_Bs3Vcc64_COMPILE_CXX_DEPORD = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_CXX_DEPORD)
|
---|
151 | TOOL_Bs3Vcc64_COMPILE_CXX_OUTPUT = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_CXX_OUTPUT)
|
---|
152 | TOOL_Bs3Vcc64_COMPILE_CXX_OUTPUT_MAYBE = $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_CXX_OUTPUT_MAYBE)
|
---|
153 | define TOOL_Bs3Vcc64_COMPILE_CXX_CMDS
|
---|
154 | $(TOOL_$(VBOX_VCC_TOOL_STEM)AMD64_COMPILE_CXX_CMDS)
|
---|
155 | $(QUIET)$(VBoxBs3ObjConverter_1_TARGET) "$(obj)"
|
---|
156 | endef
|
---|
157 |
|
---|
158 | # Debug info format depends on what we use for 64-bit.
|
---|
159 | if1of ($(KBUILD_HOST), win)
|
---|
160 | BS3_OW_DBG_OPT = -hc
|
---|
161 | BS3_OW_DBG_LDOPT = codeview
|
---|
162 | else
|
---|
163 | BS3_OW_DBG_OPT = -hd
|
---|
164 | BS3_OW_DBG_LDOPT = dwarf
|
---|
165 | endif
|
---|
166 |
|
---|
167 | #
|
---|
168 | # BS3Kit template for assembly and 16-bit code.
|
---|
169 | #
|
---|
170 | # Note! Using -d1 as -d1+ and -d2 causes suboptimal code to be generated (strlen
|
---|
171 | # reloading string pointer argument all the time).
|
---|
172 | # Note! Optimization options should come after debug stuff as -d2 for instance
|
---|
173 | # disables all optimziations.
|
---|
174 | #
|
---|
175 | # Compiler options explained:
|
---|
176 | # -nt=xxxx Sets the text segment name.
|
---|
177 | # -nc=xxxx Sets the text segment class name.
|
---|
178 | # -nd=xxxx Sets the data segment name.
|
---|
179 | # -ecc Sets the default calling convension to __cdecl
|
---|
180 | # Update: We don't use this in 16-bit code as it causes unfavorable reloading of DS before calling
|
---|
181 | # inlined functions (e.g. iprt/asm.h). Instead we use -ecw and __cdecl where needed.
|
---|
182 | # -ecw Sets the default calling convension to __watcall ()
|
---|
183 | # -q Quiet, no logos or stuff.
|
---|
184 | # -3 Use 386 instruction set (16-bit only).
|
---|
185 | # -wx Maxium warning level.
|
---|
186 | # -zl Don't emit default library information.
|
---|
187 | # -zu Assume SS != DS.
|
---|
188 | # -mc Compact memory model, far data, small code.
|
---|
189 | # -mf Flat memory model (32-bit).
|
---|
190 | # -d1 Debug info: Globals and line numbers.
|
---|
191 | # -s No stack overflow checks.
|
---|
192 | # -oa Relaxed aliasing constraints.
|
---|
193 | # -ob Branch prediction.
|
---|
194 | # -of Generate stack frames when needed.
|
---|
195 | # -oi Inline instrinsics functions.
|
---|
196 | # -ol Loop optimizations.
|
---|
197 | # -or Reorder for best pipeline.
|
---|
198 | # -os Favor size over speed.
|
---|
199 | #
|
---|
200 | TEMPLATE_VBoxBS3KitImg = Template for building BS3Kit test images.
|
---|
201 | TEMPLATE_VBoxBS3KitImg_BLD_TRG = os-agnostic
|
---|
202 | TEMPLATE_VBoxBS3KitImg_BLD_TRG_ARCH = x86
|
---|
203 | TEMPLATE_VBoxBS3KitImg_INST = $(INST_VALIDATIONKIT)bootsectors/
|
---|
204 | TEMPLATE_VBoxBS3KitImg_BINSUFF = .img
|
---|
205 | TEMPLATE_VBoxBS3KitImg_MODE = 0644
|
---|
206 | TEMPLATE_VBoxBS3KitImg_ASTOOL = NASM
|
---|
207 | TEMPLATE_VBoxBS3KitImg_ASFLAGS = -f obj -g --allow-64bit-code-anywhere -w+orphan-labels
|
---|
208 | TEMPLATE_VBoxBS3KitImg_ASDEFS = ASM_FORMAT_OMF RT_NOINC_SEGMENTS __NASM__
|
---|
209 | TEMPLATE_VBoxBS3KitImg_DEFS = ARCH_BITS=16 IN_BS3KIT
|
---|
210 | TEMPLATE_VBoxBS3KitImg_ARTOOL = OPENWATCOM-16
|
---|
211 | TEMPLATE_VBoxBS3KitImg_CTOOL = OPENWATCOM-16
|
---|
212 | TEMPLATE_VBoxBS3KitImg_CXXTOOL = OPENWATCOM-16
|
---|
213 | TEMPLATE_VBoxBS3KitImg_CFLAGS = \
|
---|
214 | -nt=BS3TEXT16 -nd=BS3DATA16 -nc=BS3CODE16 -ecw -q -3 -wx -zl -zu -mc $(BS3_OW_DBG_OPT) -d1 -s -oa -ob -of -oi -ol -or -os
|
---|
215 | TEMPLATE_VBoxBS3KitImg_CXXFLAGS = \
|
---|
216 | -nt=BS3TEXT16 -nd=BS3DATA16 -nc=BS3CODE16 -ecw -q -3 -wx -zl -zu -mc $(BS3_OW_DBG_OPT) -d1 -s -oa -ob -of -oi -ol -or -os
|
---|
217 | TEMPLATE_VBoxBS3KitImg_INCS = $(VBOX_PATH_BS3KIT_SRC) .
|
---|
218 | TEMPLATE_VBoxBS3KitImg_LDTOOL = OPENWATCOM-WL
|
---|
219 | # option quiet, nofarcalls\
|
---|
220 | # disable 1014, 1023, 2120, 1080
|
---|
221 |
|
---|
222 | # linker options:
|
---|
223 | # system dos: Link a 16-bit DOS binary.
|
---|
224 | # output raw ...: Produce a raw DOS binary for loading at flat address 10000h.
|
---|
225 | # The following is for ordering segments.
|
---|
226 | # option start=_start: The start symbol in bs3-first-xxx.asm.
|
---|
227 | # debug codeview/dwarf all: Full debug information either in codeview or dwarf.
|
---|
228 | # option symfile: Produce a separate symbol file with the debug info.
|
---|
229 | # option map: Produce a map file.
|
---|
230 | # option statics: ?
|
---|
231 | # option verbose: Verbose map file?
|
---|
232 | # option disable 1014: Disable warning about
|
---|
233 | # option disable 1080: Disable warning about
|
---|
234 | # option disable 1150: Disable warning about
|
---|
235 | #
|
---|
236 | # Note! We're pushing DATA16 to 0x20000 because it's impossible to force wlink
|
---|
237 | # to give us a real-mode + GDT compatible alignment (0ffffff80h), i.e.
|
---|
238 | # real-mode address on the form 0fff8:0000.
|
---|
239 | TEMPLATE_VBoxBS3KitImg_LDFLAGS = system dos \
|
---|
240 | debug $(BS3_OW_DBG_LDOPT) all \
|
---|
241 | option quiet, map, statics, verbose, symfile, start=_start \
|
---|
242 | disable 1014, 1080, 1150 \
|
---|
243 | \
|
---|
244 | output raw offset=0x10000 \
|
---|
245 | order \
|
---|
246 | clname BS3CODE16 segaddr=0x1000 \
|
---|
247 | segment BS3TEXT16 \
|
---|
248 | segment BS3TEXT16_END \
|
---|
249 | clname BS3SYSTEM16 segaddr=0x2000 \
|
---|
250 | segment BS3SYSTEM16 \
|
---|
251 | clname FAR_DATA \
|
---|
252 | segment BS3DATA16 segaddr=0x2700 \
|
---|
253 | segment BS3DATA16CONST \
|
---|
254 | segment BS3DATA16CONST2 \
|
---|
255 | segment BS3DATA16_DATA \
|
---|
256 | segment BS3DATA16_END \
|
---|
257 | segment BS3DATA32 \
|
---|
258 | segment BS3DATA32_CONST \
|
---|
259 | segment BS3DATA32_CONST2 \
|
---|
260 | segment BS3DATA32_DATA \
|
---|
261 | segment DATA32 \
|
---|
262 | clname BS3CODE32 \
|
---|
263 | segment BS3TEXT32 \
|
---|
264 | segment TEXT32 \
|
---|
265 | clname CODE \
|
---|
266 | segment BS3TEXT64 \
|
---|
267 | segment TEXT64 \
|
---|
268 | segment .text \
|
---|
269 | segment .rdata \
|
---|
270 | clname DATA \
|
---|
271 | segment BS3DATA64 \
|
---|
272 | segment DATA64 \
|
---|
273 | segment .data
|
---|
274 | TEMPLATE_VBoxBS3KitImg_DEPS = \
|
---|
275 | $(bs3-bootsector_1_TARGET) \
|
---|
276 | $(VBoxBs3Linker_1_TARGET)
|
---|
277 | TEMPLATE_VBoxBS3KitImg_POST_CMDS = $(if $(eq $(tool_do),LINK_LIBRARY)\
|
---|
278 | ,,$(QUIET)$(MV_EXT) -f -- "$(out)" "$(out).tmp" \
|
---|
279 | $$(NLTAB)$(QUIET)$(VBoxBs3Linker_1_TARGET) -o $(out) $(bs3-bootsector_1_TARGET) $(out).tmp \
|
---|
280 | $$(NLTAB)$(QUIET)$(RM_EXT) -f -- "$(out).tmp")
|
---|
281 |
|
---|
282 | TEMPLATE_VBoxBS3KitImg_LIBS = \
|
---|
283 | $(PATH_OBJ)/bs3kit-common-16/bs3kit-common-16.lib \
|
---|
284 | $(PATH_OBJ)/bs3kit-common-32/bs3kit-common-32.lib \
|
---|
285 | $(PATH_OBJ)/bs3kit-common-64-asm/bs3kit-common-64-asm.lib \
|
---|
286 | $(PATH_OBJ)/bs3kit-common-64-c/bs3kit-common-64-c.lib
|
---|
287 |
|
---|
288 | # BS3Kit template for 32-bit code.
|
---|
289 | TEMPLATE_VBoxBS3KitImg32 = Template for building BS3Kit test images.
|
---|
290 | TEMPLATE_VBoxBS3KitImg32_BLD_TRG = os-agnostic
|
---|
291 | TEMPLATE_VBoxBS3KitImg32_BLD_TRG_ARCH = x86
|
---|
292 | TEMPLATE_VBoxBS3KitImg32_INSTTYPE = none
|
---|
293 | TEMPLATE_VBoxBS3KitImg32_ASTOOL = NASM
|
---|
294 | TEMPLATE_VBoxBS3KitImg32_ASFLAGS = -f obj -g --allow-64bit-code-anywhere -w+orphan-labels
|
---|
295 | TEMPLATE_VBoxBS3KitImg32_ASDEFS = ASM_FORMAT_OMF RT_NOINC_SEGMENTS __NASM__
|
---|
296 | TEMPLATE_VBoxBS3KitImg32_DEFS = ARCH_BITS=32 IN_BS3KIT
|
---|
297 | TEMPLATE_VBoxBS3KitImg32_ARTOOL = OPENWATCOM
|
---|
298 | TEMPLATE_VBoxBS3KitImg32_CTOOL = OPENWATCOM
|
---|
299 | TEMPLATE_VBoxBS3KitImg32_CXXTOOL = OPENWATCOM
|
---|
300 | TEMPLATE_VBoxBS3KitImg32_CFLAGS = \
|
---|
301 | -nt=BS3TEXT32 -nd=BS3DATA32 -nc=BS3CODE32 -ecc -q -wx -zl -mf $(BS3_OW_DBG_OPT) -d1 -s -oa -ob -of -oi -ol -or -os
|
---|
302 | TEMPLATE_VBoxBS3KitImg32_CXXFLAGS = \
|
---|
303 | -nt=BS3TEXT32 -nd=BS3DATA32 -nc=BS3CODE32 -ecc -q -wx -zl -mf $(BS3_OW_DBG_OPT) -d1 -s -oa -ob -of -oi -ol -or -os
|
---|
304 | TEMPLATE_VBoxBS3KitImg32_INCS = $(VBOX_PATH_BS3KIT_SRC) .
|
---|
305 | TEMPLATE_VBoxBS3KitImg32_LDTOOL = VBoxBsUnusedLd
|
---|
306 |
|
---|
307 | # BS3Kit template for 64-bit code.
|
---|
308 | TEMPLATE_VBoxBS3KitImg64 = Template for building BS3Kit test images.
|
---|
309 | TEMPLATE_VBoxBS3KitImg64_BLD_TRG = os-agnostic
|
---|
310 | TEMPLATE_VBoxBS3KitImg64_BLD_TRG_ARCH = amd64
|
---|
311 | TEMPLATE_VBoxBS3KitImg64_INSTTYPE = none
|
---|
312 | TEMPLATE_VBoxBS3KitImg64_ASTOOL = NASM
|
---|
313 | TEMPLATE_VBoxBS3KitImg64_ASFLAGS = -f obj -g --allow-64bit-code-anywhere -w+orphan-labels
|
---|
314 | TEMPLATE_VBoxBS3KitImg64_ASDEFS = ASM_FORMAT_OMF RT_NOINC_SEGMENTS __NASM__
|
---|
315 | TEMPLATE_VBoxBS3KitImg64_DEFS = IN_BS3KIT ARCH_BITS=64
|
---|
316 | TEMPLATE_VBoxBS3KitImg64_ARTOOL = OPENWATCOM
|
---|
317 | TEMPLATE_VBoxBS3KitImg64_INCS = $(VBOX_PATH_BS3KIT_SRC) .
|
---|
318 | if1of ($(KBUILD_HOST), win)
|
---|
319 | TEMPLATE_VBoxBS3KitImg64_CTOOL := Bs3Vcc64
|
---|
320 | TEMPLATE_VBoxBS3KitImg64_CXXTOOL := Bs3Vcc64
|
---|
321 | TEMPLATE_VBoxBS3KitImg64_CFLAGS = -Zi -O1 -Oi -GF -GS- -Gy -Gs65536
|
---|
322 | TEMPLATE_VBoxBS3KitImg64_CXXFLAGS = -Zi -O1 -Oi -GF -GS- -Gy -Gs65536
|
---|
323 | else
|
---|
324 | if1of ($(KBUILD_HOST), darwin)
|
---|
325 | TEMPLATE_VBoxBS3KitImg64_CTOOL := Bs3Gcc64Elf64
|
---|
326 | TEMPLATE_VBoxBS3KitImg64_CXXTOOL := Bs3Gcc64Elf64
|
---|
327 | else
|
---|
328 | TEMPLATE_VBoxBS3KitImg64_CTOOL := $(VBOX_GCC_TOOL)
|
---|
329 | TEMPLATE_VBoxBS3KitImg64_CXXTOOL := $(VBOX_GCC_TOOL)
|
---|
330 | endif
|
---|
331 | TEMPLATE_VBoxBS3KitImg64_CFLAGS = -m64 -maccumulate-outgoing-args -g -Os -fno-omit-frame-pointer $(VBOX_GCC_WARN_PEDANTIC_C)
|
---|
332 | TEMPLATE_VBoxBS3KitImg64_CXXFLAGS = -m64 -maccumulate-outgoing-args -g -Os -fno-omit-frame-pointer $(VBOX_GCC_WARN_PEDANTIC_CXX)
|
---|
333 | endif
|
---|
334 | TEMPLATE_VBoxBS3KitImg64_LDTOOL = VBoxBsUnusedLd
|
---|
335 |
|
---|
336 | # BS3Kit template for the bootsector.
|
---|
337 | TEMPLATE_VBoxBS3KitBS = Template for building BS3Kit test images.
|
---|
338 | TEMPLATE_VBoxBS3KitBS_BLD_TRG = os-agnostic
|
---|
339 | TEMPLATE_VBoxBS3KitBS_BLD_TRG_ARCH = x86
|
---|
340 | TEMPLATE_VBoxBS3KitBS_INST = $(INST_VALIDATIONKIT)bootsectors/
|
---|
341 | TEMPLATE_VBoxBS3KitBS_INSTTYPE = none
|
---|
342 | TEMPLATE_VBoxBS3KitBS_BINSUFF = .img
|
---|
343 | TEMPLATE_VBoxBS3KitBS_MODE = 0644
|
---|
344 | TEMPLATE_VBoxBS3KitBS_ASTOOL = YASM
|
---|
345 | TEMPLATE_VBoxBS3KitBS_ASFLAGS = -f bin --mapfile
|
---|
346 | TEMPLATE_VBoxBS3KitBS_ASDEFS = ASM_FORMAT_BIN RT_NOINC_SEGMENTS ARCH_BITS=16 __YASM__
|
---|
347 | TEMPLATE_VBoxBS3KitBS_INCS = $(VBOX_PATH_BS3KIT_SRC) .
|
---|
348 | TEMPLATE_VBoxBS3KitBS_LDTOOL = VBoxBsCpLd
|
---|
349 |
|
---|
350 | #
|
---|
351 | # ----- Config.kmk: end -----
|
---|
352 | #
|
---|
353 |
|
---|
354 |
|
---|
355 | # The boot sector.
|
---|
356 | MISCBINS += bs3-bootsector
|
---|
357 | bs3-bootsector_TEMPLATE = VBoxBS3KitBS
|
---|
358 | bs3-bootsector_SOURCES = bs3-bootsector.asm
|
---|
359 |
|
---|
360 | # Common sources to be compiled into _p16, _p32 and _p64 versions.
|
---|
361 | VBOX_BS3KIT_COMMON_SOURCES = \
|
---|
362 | bs3-cmn-Shutdown.asm \
|
---|
363 | bs3-cmn-Panic.asm \
|
---|
364 | bs3-cmn-PrintChr.asm \
|
---|
365 | bs3-cmn-PrintU32.asm \
|
---|
366 | bs3-cmn-PrintStr.c \
|
---|
367 | bs3-cmn-PrintStrColonSpaces.asm \
|
---|
368 | bs3-cmn-PrintStrSpacesColonSpace.c \
|
---|
369 | bs3-cmn-StrLen.c \
|
---|
370 | bs3-cmn-StrNLen.c \
|
---|
371 | bs3-cmn-StrCpy.c \
|
---|
372 | bs3-cmn-MemCpy.c \
|
---|
373 | bs3-cmn-MemPCpy.c \
|
---|
374 | bs3-cmn-MemMove.c \
|
---|
375 | bs3-cmn-MemZero.asm \
|
---|
376 | bs3-cmn-SlabInit.c \
|
---|
377 | bs3-cmn-SlabFree.c \
|
---|
378 | bs3-cmn-SlabListInit.c \
|
---|
379 | bs3-cmn-SlabListAdd.c \
|
---|
380 | bs3-cmn-SlabListAlloc.c \
|
---|
381 | bs3-cmn-SlabListAllocEx.c \
|
---|
382 | bs3-cmn-SlabListFree.c \
|
---|
383 | bs3-cmn-TestData.c \
|
---|
384 | bs3-cmn-TestInit.c \
|
---|
385 | bs3-cmn-TestSendStrCmd.asm \
|
---|
386 | bs3-cmn-TestIsVmmDevTestingPresent.asm \
|
---|
387 | ../../../Runtime/common/asm/ASMBitFirstClear.asm \
|
---|
388 | ../../../Runtime/common/asm/ASMBitFirstSet.asm \
|
---|
389 | ../../../Runtime/common/asm/ASMBitNextClear.asm \
|
---|
390 | ../../../Runtime/common/asm/ASMBitNextSet.asm
|
---|
391 |
|
---|
392 | # The BS3Kit library.
|
---|
393 | LIBRARIES += bs3kit-common-16
|
---|
394 | bs3kit-common-16_TEMPLATE = VBoxBS3KitImg
|
---|
395 | bs3kit-common-16_DEFS = TMPL_PE16 BS3_CMN_ONLY
|
---|
396 | bs3kit-common-16_ASDEFS = RT_ASMDEFS_INC_FIRST_FILE
|
---|
397 | bs3kit-common-16_SOURCES = $(VBOX_BS3KIT_COMMON_SOURCES) \
|
---|
398 | bs3-system-data.asm \
|
---|
399 | bs3-rm-InitMemory.c
|
---|
400 |
|
---|
401 | # The 32-bit BS3Kit library.
|
---|
402 | LIBRARIES += bs3kit-common-32
|
---|
403 | bs3kit-common-32_TEMPLATE = VBoxBS3KitImg32
|
---|
404 | bs3kit-common-32_DEFS = TMPL_PE32 BS3_CMN_ONLY
|
---|
405 | bs3kit-common-32_ASDEFS = RT_ASMDEFS_INC_FIRST_FILE
|
---|
406 | bs3kit-common-32_SOURCES = $(VBOX_BS3KIT_COMMON_SOURCES)
|
---|
407 |
|
---|
408 | # The 64-bit BS3Kit library.
|
---|
409 | LIBRARIES += bs3kit-common-64-asm
|
---|
410 | bs3kit-common-64-asm_TEMPLATE = VBoxBS3KitImg64
|
---|
411 | bs3kit-common-64-asm_DEFS = TMPL_LM64 BS3_CMN_ONLY
|
---|
412 | bs3kit-common-64-asm_ASDEFS = RT_ASMDEFS_INC_FIRST_FILE
|
---|
413 | bs3kit-common-64-asm_SOURCES = $(filter %.asm,$(VBOX_BS3KIT_COMMON_SOURCES))
|
---|
414 |
|
---|
415 | # The 64-bit BS3Kit library.
|
---|
416 | LIBRARIES += bs3kit-common-64-c
|
---|
417 | bs3kit-common-64-c_TEMPLATE = VBoxBS3KitImg64
|
---|
418 | bs3kit-common-64-c_DEFS = TMPL_LM64 BS3_CMN_ONLY
|
---|
419 | bs3kit-common-64-c_SOURCES = $(filter-out %.asm,$(VBOX_BS3KIT_COMMON_SOURCES))
|
---|
420 |
|
---|
421 | #
|
---|
422 | # shutdown example.
|
---|
423 | #
|
---|
424 | MISCBINS += bs3-shutdown
|
---|
425 | bs3-shutdown_TEMPLATE = VBoxBS3KitImg
|
---|
426 | bs3-shutdown_SOURCES = bs3-first-rm.asm bs3-shutdown.c
|
---|
427 |
|
---|
428 |
|
---|
429 | include $(FILE_KBUILD_SUB_FOOTER)
|
---|
430 |
|
---|