1 | # $Id: Config.kmk 4548 2007-09-05 22:24:25Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | #
|
---|
4 | # The global build configuration file for VBox.
|
---|
5 | #
|
---|
6 | # This file gets included by all makefiles through the
|
---|
7 | # include $(PATH_KBUILD)/header.kmk statement.
|
---|
8 | #
|
---|
9 |
|
---|
10 | #
|
---|
11 | # Copyright (C) 2006-2007 innotek GmbH
|
---|
12 | #
|
---|
13 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
14 | # available from http://www.virtualbox.org. This file is free software;
|
---|
15 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
16 | # General Public License as published by the Free Software Foundation,
|
---|
17 | # in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
|
---|
18 | # distribution. VirtualBox OSE is distributed in the hope that it will
|
---|
19 | # be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
20 |
|
---|
21 |
|
---|
22 | #
|
---|
23 | # kBuild stuff
|
---|
24 | #
|
---|
25 |
|
---|
26 | # Enable automatic installation of what's built.
|
---|
27 | KBUILD_DO_AUTO_INSTALL := 1
|
---|
28 | # Add the GPLExport pass.
|
---|
29 | PASSES := $(filter-out PACKING,$(PASSES)) PACKING # temporary hack
|
---|
30 | PASSES += GPLEXPORT
|
---|
31 | # Modify the order of the INSTALLS and OTHERS passes.
|
---|
32 | DEFAULT_PASSES := BLDPROGS LIBRARIES DLLS BINARIES INSTALLS OTHERS
|
---|
33 |
|
---|
34 | ## PASS: gplexport
|
---|
35 | # This pass processes custom gplexport rules listed in
|
---|
36 | # the GPLEXPORTS variable.
|
---|
37 | PASS_GPLEXPORT := GPL and LGPL source export
|
---|
38 | PASS_GPLEXPORT_trgs :=
|
---|
39 | PASS_GPLEXPORT_vars := GPLEXPORTS
|
---|
40 | PASS_GPLEXPORT_pass := gplexport
|
---|
41 | #alias
|
---|
42 | gplexport: pass_gplexport
|
---|
43 |
|
---|
44 | # Install paths.
|
---|
45 | PATH_INS := $(PATH_OUT)
|
---|
46 | ifeq ($(BUILD_TARGET),darwin)
|
---|
47 | INST_DIST = dist/
|
---|
48 | INST_SDK = $(INST_DIST)sdk/
|
---|
49 | INST_SDK_SAMPLES = $(INST_SDK)samples
|
---|
50 |
|
---|
51 | # the bundles
|
---|
52 | INST_VIRTUALBOX = $(INST_DIST)VirtualBox.app/
|
---|
53 | INST_VBOXDRV = $(INST_DIST)VBoxDrv.kext/
|
---|
54 | INST_VBOXTAP = $(INST_DIST)VBoxTAP.kext/
|
---|
55 | INST_VBOXUSB = $(INST_DIST)VBoxUSB.kext/
|
---|
56 |
|
---|
57 | # put everything in the VirtualBox app bundle.
|
---|
58 | INST_BIN = $(INST_VIRTUALBOX)Contents/MacOS/
|
---|
59 | INST_DLL = $(INST_BIN)
|
---|
60 | INST_SYS = $(INST_BIN)
|
---|
61 | INST_TESTCASE = $(INST_BIN)testcase/
|
---|
62 | INST_ADDITIONS = $(INST_BIN)additions/
|
---|
63 |
|
---|
64 | # other paths
|
---|
65 | INST_TESTSUITE = testsuite/
|
---|
66 | INST_LIB = lib/
|
---|
67 | INST_ADDITIONS_LIB = $(PATH_LIB)/additions/
|
---|
68 |
|
---|
69 | else
|
---|
70 |
|
---|
71 | INST_BIN = bin/
|
---|
72 | INST_DIST = $(INST_BIN)
|
---|
73 | INST_DLL = $(INST_BIN)
|
---|
74 | INST_SDK = $(INST_BIN)sdk/
|
---|
75 | INST_SDK_SAMPLES = $(INST_SDK)samples
|
---|
76 | INST_DLL = $(INST_BIN)
|
---|
77 | INST_SYS = $(INST_BIN)
|
---|
78 | INST_TESTCASE = $(INST_BIN)testcase/
|
---|
79 | INST_ADDITIONS = $(INST_BIN)additions/
|
---|
80 |
|
---|
81 | INST_TESTSUITE = testsuite/
|
---|
82 | INST_LIB = lib/
|
---|
83 | INST_ADDITIONS_LIB = $(INST_LIB)additions/
|
---|
84 | endif
|
---|
85 |
|
---|
86 | PATH_BIN = $(patsubst %/,%,$(PATH_INS)/$(INST_BIN))
|
---|
87 | PATH_DLL = $(patsubst %/,%,$(PATH_INS)/$(INST_DLL))
|
---|
88 | PATH_SYS = $(patsubst %/,%,$(PATH_INS)/$(INST_SYS))
|
---|
89 | PATH_LIB = $(patsubst %/,%,$(PATH_INS)/$(INST_LIB))
|
---|
90 | PATH_DOC = $(PATH_OUT)/doc
|
---|
91 | VBOX_PATH_SDK = $(patsubst %/,%,$(PATH_INS)/$(INST_SDK))
|
---|
92 | VBOX_PATH_DIST = $(patsubst %/,%,$(PATH_INS)/$(INST_DIST))
|
---|
93 | VBOX_PATH_TESTSUITE = $(patsubst %/,%,$(PATH_INS)/$(INST_TESTSUITE))
|
---|
94 |
|
---|
95 |
|
---|
96 | # Delete targets on failure.
|
---|
97 | .DELETE_ON_ERROR:
|
---|
98 |
|
---|
99 | # Notify about important kBuild updates.
|
---|
100 | ifneq ($(call int-ge,$(KMK_REVISION),1065),1)
|
---|
101 | $(error You must update kBuild!)
|
---|
102 | endif
|
---|
103 |
|
---|
104 | #
|
---|
105 | # Define USERNAME early on.
|
---|
106 | #
|
---|
107 | ifndef USERNAME
|
---|
108 | ifdef USER
|
---|
109 | USERNAME = $(USER)
|
---|
110 | else
|
---|
111 | $(warning Warning: You must have USERNAME or USER in your environment.)
|
---|
112 | endif
|
---|
113 | endif
|
---|
114 |
|
---|
115 | #
|
---|
116 | # The VirtualBox version.
|
---|
117 | #
|
---|
118 |
|
---|
119 | # Major version.
|
---|
120 | VBOX_VERSION_MAJOR = 1
|
---|
121 | # Minor version.
|
---|
122 | VBOX_VERSION_MINOR = 5
|
---|
123 | # This is the current build number. It should be increased every time we publish a
|
---|
124 | # new build. The define is available in every source file. Only even build numbers
|
---|
125 | # will be published, odd numbers are set during development.
|
---|
126 | VBOX_VERSION_BUILD = 51
|
---|
127 | # Full version string (may include more than just x.y.z, but no spaces or other problematic chars).
|
---|
128 | VBOX_VERSION_STRING = $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)
|
---|
129 |
|
---|
130 |
|
---|
131 | #
|
---|
132 | # The VirtualBox Configuration Defaults.
|
---|
133 | #
|
---|
134 |
|
---|
135 | # Build linux / win32 additions.
|
---|
136 | ifeq ($(BUILD_TARGET),linux)
|
---|
137 | VBOX_WITH_LINUX_ADDITIONS = 1
|
---|
138 | VBOX_WITH_WIN32_ADDITIONS = 1
|
---|
139 | endif
|
---|
140 | ifeq ($(BUILD_TARGET),l4)
|
---|
141 | VBOX_WITH_LINUX_ADDITIONS = 1
|
---|
142 | VBOX_WITH_WIN32_ADDITIONS = 1
|
---|
143 | endif
|
---|
144 | ifeq ($(BUILD_TARGET),os2)
|
---|
145 | VBOX_WITH_OS2_ADDITIONS = 1
|
---|
146 | endif
|
---|
147 | ifeq ($(BUILD_TARGET),win)
|
---|
148 | VBOX_WITH_WIN32_ADDITIONS = 1
|
---|
149 | endif
|
---|
150 | ifdef VBOX_WITH_LINUX_ADDITIONS
|
---|
151 | ifeq ($(BUILD_TARGET).$(BUILD_PLATFORM_ARCH),linux.x86)
|
---|
152 | VBOX_WITH_LINUX_ADDITIONS_32BIT_R0 = 1
|
---|
153 | endif
|
---|
154 | endif
|
---|
155 | # Enable the building of shared folders in the windows additions.
|
---|
156 | VBOX_WITH_WIN32_ADDITIONS_SHAREDFOLDERS = 1
|
---|
157 | # Take the binaries of the OS/2 Additions
|
---|
158 | VBOX_WITH_OS2_ADDITIONS_BIN = 1
|
---|
159 |
|
---|
160 | # build the installer
|
---|
161 | VBOX_WITH_INSTALLER = 1
|
---|
162 | # enable VRDP server
|
---|
163 | VBOX_WITH_VRDP = 1
|
---|
164 | # enable the new VRDP server interface which does not use COM
|
---|
165 | VBOX_WITH_VRDP_NO_COM = 1
|
---|
166 | # build VRDP authentication modules
|
---|
167 | VBOX_WITH_VRDP_AUTHMOD = 1
|
---|
168 | # build enhanced version of rdesktop
|
---|
169 | VBOX_WITH_VRDP_RDESKTOP = 1
|
---|
170 | ifeq ($(filter-out darwin.x86 darwin.amd64 os2.x86 win.amd64,$(BUILD_TARGET).$(BUILD_TARGET_ARCH)),)
|
---|
171 | # build the support driver & library without IDT patching.
|
---|
172 | ## @todo invert this!
|
---|
173 | VBOX_WITHOUT_IDT_PATCHING = 1
|
---|
174 | endif
|
---|
175 | # The kernel driver/module and related runtime libraries.
|
---|
176 | VBOX_WITH_VBOXDRV = 1
|
---|
177 | # build with secure label support
|
---|
178 | ifeq ($(filter win.amd64,$(BUILD_TARGET).$(BUILD_TARGET_ARCH)),) # too much work with freetype and all that.
|
---|
179 | VBOX_WITH_SECURELABEL = 1
|
---|
180 | endif
|
---|
181 |
|
---|
182 | # the main api
|
---|
183 | VBOX_WITH_MAIN = 1
|
---|
184 | # the SDL based GUI
|
---|
185 | VBOX_WITH_VBOXSDL = 1
|
---|
186 | # the basic frontend (w/o Main)
|
---|
187 | VBOX_WITH_VBOXBFE = 1
|
---|
188 | # the Qt GUI
|
---|
189 | VBOX_WITH_QTGUI = 1
|
---|
190 | ## the Direct Framebuffer GUI
|
---|
191 | #VBOX_WITH_VBOXFB = 1
|
---|
192 | # the gui debugger
|
---|
193 | ifneq ($(BUILD_TYPE),release)
|
---|
194 | VBOX_WITH_DEBUGGER_GUI = 1
|
---|
195 | endif
|
---|
196 | # the documentation
|
---|
197 | VBOX_WITH_DOCS = 1
|
---|
198 | # build the Host Guest Communication Manager component
|
---|
199 | VBOX_WITH_HGCM = 1
|
---|
200 | # Enable the USB feature.
|
---|
201 | VBOX_WITH_USB = 1
|
---|
202 | # Enable the ISCSI feature.
|
---|
203 | VBOX_WITH_ISCSI = 1
|
---|
204 | # Enable ALSA support for Linux
|
---|
205 | VBOX_WITH_ALSA = 1
|
---|
206 | # Disable WINMM support for Windows (not implemented)
|
---|
207 | VBOX_WITH_WINMM =
|
---|
208 | # Enable the kchmviewer
|
---|
209 | VBOX_WITH_KCHMVIEWER = 1
|
---|
210 | # Build the testsuite.
|
---|
211 | VBOX_WITH_TESTSUITE = 1
|
---|
212 | # Build the testcases.
|
---|
213 | VBOX_WITH_TESTCASES = 1
|
---|
214 | # Set this to not use COM or XPCOM in places where it can be avoided.
|
---|
215 | #VBOX_WITHOUT_COM = 1
|
---|
216 | # Set this to skip installing the redistributable compiler runtime.
|
---|
217 | #VBOX_WITHOUT_COMPILER_REDIST = 1
|
---|
218 | # Enabled internal networking.
|
---|
219 | VBOX_WITH_INTERNAL_NETWORKING = 1
|
---|
220 | # Enables the ffmpeg module for recording test runs.
|
---|
221 | #VBOX_WITH_FFMPEG = 1
|
---|
222 | # Enable OpenGL service
|
---|
223 | VBOX_WITH_OGL = 1
|
---|
224 | # Enable shared folders
|
---|
225 | VBOX_WITH_SHARED_FOLDERS = 1
|
---|
226 | # Enable shared clipboard
|
---|
227 | VBOX_WITH_SHARED_CLIPBOARD = 1
|
---|
228 | # Enable the Intel PXE ROM (replaces Etherboot).
|
---|
229 | VBOX_WITH_INTEL_PXE = 1
|
---|
230 | # Strip binaries of release and profile builds
|
---|
231 | VBOX_DO_STRIP = $(if $(filter release profile,$(BUILD_TYPE)),1,)
|
---|
232 | # Strip R0/GC modules (current requirement for our loader)
|
---|
233 | VBOX_DO_STRIP_MODULES = 1
|
---|
234 |
|
---|
235 | #
|
---|
236 | # Skip stuff.
|
---|
237 | #
|
---|
238 |
|
---|
239 | # VBOX_QUICK can be used by core developers to speed to the build
|
---|
240 | ifdef VBOX_QUICK
|
---|
241 | # undefine variables by assigning blank.
|
---|
242 | VBOX_WITH_TESTSUITE=
|
---|
243 | VBOX_WITH_TESTCASES=
|
---|
244 | VBOX_WITH_MAIN =
|
---|
245 | VBOX_WITH_VBOXSDL =
|
---|
246 | VBOX_WITH_VBOXBFE =
|
---|
247 | VBOX_WITH_QTGUI =
|
---|
248 | VBOX_WITH_DEBUGGER_GUI =
|
---|
249 | VBOX_WITH_DOCS =
|
---|
250 | endif # VBOX_QUICK
|
---|
251 |
|
---|
252 | # l4 have to skip a few things.
|
---|
253 | ifeq ($(BUILD_TARGET),l4)
|
---|
254 | VBOX_WITH_VBOXDRV=
|
---|
255 | VBOX_WITH_VRDP=
|
---|
256 | VBOX_WITH_VBOXSDL=
|
---|
257 | VBOX_WITH_QTGUI=
|
---|
258 | VBOX_WITH_MAIN=
|
---|
259 | VBOX_WITH_DOCS=
|
---|
260 | VBOX_WITH_ISCSI=
|
---|
261 | VBOX_WITH_INTERNAL_NETWORKING=
|
---|
262 | endif
|
---|
263 |
|
---|
264 | # Darwin have to skip a few things at present.
|
---|
265 | ifeq ($(BUILD_TARGET),darwin)
|
---|
266 | # Internal networking requires testing and possibly proper ring-3/ring0 separation.
|
---|
267 | VBOX_WITH_INTERNAL_NETWORKING=
|
---|
268 | # Don't bother with SDL ttf for now.
|
---|
269 | VBOX_WITH_SECURELABEL=
|
---|
270 | # Later:
|
---|
271 | VBOX_WITH_VRDP_AUTHMOD=
|
---|
272 | VBOX_WITH_VRDP_RDESKTOP=
|
---|
273 | endif
|
---|
274 |
|
---|
275 | # Most stuff doesn't build yet on the new targets.
|
---|
276 | ifeq ($(BUILD_TARGET),os2)
|
---|
277 | VBOX_WITH_DEBUGGER_GUI=
|
---|
278 | VBOX_WITH_INSTALLER=
|
---|
279 | VBOX_WITH_SECURELABEL=
|
---|
280 | VBOX_WITH_VRDP=
|
---|
281 | VBOX_WITH_VRDP_AUTHMOD=
|
---|
282 | VBOX_WITH_VRDP_RDESKTOP=
|
---|
283 | VBOX_WITH_TESTSUITE=
|
---|
284 | VBOX_WITH_USB=
|
---|
285 | VBOX_WITH_DOCS=
|
---|
286 | endif
|
---|
287 |
|
---|
288 | # Most stuff doesn't build yet on the new targets.
|
---|
289 | ifeq ($(filter-out freebsd solaris,$(BUILD_TARGET)),)
|
---|
290 | #VBOX_WITH_VBOXBFE=
|
---|
291 | VBOX_WITH_MAIN=
|
---|
292 | VBOX_WITH_VBOXSDL=
|
---|
293 | VBOX_WITH_QTGUI=
|
---|
294 | VBOX_WITH_DEBUGGER_GUI=
|
---|
295 | VBOX_WITH_INSTALLER=
|
---|
296 | VBOX_WITH_SECURELABEL=
|
---|
297 | VBOX_WITH_VRDP=
|
---|
298 | VBOX_WITH_VRDP_AUTHMOD=
|
---|
299 | VBOX_WITH_VRDP_RDESKTOP=
|
---|
300 | VBOX_WITH_TESTSUITE=
|
---|
301 | VBOX_WITH_USB=
|
---|
302 | VBOX_WITH_DOCS=
|
---|
303 | endif
|
---|
304 |
|
---|
305 |
|
---|
306 | #
|
---|
307 | # Include automatic and local config file to override the above settings
|
---|
308 | # and to provide defaults for the settings below this point.
|
---|
309 | #
|
---|
310 | AUTOCFG := $(wildcard $(PATH_ROOT)/AutoConfig.kmk)
|
---|
311 | ifeq ($(AUTOCFG),)
|
---|
312 | # deprecated name. to be removed.
|
---|
313 | AUTOCFG := $(wildcard $(PATH_ROOT)/Config.kmkconf)
|
---|
314 | ifneq ($(AUTOCFG),)
|
---|
315 | $(warning Config.kmkconf has been renamed. Please re-run configure.)
|
---|
316 | endif
|
---|
317 | endif
|
---|
318 | ifneq ($(AUTOCFG),)
|
---|
319 | include $(AUTOCFG)
|
---|
320 | endif
|
---|
321 |
|
---|
322 | LOCALCFG := $(wildcard $(PATH_ROOT)/LocalConfig.kmk)
|
---|
323 | ifeq ($(LOCALCFG),)
|
---|
324 | # deprecated name. to be removed.
|
---|
325 | LOCALCFG := $(wildcard $(PATH_ROOT)/Config.kmklocal)
|
---|
326 | ifneq ($(LOCALCFG),)
|
---|
327 | $(warning Please rename your Config.kmklocal to LocalConfig.kmk.)
|
---|
328 | endif
|
---|
329 | endif
|
---|
330 | ifneq ($(LOCALCFG),)
|
---|
331 | include $(LOCALCFG)
|
---|
332 | endif
|
---|
333 |
|
---|
334 |
|
---|
335 | #
|
---|
336 | # Check the build type.
|
---|
337 | #
|
---|
338 | VBOX_BUILD_TYPES ?= release profile debug kprofile #todo: checked
|
---|
339 | ifneq ($(filter-out $(VBOX_BUILD_TYPES),$(BUILD_TYPE)),)
|
---|
340 | $(error Invalid BUILD_TYPE value '$(BUILD_TYPE)'. Choose one these: $(VBOX_BUILD_TYPES))
|
---|
341 | endif
|
---|
342 |
|
---|
343 |
|
---|
344 | #
|
---|
345 | # Disable components that are not open sourced.
|
---|
346 | #
|
---|
347 | ifdef VBOX_OSE
|
---|
348 | VBOX_WITH_VRDP=
|
---|
349 | VBOX_WITH_USB=
|
---|
350 | VBOX_WITH_ISCSI=
|
---|
351 | VBOX_WITH_DEBUGGER_GUI=
|
---|
352 | VBOX_WITH_WIN32_ADDITIONS_SHAREDFOLDERS=
|
---|
353 | VBOX_WITH_OS2_ADDITIONS_BIN=
|
---|
354 | VBOX_WITH_SECURELABEL=
|
---|
355 | VBOX_WITH_KCHMVIEWER=
|
---|
356 | VBOX_WITH_DOCS=
|
---|
357 | VBOX_WITH_TESTSUITE=
|
---|
358 | VBOX_WITH_INTEL_PXE=
|
---|
359 | ifeq ($(BUILD_TARGET),darwin)
|
---|
360 | # Qt/Mac v3.3.x requires patching to work for us.
|
---|
361 | VBOX_WITH_QTGUI=
|
---|
362 | # The installer is not public
|
---|
363 | VBOX_WITH_INSTALLER=
|
---|
364 | endif
|
---|
365 | ifeq ($(BUILD_TARGET),win)
|
---|
366 | # The installer is not public
|
---|
367 | VBOX_WITH_INSTALLER=
|
---|
368 | endif
|
---|
369 | endif
|
---|
370 |
|
---|
371 | #
|
---|
372 | # Disable components for headless
|
---|
373 | #
|
---|
374 | ifdef VBOX_HEADLESS
|
---|
375 | VBOX_WITH_QTGUI=
|
---|
376 | VBOX_WITH_VBOXSDL=
|
---|
377 | VBOX_WITH_VBOXBFE=
|
---|
378 | VBOX_WITH_OGL=
|
---|
379 | VBOX_WITH_KCHMVIEWER=
|
---|
380 | endif
|
---|
381 |
|
---|
382 | #
|
---|
383 | # Undefined VBOX_WITH_MAIN implies exclusion of a few more items.
|
---|
384 | #
|
---|
385 | ifndef VBOX_WITH_MAIN
|
---|
386 | VBOX_WITH_VRDP=
|
---|
387 | VBOX_WITH_VBOXSDL=
|
---|
388 | VBOX_WITH_QTGUI=
|
---|
389 | VBOX_WITH_DEBUGGER_GUI=
|
---|
390 | endif
|
---|
391 |
|
---|
392 | #
|
---|
393 | # Mark OSE builds clearly, helps figuring out limitations more easily.
|
---|
394 | #
|
---|
395 | ifdef VBOX_OSE
|
---|
396 | VBOX_VERSION_STRING = $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)_OSE
|
---|
397 | endif
|
---|
398 |
|
---|
399 |
|
---|
400 | #
|
---|
401 | # Image and object format config.
|
---|
402 | #
|
---|
403 | ifeq ($(filter-out linux l4 freebsd netbsd openbsd solaris,$(BUILD_TARGET)),)
|
---|
404 | VBOX_LDR_FMT = elf
|
---|
405 | endif
|
---|
406 | ifeq ($(BUILD_TARGET),darwin)
|
---|
407 | VBOX_LDR_FMT = macho
|
---|
408 | endif
|
---|
409 | ifeq ($(BUILD_TARGET),os2)
|
---|
410 | VBOX_LDR_FMT = lx
|
---|
411 | VBOX_LDR_FMT32 = lx
|
---|
412 | VBOX_LDR_FMT64 = elf
|
---|
413 | DONT_USE_YASM = 1 # yasm doesn't implement omf yet.
|
---|
414 | endif
|
---|
415 | ifeq ($(BUILD_TARGET),win)
|
---|
416 | VBOX_LDR_FMT = pe
|
---|
417 | endif
|
---|
418 | VBOX_LDR_FMT32 ?= $(VBOX_LDR_FMT)
|
---|
419 | VBOX_LDR_FMT64 ?= $(VBOX_LDR_FMT)
|
---|
420 |
|
---|
421 | #
|
---|
422 | # Assembler setup.
|
---|
423 | #
|
---|
424 | # This is a bit complicated since we have to support two different assmblers
|
---|
425 | # (yasm/nasm) and possibly two different formats (32-bit/64-bit).
|
---|
426 | #
|
---|
427 | ifeq ($(VBOX_LDR_FMT),elf)
|
---|
428 | ifeq ($(BUILD_TARGET_ARCH),x86)
|
---|
429 | VBOX_ASFLAGS_FMT = -f elf32 -DASM_FORMAT_ELF
|
---|
430 | else
|
---|
431 | VBOX_ASFLAGS_FMT = -f elf64 -DASM_FORMAT_ELF
|
---|
432 | endif
|
---|
433 | VBOX_ASFLAGS_DBFINFO = -g dwarf2
|
---|
434 | endif
|
---|
435 | ifeq ($(VBOX_LDR_FMT),lx)
|
---|
436 | VBOX_ASFLAGS_FMT = -f obj -DASM_FORMAT_OMF
|
---|
437 | VBOX_ASFLAGS_DBFINFO = -g stabs
|
---|
438 | endif
|
---|
439 | ifeq ($(VBOX_LDR_FMT),macho)
|
---|
440 | VBOX_ASFLAGS_FMT = -f macho -DASM_FORMAT_MACHO
|
---|
441 | VBOX_ASFLAGS_DBFINFO = -g dwarf2
|
---|
442 | endif
|
---|
443 | ifeq ($(VBOX_LDR_FMT),pe)
|
---|
444 | ifeq ($(BUILD_TARGET_ARCH),x86)
|
---|
445 | VBOX_ASFLAGS_FMT = -f win32 -DASM_FORMAT_PE
|
---|
446 | else
|
---|
447 | VBOX_ASFLAGS_FMT = -f win64 -DASM_FORMAT_PE
|
---|
448 | endif
|
---|
449 | endif
|
---|
450 | ifndef VBOX_ASFLAGS_FMT
|
---|
451 | $(error VBOX_ASFLAGS_FMT is not defined. VBOX_LDR_FMT=$(VBOX_LDR_FMT))
|
---|
452 | endif
|
---|
453 |
|
---|
454 | ifeq ($(VBOX_LDR_FMT32),elf)
|
---|
455 | VBOX_ASFLAGS_FMT32 = -f elf32 -DASM_FORMAT_ELF
|
---|
456 | VBOX_ASFLAGS_DBFINFO32 = -g dwarf2
|
---|
457 | endif
|
---|
458 | ifeq ($(VBOX_LDR_FMT32),lx)
|
---|
459 | VBOX_ASFLAGS_FMT32 = -f obj -DASM_FORMAT_OMF
|
---|
460 | VBOX_ASFLAGS_DBFINFO32 = -g stabs
|
---|
461 | endif
|
---|
462 | ifeq ($(VBOX_LDR_FMT32),macho)
|
---|
463 | VBOX_ASFLAGS_FMT32 = -f macho -DASM_FORMAT_MACHO
|
---|
464 | VBOX_ASFLAGS_DBFINFO32 = -g dwarf2
|
---|
465 | endif
|
---|
466 | ifeq ($(VBOX_LDR_FMT32),pe)
|
---|
467 | VBOX_ASFLAGS_FMT32 = -f win32 -DASM_FORMAT_PE
|
---|
468 | endif
|
---|
469 | ifndef VBOX_ASFLAGS_FMT32
|
---|
470 | $(error VBOX_ASFLAGS_FMT32 is not defined. VBOX_LDR_FMT32=$(VBOX_LDR_FMT32))
|
---|
471 | endif
|
---|
472 |
|
---|
473 | ifeq ($(VBOX_LDR_FMT64),elf)
|
---|
474 | VBOX_ASFLAGS_FMT64 = -f elf64 -DASM_FORMAT_ELF
|
---|
475 | VBOX_ASFLAGS_DBFINFO64 = -g dwarf2
|
---|
476 | endif
|
---|
477 | ifeq ($(VBOX_LDR_FMT64),macho)
|
---|
478 | VBOX_ASFLAGS_FMT64 = -f macho64 -DASM_FORMAT_MACHO
|
---|
479 | VBOX_ASFLAGS_DBFINFO64 = -g dwarf2
|
---|
480 | endif
|
---|
481 | ifeq ($(VBOX_LDR_FMT64),pe)
|
---|
482 | VBOX_ASFLAGS_FMT64 = -f win64 -DASM_FORMAT_PE
|
---|
483 | endif
|
---|
484 | ifndef VBOX_ASFLAGS_FMT64
|
---|
485 | $(error VBOX_ASFLAGS_FMT64 is not defined. VBOX_LDR_FMT64=$(VBOX_LDR_FMT64))
|
---|
486 | endif
|
---|
487 |
|
---|
488 | ifndef DONT_USE_YASM
|
---|
489 | VBOX_ASTOOL = YASM
|
---|
490 | ifeq ($(BUILD_PLATFORM),solaris)
|
---|
491 | # solaris yasm bug: crashes with dwarf2 debug info.
|
---|
492 | # yasm 0.6.0, 0.6.99.HEAD, compiled with both suncc as well as gcc
|
---|
493 | VBOX_LDR_FMT_2_YASM_DBGINFO.elf =
|
---|
494 | else
|
---|
495 | VBOX_LDR_FMT_2_YASM_DBGINFO.elf = -g dwarf2
|
---|
496 | endif
|
---|
497 | VBOX_LDR_FMT_2_YASM_DBGINFO.lx = -g stabs
|
---|
498 | VBOX_LDR_FMT_2_YASM_DBGINFO.macho =
|
---|
499 | VBOX_LDR_FMT_2_YASM_DBGINFO.pe =
|
---|
500 | VBOX_ASFLAGS = $(VBOX_ASFLAGS_FMT) -D__YASM__ -Worphan-labels $(VBOX_LDR_FMT_2_YASM_DBGINFO.$(VBOX_LDR_FMT))
|
---|
501 | VBOX_ASFLAGS32 = $(VBOX_ASFLAGS_FMT32) -D__YASM__ -Worphan-labels $(VBOX_LDR_FMT_2_YASM_DBGINFO.$(VBOX_LDR_FMT32))
|
---|
502 | VBOX_ASFLAGS64 = $(VBOX_ASFLAGS_FMT64) -D__YASM__ -Worphan-labels $(VBOX_LDR_FMT_2_YASM_DBGINFO.$(VBOX_LDR_FMT64))
|
---|
503 | else
|
---|
504 | VBOX_ASTOOL = NASM
|
---|
505 | VBOX_ASFLAGS = $(subst elf32,elf,$(VBOX_ASFLAGS_FMT)) -D__NASM__ -w+orphan-labels -g
|
---|
506 | VBOX_ASFLAGS32 = $(subst elf32,elf,$(VBOX_ASFLAGS_FMT32)) -D__NASM__ -w+orphan-labels -g
|
---|
507 | VBOX_ASFLAGS64 = $(VBOX_ASFLAGS_FMT64) -D__NASM__ -w+orphan-labels -g
|
---|
508 | endif
|
---|
509 |
|
---|
510 | #
|
---|
511 | # Windows only has mingw handy. On *nix we have to deal with cross compiling
|
---|
512 | # 32-bit targets on 64-bit platforms, meaning we'll be using gcc32/g++32.
|
---|
513 | # In the latter case we'll also have to disable all the all the R0 driver related stuff.
|
---|
514 | #
|
---|
515 | ifndef VBOX_GCC_TOOL
|
---|
516 | ifeq ($(BUILD_TARGET),win)
|
---|
517 | VBOX_GCC_TOOL := MINGW32
|
---|
518 | TOOL_MINGW32_CFLAGS := $(UNDEFINED) # override -g
|
---|
519 | else ifeq ($(BUILD_TARGET),os2)
|
---|
520 | VBOX_GCC_TOOL := GXX3OMF
|
---|
521 | else ifeq ($(BUILD_TARGET),darwin)
|
---|
522 | VBOX_GCC_TOOL := GXX4MACHO
|
---|
523 | else ifeq ($(BUILD_TARGET),solaris)
|
---|
524 | VBOX_GCC_TOOL := GXX3PLAIN
|
---|
525 | else
|
---|
526 | VBOX_GCC_TOOL := GXX3
|
---|
527 | ifeq ($(BUILD_TARGET_ARCH).$(BUILD_PLATFORM_ARCH),x86.amd64)
|
---|
528 | VBOX_GCC_TOOL := GXX32
|
---|
529 | VBOX_WITH_VBOXDRV=
|
---|
530 | VBOX_WITH_LINUX_ADDITIONS=
|
---|
531 | VBOX_WITH_WIN32_ADDITIONS=
|
---|
532 | else ifeq ($(BUILD_TARGET_ARCH).$(BUILD_PLATFORM_ARCH),amd64.x86)
|
---|
533 | VBOX_GCC_TOOL := GXX64
|
---|
534 | VBOX_WITH_VBOXDRV=
|
---|
535 | VBOX_WITH_LINUX_ADDITIONS=
|
---|
536 | VBOX_WITH_WIN32_ADDITIONS=
|
---|
537 | endif
|
---|
538 | endif
|
---|
539 | endif
|
---|
540 | ifndef VBOX_GCC32_TOOL
|
---|
541 | ifeq ($(BUILD_TARGET_ARCH),x86)
|
---|
542 | VBOX_GCC32_TOOL := $(VBOX_GCC_TOOL)
|
---|
543 | else ifeq ($(BUILD_TARGET),win)
|
---|
544 | VBOX_GCC32_TOOL := MINGW32
|
---|
545 | else
|
---|
546 | VBOX_GCC32_TOOL := GXX32
|
---|
547 | endif
|
---|
548 | endif
|
---|
549 |
|
---|
550 | #
|
---|
551 | # Decide which Visual C++ compiler version we're using by default.
|
---|
552 | #
|
---|
553 | ifndef VBOX_VCC_TOOL
|
---|
554 | ifeq ($(BUILD_TARGET).$(BUILD_TARGET_ARCH),win.amd64)
|
---|
555 | VBOX_USE_VCC80 ?= 1 # Enforce VCC80 when targetting AMD64.
|
---|
556 | endif
|
---|
557 | ifdef VBOX_USE_VCC80
|
---|
558 | ifeq ($(BUILD_TARGET_ARCH),x86)
|
---|
559 | VBOX_VCC_TOOL := VCC80X86
|
---|
560 | else
|
---|
561 | VBOX_VCC_TOOL := VCC80AMD64
|
---|
562 | endif
|
---|
563 | else
|
---|
564 | VBOX_VCC_TOOL := VCC70
|
---|
565 | endif
|
---|
566 | endif
|
---|
567 |
|
---|
568 | #
|
---|
569 | # The kBuild tools and SDKs are using PATH_DEVTOOLS, PATH_DEVTOOLS_BLD
|
---|
570 | # and PATH_DEVTOOLS_TRG to find things if we give them specific locations.
|
---|
571 | #
|
---|
572 | PATH_DEVTOOLS ?= $(PATH_ROOT)/tools
|
---|
573 | PATH_DEVTOOLS := $(abspath $(PATH_DEVTOOLS))
|
---|
574 | PATH_DEVTOOLS_BLD ?= $(PATH_DEVTOOLS)/$(BUILD_PLATFORM).$(BUILD_PLATFORM_ARCH)
|
---|
575 | PATH_DEVTOOLS_TRG ?= $(PATH_DEVTOOLS)/$(BUILD_TARGET).$(BUILD_TARGET_ARCH)
|
---|
576 |
|
---|
577 | ## @todo Remove the default tool crap here!
|
---|
578 | TOOL = $(VBOX_GCC_TOOL)
|
---|
579 | ifdef VBOX_USE_VCC80
|
---|
580 | TOOL.win.x86 = VCC80X86
|
---|
581 | TOOL.win.amd64 = VCC80AMD64
|
---|
582 | else
|
---|
583 | TOOL.win = VCC70
|
---|
584 | endif
|
---|
585 | ASTOOL = $(VBOX_ASTOOL)
|
---|
586 |
|
---|
587 | #
|
---|
588 | # L4-specific settings.
|
---|
589 | #
|
---|
590 | ifdef L4_DIR
|
---|
591 | ifeq ($(BUILD_TARGET),l4)
|
---|
592 | L4_API ?= l4v2
|
---|
593 | L4_ARCH ?= $(BUILD_TARGET_ARCH)
|
---|
594 | ifeq ($(L4_ARCH),x86)
|
---|
595 | L4_CPU ?= 586
|
---|
596 | L4LINUX26_INCDIR := $(L4LINUX26_DIR)/include \
|
---|
597 | $(L4LINUX26_DIR)/include/asm-l4/i386-arch
|
---|
598 | else ifeq ($(L4_ARCH),amd64)
|
---|
599 | L4_CPU ?= k8
|
---|
600 | L4LINUX26_INCDIR := $(L4LINUX26_DIR)/include
|
---|
601 | # no red zone for L4 because of IPC bindings
|
---|
602 | CFLAGS.l4 = -mno-red-zone
|
---|
603 | CXXFLAGS.l4 = -mno-red-zone
|
---|
604 | else
|
---|
605 | $(error L4_ARCH=$(L4_ARCH))
|
---|
606 | endif
|
---|
607 | L4_OBJ := $(L4_DIR)/build-$(L4_ARCH)-$(L4_CPU)-$(L4_API)
|
---|
608 | # support splitted Linux kernels (make O=<build directory>)
|
---|
609 | kernelsrc := $(shell $(SED_EXT) -ne 's+^KERNELSRC.*= *\(.*\)+\1+p' $(L4LINUX26_DIR)/Makefile)
|
---|
610 | ifneq ($(kernelsrc),)
|
---|
611 | kernelpath := $(realpath $(kernelsrc))
|
---|
612 | L4LINUX26_INCDIR += $(L4LINUX26_DIR)/include2 $(kernelpath)/include
|
---|
613 | endif
|
---|
614 | L4_INCDIR := \
|
---|
615 | $(L4_OBJ)/include/uclibc++ \
|
---|
616 | $(L4_OBJ)/include/$(L4_ARCH)/uclibc \
|
---|
617 | $(L4_OBJ)/include/uclibc \
|
---|
618 | $(L4LINUX26_INCDIR) \
|
---|
619 | $(L4_OBJ)/include/$(L4_ARCH)/$(L4_API) \
|
---|
620 | $(L4_OBJ)/include/$(L4_API) \
|
---|
621 | $(L4_OBJ)/include/$(L4_ARCH) \
|
---|
622 | $(L4_OBJ)/include \
|
---|
623 | $(L4_DIR)/tool/dice/include
|
---|
624 | L4_LIBDIR := \
|
---|
625 | $(L4_DIR)/build-$(L4_ARCH)-$(L4_CPU)-$(L4_API)/lib/$(L4_ARCH)_$(L4_CPU)/$(L4_API)
|
---|
626 | endif # BUILD_TARGET == l4
|
---|
627 | endif # L4_DIR
|
---|
628 |
|
---|
629 | # Produce debugging information that the Fiasco kernel debugger can read.
|
---|
630 | ifeq ($(BUILD_TARGET).$(BUILD_TYPE),l4.debug)
|
---|
631 | DEBUG_L4 = -gstabs+
|
---|
632 | endif
|
---|
633 |
|
---|
634 | #
|
---|
635 | # Setup the global defines and includes.
|
---|
636 | #
|
---|
637 | # Note! The __SOMETHING__ #defines are deprecated as they violate the C/C++ specs.
|
---|
638 | #
|
---|
639 | INCS += $(PATH_ROOT)/include $(PATH_OUT)
|
---|
640 | DEFS += VBOX
|
---|
641 | DEFS.debug := DEBUG DEBUG_$(subst $(subst _, ,_),_,$(USERNAME)) DEBUG_USERNAME=$(subst $(subst _, ,_),_,$(USERNAME))
|
---|
642 | DEFS.profile = VBOX_WITH_STATISTICS
|
---|
643 | DEFS.x86 = RT_ARCH_X86 __X86__
|
---|
644 | DEFS.amd64 = RT_ARCH_AMD64 __AMD64__
|
---|
645 | DEFS.darwin = RT_OS_DARWIN __DARWIN__
|
---|
646 | DEFS.darwin.x86 = VBOX_WITH_HYBIRD_32BIT_KERNEL
|
---|
647 | DEFS.freebsd = RT_OS_FREEBSD __FREEBSD__
|
---|
648 | DEFS.l4 = RT_OS_L4 __L4__ __L4ENV__ L4API_l4v2 ARCH_$(BUILD_TARGET_ARCH) __NO_CTYPE _FILE_OFFSET_BITS=64
|
---|
649 | ifeq ($(L4_API),l4v2onv4)
|
---|
650 | DEFS.l4 += L4API_l4v2onv4 STATIC_L4_INLINE
|
---|
651 | endif
|
---|
652 | DEFS.linux = RT_OS_LINUX __LINUX__ _FILE_OFFSET_BITS=64
|
---|
653 | DEFS.netbsd = RT_OS_NETBSD
|
---|
654 | DEFS.openbsd = RT_OS_OPENBSD
|
---|
655 | DEFS.os2 = RT_OS_OS2 __OS2__
|
---|
656 | DEFS.solaris = RT_OS_SOLARIS
|
---|
657 | DEFS.win = RT_OS_WINDOWS __WIN__
|
---|
658 | DEFS.win.x86 = __WIN32__
|
---|
659 | DEFS.win.amd64 = __WIN64__
|
---|
660 | # optional defines (use environment or make commandline)
|
---|
661 | ifdef VBOX_WITH_DEBUGGER
|
---|
662 | DEFS += VBOX_WITH_DEBUGGER
|
---|
663 | endif
|
---|
664 | ifdef VBOX_WITH_DEBUGGER_GUI
|
---|
665 | DEFS += VBOX_WITH_DEBUGGER_GUI
|
---|
666 | endif
|
---|
667 | ifdef VBOX_WITH_STATISTICS
|
---|
668 | DEFS += VBOX_WITH_STATISTICS
|
---|
669 | endif
|
---|
670 | ifdef VBOX_STRICT
|
---|
671 | DEFS += VBOX_STRICT
|
---|
672 | endif
|
---|
673 | ifdef VBOX_WITHOUT_IDT_PATCHING
|
---|
674 | DEFS += VBOX_WITHOUT_IDT_PATCHING
|
---|
675 | endif
|
---|
676 | ifdef LOG_ENABLED
|
---|
677 | DEFS += LOG_ENABLED
|
---|
678 | endif
|
---|
679 | ifdef VBOX_OSE
|
---|
680 | DEFS += VBOX_OSE
|
---|
681 | endif
|
---|
682 |
|
---|
683 | #
|
---|
684 | # Compiler optimization flags.
|
---|
685 | #
|
---|
686 | ifeq ($(BUILD_TYPE),debug)
|
---|
687 | VBOX_GCC_FP ?= -fno-omit-frame-pointer
|
---|
688 | VBOX_GCC_OPT ?= -O0
|
---|
689 | VBOX_VCC_FP ?= -Oy-
|
---|
690 | VBOX_VCC_OPT ?=
|
---|
691 | VBOX_GCC_GC_FP ?= -fno-omit-frame-pointer
|
---|
692 | VBOX_GCC_GC_OPT ?= -O0
|
---|
693 | VBOX_VCC_GC_FP ?= -Oy-
|
---|
694 | VBOX_VCC_GC_OPT ?=
|
---|
695 | else
|
---|
696 | # We should use -fomit-frame-pointer for GCC / -Oy for VCC.
|
---|
697 | # -funwind-tables provides support for backtraces in gdb then.
|
---|
698 | VBOX_GCC_FP ?= -fno-omit-frame-pointer
|
---|
699 | VBOX_GCC_OPT ?= -O2 $(VBOX_GCC_mtune-generic)
|
---|
700 | VBOX_VCC_FP ?= -Oy-
|
---|
701 | ifdef VBOX_USE_VCC80
|
---|
702 | VBOX_VCC_OPT ?= -O2 -GS-
|
---|
703 | else
|
---|
704 | VBOX_VCC_OPT ?= -Ogitb2
|
---|
705 | endif
|
---|
706 | VBOX_GCC_GC_FP ?= -fno-omit-frame-pointer
|
---|
707 | VBOX_GCC_GC_OPT ?= -O2 $(VBOX_GCC_mtune-generic)
|
---|
708 | VBOX_VCC_GC_FP ?= -Oy-
|
---|
709 | ifdef VBOX_USE_VCC80
|
---|
710 | VBOX_VCC_GC_OPT ?= -O2
|
---|
711 | else
|
---|
712 | VBOX_VCC_GC_OPT ?= -Ogitb2
|
---|
713 | endif
|
---|
714 | endif
|
---|
715 |
|
---|
716 | #
|
---|
717 | # ARCH_BITS_DEFS.
|
---|
718 | #
|
---|
719 | ifeq ($(BUILD_TARGET_ARCH),amd64)
|
---|
720 | ARCH_BITS_DEFS := HC_ARCH_BITS=64 GC_ARCH_BITS=32
|
---|
721 | else ifeq ($(BUILD_TARGET_ARCH),x86)
|
---|
722 | ARCH_BITS_DEFS := HC_ARCH_BITS=32 GC_ARCH_BITS=32
|
---|
723 | else
|
---|
724 | error BUILD_TARGET_ARCH=$(BUILD_TARGET_ARCH)
|
---|
725 | endif
|
---|
726 |
|
---|
727 | #
|
---|
728 | # Add the output dir(s) to the dynamic loader search path.
|
---|
729 | #
|
---|
730 | ifeq ($(filter-out linux l4 freebsd netbsd openbsd solaris,$(BUILD_TARGET)),)
|
---|
731 | export LD_LIBRARY_PATH:=$(PATH_BIN):$(PATH_LIB):$(LD_LIBRARY_PATH)
|
---|
732 | endif
|
---|
733 | ifeq ($(BUILD_TARGET),os2)
|
---|
734 | #fixme! export BEGINLIBPATH:=$(PATH_BIN);$(PATH_LIB);$(BEGINLIBPATH)
|
---|
735 | endif
|
---|
736 | ifeq ($(BUILD_TARGET),win)
|
---|
737 | export PATH:=$(PATH_BIN);$(PATH_LIB);$(PATH)
|
---|
738 | endif
|
---|
739 |
|
---|
740 | #
|
---|
741 | # Common libraries and tools.
|
---|
742 | #
|
---|
743 | ifeq ($(BUILD_TARGET),darwin)
|
---|
744 | LIB_RUNTIME = $(PATH_BIN)/VBoxRT.dylib
|
---|
745 | LIB_RUNTIME_EF = #$(PATH_LIB)/RuntimeEFCPP.a
|
---|
746 | LIB_KPROFILE = $(PATH_BIN)/kPrf2.dylib
|
---|
747 | LIB_VMM = $(PATH_BIN)/VBoxVMM.dylib
|
---|
748 | LIB_VMMGC = $(PATH_BIN)/VMMGC.gc
|
---|
749 | LIB_REM = $(PATH_LIB)/VBoxREMImp.dylib
|
---|
750 | LIB_XPCOM = $(PATH_BIN)/VBoxXPCOM.dylib
|
---|
751 | endif
|
---|
752 | ifeq ($(BUILD_TARGET),l4)
|
---|
753 | LIB_RUNTIME = $(PATH_BIN)/VBoxRT.s.so
|
---|
754 | LIB_RUNTIME_EF = #$(PATH_LIB)/RuntimeEFCPP.a
|
---|
755 | LIB_KPROFILE = $(PATH_BIN)/kPrf2.s.so
|
---|
756 | LIB_VMM = $(PATH_BIN)/VBoxVMM.s.so
|
---|
757 | LIB_VMMGC = $(PATH_BIN)/VMMGC.gc
|
---|
758 | LIB_REM = $(PATH_BIN)/VBoxREMImp.s.so
|
---|
759 | LIB_XPCOM = $(PATH_BIN)/VBoxXPCOM.s.so
|
---|
760 | endif
|
---|
761 | ifeq ($(filter-out linux freebsd netbsd openbsd solaris,$(BUILD_TARGET)),)
|
---|
762 | LIB_RUNTIME = $(PATH_BIN)/VBoxRT.so
|
---|
763 | LIB_RUNTIME_EF = $(PATH_LIB)/RuntimeEFCPP.a
|
---|
764 | LIB_KPROFILE = $(PATH_BIN)/kPrf2.so
|
---|
765 | LIB_VMM = $(PATH_BIN)/VBoxVMM.so
|
---|
766 | LIB_VMMGC = $(PATH_BIN)/VMMGC.gc
|
---|
767 | LIB_REM = $(PATH_BIN)/VBoxREMImp.so
|
---|
768 | LIB_XPCOM = $(PATH_BIN)/VBoxXPCOM.so
|
---|
769 | endif
|
---|
770 | ifeq ($(BUILD_TARGET),os2)
|
---|
771 | LIB_RUNTIME = $(PATH_BIN)/VBoxRT.dll
|
---|
772 | LIB_RUNTIME_EF = #$(PATH_LIB)/RuntimeEFCPP.a
|
---|
773 | LIB_KPROFILE = $(PATH_BIN)/kPrf2.dll
|
---|
774 | LIB_VMM = $(PATH_BIN)/VBoxVMM.dll
|
---|
775 | LIB_VMMGC = $(PATH_LIB)/VMMGCImp.lib
|
---|
776 | LIB_REM = $(PATH_LIB)/VBoxREMImp.lib
|
---|
777 | LIB_XPCOM = $(PATH_BIN)/VBoxXCOM.dll
|
---|
778 | OBJ_SYS0 = $(PATH_OBJ)/src/VBox/Runtime/RuntimeR0/os2/sys0.obj
|
---|
779 | endif
|
---|
780 | ifeq ($(BUILD_TARGET),win)
|
---|
781 | LIB_RUNTIME = $(PATH_LIB)/VBoxRT.lib
|
---|
782 | LIB_RUNTIME_EF = #$(PATH_LIB)/RuntimeEFCPP.lib
|
---|
783 | LIB_KPROFILE = $(PATH_LIB)/kPrf2.lib
|
---|
784 | LIB_VMM = $(PATH_LIB)/VBoxVMM.lib
|
---|
785 | LIB_VMMGC = $(PATH_OUT)/obj/src/VBox/VMM/VMMGC/VMMGC.lib
|
---|
786 | LIB_REM = $(PATH_LIB)/VBoxREMImp.lib
|
---|
787 | LIB_XPCOM = $(PATH_BIN)/VBoxXPCOM.dll
|
---|
788 | endif
|
---|
789 |
|
---|
790 | # The kprofile build automagically links with kProfile.
|
---|
791 | ifeq ($(BUILD_TYPE),kprofile)
|
---|
792 | LIB_RUNTIME += $(LIB_KPROFILE)
|
---|
793 | endif
|
---|
794 |
|
---|
795 | # Overridable libraries (unix).
|
---|
796 | LIB_PTHREAD ?= pthread
|
---|
797 | LIB_XCURSOR ?= Xcursor
|
---|
798 |
|
---|
799 | ## Enable C++ electric fence heap.
|
---|
800 | #LIB_RUNTIME += $(LIB_RUNTIME_EF) $(LIB_RUNTIME)
|
---|
801 |
|
---|
802 | # Intel ASL compiler for ACPI
|
---|
803 | VBOX_IASLCMD ?= $(firstword $(wildcard $(PATH_DEVTOOLS_BLD)/bin/iasl$(HOSTSUFF_EXE)) iasl$(HOSTSUFF_EXE))
|
---|
804 |
|
---|
805 | # Bruce's C compile is a C-compiler for BIOS-related 8086 code
|
---|
806 | VBOX_BCC ?= $(PATH_DEVTOOLS_BLD)/bin/bcc$(HOSTSUFF_EXE) -B $(PATH_DEVTOOLS_BLD)/bin/
|
---|
807 |
|
---|
808 | # Assembler for BIOS-related 8086 code
|
---|
809 | VBOX_AS86 ?= $(PATH_DEVTOOLS_BLD)/bin/as86$(HOSTSUFF_EXE)
|
---|
810 |
|
---|
811 | # libxslt XSLT processor. (see PATH_TOOL_YASM for explanation why it's temporarily located in bin.)
|
---|
812 | ifeq ($(BUILD_PLATFORM),win)
|
---|
813 | # VBOX_XSLTPROC ?= $(PATH_DEVTOOLS)/win.x86/libxslt/10114/xsltproc.exe
|
---|
814 | VBOX_XSLTPROC ?= $(PATH_DEVTOOLS)/win.x86/bin/xsltproc.exe
|
---|
815 | else ifeq ($(BUILD_PLATFORM),os2)
|
---|
816 | VBOX_XSLTPROC ?= $(PATH_DEVTOOLS_BLD)/bin/xsltproc.exe
|
---|
817 | else
|
---|
818 | VBOX_XSLTPROC ?= xsltproc$(HOSTSUFF_EXE)
|
---|
819 | endif
|
---|
820 |
|
---|
821 | # bin2c (convert binary files into C arrays)
|
---|
822 | VBOX_BIN2C ?= $(PATH_OBJ)/src/bldprogs/bin2c/bin2c$(HOSTSUFF_EXE)
|
---|
823 |
|
---|
824 | # mkisofs
|
---|
825 | ifeq ($(BUILD_PLATFORM),win)
|
---|
826 | VBOX_MKISOFS ?= $(PATH_DEVTOOLS_BLD)/bin/mkisofs.exe
|
---|
827 | else
|
---|
828 | VBOX_MKISOFS ?= mkisofs
|
---|
829 | endif
|
---|
830 |
|
---|
831 | # Makeself for the linux installers.
|
---|
832 | VBOX_MAKESELF ?= $(PATH_DEVTOOLS)/common/makeself/v2.1.4_1/makeself.sh
|
---|
833 |
|
---|
834 | # Microsoft HTML Help Workshop.
|
---|
835 | VBOX_PATH_HTML_HELP_WORKSHOP ?= $(PATH_DEVTOOLS)/win.x86/HTML_Help_Workshop/v1.3/
|
---|
836 |
|
---|
837 | # Path to the null soft installer.
|
---|
838 | VBOX_PATH_NSIS ?= $(PATH_DEVTOOLS)/win.x86/nsis/v2.22
|
---|
839 |
|
---|
840 | # Windows install tools...
|
---|
841 | VBOX_PATH_WIX ?= $(PATH_DEVTOOLS)/win.x86/wix/v2.0.4611.0
|
---|
842 | VBOX_PATH_DIFX ?= $(PATH_DEVTOOLS)/win.$(BUILD_TARGET_ARCH)/DIFx/v2.1
|
---|
843 |
|
---|
844 | # We need to export YASM for OSE, but since it was converted to .zip we need to
|
---|
845 | # allow for the location used by the zip to be properly cleaned up first.
|
---|
846 | ifeq ($(filter-out win.x86 linux.x86 solaris.x86, $(BUILD_PLATFORM).$(BUILD_PLATFORM_ARCH)),)
|
---|
847 | PATH_TOOL_YASM ?= $(PATH_DEVTOOLS_BLD)/bin
|
---|
848 | endif
|
---|
849 |
|
---|
850 | # XPCOM setup for all but win32.
|
---|
851 | ifneq ($(BUILD_TARGET),win)
|
---|
852 | VBOX_WITH_XPCOM = 1
|
---|
853 | VBOX_XPIDL ?= $(VBOX_PATH_SDK)/bin/xpidl$(HOSTSUFF_EXE)
|
---|
854 | VBOX_PATH_XPCOM_IDL ?= $(VBOX_PATH_SDK)/idl
|
---|
855 | VBOX_XPCOM_INCS ?= \
|
---|
856 | $(VBOX_PATH_SDK)/include \
|
---|
857 | $(VBOX_PATH_SDK)/include/xpcom \
|
---|
858 | $(VBOX_PATH_SDK)/include/xpcom/nsprpub \
|
---|
859 | $(VBOX_PATH_SDK)/include/xpcom/string \
|
---|
860 | $(VBOX_PATH_SDK)/include/xpcom/xpcom \
|
---|
861 | $(VBOX_PATH_SDK)/include/xpcom/ipcd
|
---|
862 | ifneq ($(BUILD_TARGET),os2)
|
---|
863 | # libIDL-config (for xpcom18a4)
|
---|
864 | ifeq ($(origin VBOX_LIBIDL_CONFIG),undefined)
|
---|
865 | export VBOX_LIBIDL_CONFIG := $(firstword $(shell which libIDL-config-2 libIDL-config 2> /dev/null))
|
---|
866 | endif
|
---|
867 | endif
|
---|
868 | endif
|
---|
869 |
|
---|
870 | ifeq ($(BUILD_TARGET),os2)
|
---|
871 | # search DLLs in the EXE directory first
|
---|
872 | VBOX_XPIDL := BEGINLIBPATH="$(dir $(VBOX_XPIDL));$$BEGINLIBPATH" $(VBOX_XPIDL)
|
---|
873 | endif
|
---|
874 | #$(error $(VBOX_XPIDL))
|
---|
875 |
|
---|
876 | # The X11 LIBPATH. (The amd64 hack is for RHEL4.)
|
---|
877 | ifeq ($(BUILD_TARGET_ARCH),amd64)
|
---|
878 | VBOX_LIBPATH_X11 ?= /usr/X11R6/lib64 /usr/X11R6/lib
|
---|
879 | else
|
---|
880 | VBOX_LIBPATH_X11 ?= /usr/X11R6/lib
|
---|
881 | endif
|
---|
882 |
|
---|
883 | # 32bit X11 LIBPATH for building 32bit guest additions
|
---|
884 | VBOX_LIBPATH32_X11 ?= /usr/X11R6/lib32 /usr/X11R6/lib
|
---|
885 |
|
---|
886 | #
|
---|
887 | # Mac OS X SDK paths.
|
---|
888 | #
|
---|
889 | VBOX_PATH_MACOSX_SDK ?= /Developer/SDKs/MacOSX10.4u.sdk
|
---|
890 | VBOX_PATH_MACOSX_SDK_INCS ?= $(VBOX_PATH_MACOSX_SDK)/Developer/Headers
|
---|
891 |
|
---|
892 |
|
---|
893 | #
|
---|
894 | # GCC stuff properties.
|
---|
895 | # Most of this is resolved on first kmk invocation and cached in PATH_OUT.
|
---|
896 | #
|
---|
897 | # Note! That a harmless warning is printed if the file doesn't exist.
|
---|
898 | # Note! Changes in GCC are not detected automatically (yet).
|
---|
899 | #
|
---|
900 | include $(PATH_KBUILD)/tools/$(VBOX_GCC_TOOL).kmk
|
---|
901 | ifneq ($(VBOX_GCC_TOOL),$(VBOX_GCC32_TOOL))
|
---|
902 | include $(PATH_KBUILD)/tools/$(VBOX_GCC32_TOOL).kmk
|
---|
903 | endif
|
---|
904 |
|
---|
905 | VBOX_GCC_CHECK_CC = $(shell \
|
---|
906 | if $(TOOL_$(VBOX_GCC_TOOL)_CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \
|
---|
907 | then echo "$(1)"; \
|
---|
908 | else echo "$(2)"; fi; )
|
---|
909 |
|
---|
910 | VBOX_GCC_CHECK_CXX = $(shell \
|
---|
911 | if $(TOOL_$(VBOX_GCC_TOOL)_CXX) $(1) -S -o /dev/null -xc++ /dev/null > /dev/null 2>&1; \
|
---|
912 | then echo "$(1)"; \
|
---|
913 | else echo "$(2)"; fi; )
|
---|
914 |
|
---|
915 | VBOX_GCC32_CHECK_CXX = $(shell \
|
---|
916 | if $(TOOL_$(VBOX_GCC32_TOOL)_CXX) $(1) -S -o /dev/null -xc++ /dev/null > /dev/null 2>&1; \
|
---|
917 | then echo "$(1)"; \
|
---|
918 | else echo "$(2)"; fi; )
|
---|
919 |
|
---|
920 | # This is kind of bad, the returned string needs to be re-evaluated before use.
|
---|
921 | # The reason for this hack is that the windows kmk_ash cannot deal with $((1+1)).
|
---|
922 | VBOX_GCC_VERSION = $(shell \
|
---|
923 | $(1) -dumpversion | $(SED_EXT) 's|\([0-9]\)\.\([0-9]\)\.\([0-9]\)|$$(int-add $$(int-mul 10000, \1), $$(int-mul 100, \2), \3)|' )
|
---|
924 |
|
---|
925 | # No $(QUIET) here as it's interesting to see what goes into the file.
|
---|
926 | $(PATH_OUT)/GCCConfig.kmk: $(PATH_ROOT)/Config.kmk $(LOCALCFG) $(AUTOCFG)
|
---|
927 | $(call MSG_GENERATE,,$@,)
|
---|
928 | $(QUIET)$(RM) -f "$@"
|
---|
929 | $(QUIET)$(MKDIR) -p $(@D)
|
---|
930 |
|
---|
931 | @# HC compiler switch detection.
|
---|
932 | $(APPEND) "$@" "VBOX_GCC_VERSION_CC ?= $(call VBOX_GCC_VERSION,$(TOOL_$(VBOX_GCC_TOOL)_CC))"
|
---|
933 | $(APPEND) "$@" "VBOX_GCC_VERSION_CXX ?= $(call VBOX_GCC_VERSION,$(TOOL_$(VBOX_GCC_TOOL)_CXX))"
|
---|
934 | $(APPEND) "$@" "VBOX_GCC_LIBGCC ?= $(shell $(TOOL_$(VBOX_GCC_TOOL)_CC) -print-libgcc-file-name)"
|
---|
935 | $(APPEND) "$@" "VBOX_GCC_Wno-pointer-sign ?= $(call VBOX_GCC_CHECK_CC,-Wno-pointer-sign,)"
|
---|
936 | $(APPEND) "$@" "VBOX_GCC_Wno-variadic-macros ?= $(call VBOX_GCC_CHECK_CXX,-Wno-variadic-macros,)"
|
---|
937 | $(APPEND) "$@" "VBOX_GCC_Wno-invalid-offsetof ?= $(call VBOX_GCC_CHECK_CXX,-Wno-invalid-offsetof,)"
|
---|
938 | $(APPEND) "$@" "VBOX_GCC_Wno-extra ?= $(call VBOX_GCC_CHECK_CXX,-Wno-extra)"
|
---|
939 | $(APPEND) "$@" "VBOX_GCC_fno-stack-protector ?= $(call VBOX_GCC_CHECK_CC,-fno-stack-protector,)"
|
---|
940 | @# Produce code optimized for the most common IA32/AMD64/EM64T processors. Introduced with gcc version 4.2.
|
---|
941 | $(APPEND) "$@" "VBOX_GCC_mtune-generic ?= $(call VBOX_GCC_CHECK_CC,-mtune=generic,)"
|
---|
942 | ifneq ($(BUILD_TARGET),l4)
|
---|
943 | @# Set default attribute for ELF and MACH-O symbols to ``hidden'' to reduce the number
|
---|
944 | @# of relocation entries and PLT indirections in shared libraries. Don't allow for gcc version < 4.
|
---|
945 | $(APPEND) "$@" "ifneq ($$(VBOX_GCC_VERSION_CC),)"
|
---|
946 | $(APPEND) "$@" " ifneq ($$(int-ge $$(VBOX_GCC_VERSION_CC),40000),)"
|
---|
947 | $(APPEND) "$@" " VBOX_GCC_fvisibility-hidden ?= $(call VBOX_GCC_CHECK_CC,-fvisibility=hidden -DVBOX_HAVE_VISIBILITY_HIDDEN,)"
|
---|
948 | $(APPEND) "$@" " endif"
|
---|
949 | $(APPEND) "$@" "endif"
|
---|
950 | endif
|
---|
951 | ifneq ($(BUILD_TARGET),l4)
|
---|
952 | @# Set default attribute for inline functions to ``hidden'' to reduce the number
|
---|
953 | @# of relocation entries and PLT indirections in shared libraries. Don't allow for gcc version < 4.
|
---|
954 | $(APPEND) "$@" "ifneq ($$(VBOX_GCC_VERSION_CXX),)"
|
---|
955 | $(APPEND) "$@" " ifneq ($$(int-ge $$(VBOX_GCC_VERSION_CXX),40000),)"
|
---|
956 | $(APPEND) "$@" " VBOX_GCC_fvisibility-inlines-hidden ?= $(call VBOX_GCC_CHECK_CXX,-fvisibility-inlines-hidden,)"
|
---|
957 | $(APPEND) "$@" " endif"
|
---|
958 | $(APPEND) "$@" "endif"
|
---|
959 | endif
|
---|
960 | @# Find the compiler includes for IPRT no-crt.
|
---|
961 | @# Note that `$(dir $(gcc -print-libgcc-file-name))/include does not work for a 64-bit cross build on a 32-bit build host.
|
---|
962 | $(APPEND) "$@" "VBOX_PATH_GCC_INCS ?= $(shell LC_ALL=C $(TOOL_$(VBOX_GCC_TOOL)_CC) -print-search-dirs|$(SED_EXT) -ne 's+^install: \(.*[^/][^/]*\)/+\1+p')/include"
|
---|
963 |
|
---|
964 | @# 32-bit (GC) compiler switch detection.
|
---|
965 | $(APPEND) "$@" "VBOX_GCC32_VERSION_CC ?= $(call VBOX_GCC_VERSION,$(TOOL_$(VBOX_GCC32_TOOL)_CC))"
|
---|
966 | $(APPEND) "$@" "VBOX_GCC32_VERSION_CXX ?= $(call VBOX_GCC_VERSION,$(TOOL_$(VBOX_GCC32_TOOL)_CXX))"
|
---|
967 | $(APPEND) "$@" "VBOX_GCC32_LIBGCC ?= $(shell $(TOOL_$(VBOX_GCC32_TOOL)_CC) -print-libgcc-file-name)"
|
---|
968 | $(APPEND) "$@" "VBOX_GCC32_Wno-variadic-macros ?= $(call VBOX_GCC32_CHECK_CXX,-Wno-variadic-macros,)"
|
---|
969 |
|
---|
970 | include $(PATH_OUT)/GCCConfig.kmk
|
---|
971 |
|
---|
972 |
|
---|
973 | #
|
---|
974 | # Coding Signing.
|
---|
975 | #
|
---|
976 | ifdef VBOX_SIGNING_MODE
|
---|
977 | ifeq ($(BUILD_PLATFORM),win)
|
---|
978 | # VBOX_PATH_SELFSIGN points to the Vista WDK bin/SelfSign directory.
|
---|
979 | ifndef VBOX_PATH_SELFSIGN
|
---|
980 | VBOX_PATH_SELFSIGN := $(lastword $(sort $(wildcard $(PATH_DEVTOOLS)/win.x86/selfsign/*)))
|
---|
981 | ifeq ($(VBOX_PATH_SELFSIGN),)
|
---|
982 | VBOX_PATH_SELFSIGN := $(PATH_DEVTOOLS)/win.x86/selfsign/r1
|
---|
983 | endif
|
---|
984 | endif
|
---|
985 | VBOX_SIGNTOOL ?= $(VBOX_PATH_SELFSIGN)/SignTool.exe
|
---|
986 | VBOX_INF2CAT ?= $(VBOX_PATH_SELFSIGN)/Inf2Cat.exe
|
---|
987 |
|
---|
988 | # There are two signing modes; 'self' and 'release'.
|
---|
989 | ifeq ($(strip $(VBOX_SIGNING_MODE)),self)
|
---|
990 | ## @todo
|
---|
991 | else ifeq ($(strip $(VBOX_SIGNING_MODE)),release)
|
---|
992 | VBOX_CROSS_CERTIFICATE_FILE ?= $(VBOX_PATH_SELFSIGN)/MSCV-GlobalSign.cer
|
---|
993 | VBOX_CROSS_CERTIFICATE_FILE_ARGS ?= /ac "$(VBOX_CROSS_CERTIFICATE_FILE)"
|
---|
994 | VBOX_CERTIFICATE_SUBJECT_NAME ?= InnoTek Systemberatung GmbH
|
---|
995 | VBOX_CERTIFICATE_SUBJECT_NAME_ARGS ?= /n "$(VBOX_CERTIFICATE_SUBJECT_NAME)"
|
---|
996 | VBOX_CERTIFICATE_STORE ?= my
|
---|
997 | VBOX_CERTIFICATE_STORE_ARGS ?= /s "$(VBOX_CERTIFICATE_STORE)"
|
---|
998 | VBOX_TSA_URL ?= http://timestamp.verisign.com/scripts/timestamp.dll
|
---|
999 | VBOX_TSA_URL_ARGS ?= /t "$(VBOX_TSA_URL)"
|
---|
1000 | ## Commands for signing a driver image after link.
|
---|
1001 | VBOX_SIGN_DRIVER_CMDS ?= $(if $(eq $(tool_do),LINK_LIBRARY),,$(call VBOX_SIGN_FILE_FN,$(out)))
|
---|
1002 | ## Commands for signing an executable or a dll image after link.
|
---|
1003 | VBOX_SIGN_IMAGE_CMDS ?= $(if $(eq $(tool_do),LINK_LIBRARY),,$(call VBOX_SIGN_FILE_FN,$(out)))
|
---|
1004 | ## Sign a file.
|
---|
1005 | # @param 1 The file to sign.
|
---|
1006 | VBOX_SIGN_FILE_FN ?= $(VBOX_SIGNTOOL) sign \
|
---|
1007 | $(VBOX_CROSS_CERTIFICATE_FILE_ARGS) \
|
---|
1008 | $(VBOX_CERTIFICATE_STORE_ARGS) \
|
---|
1009 | $(VBOX_CERTIFICATE_SUBJECT_NAME_ARGS) \
|
---|
1010 | $(VBOX_TSA_URL_ARGS) \
|
---|
1011 | $(1)
|
---|
1012 | ## Create a security catalog file.
|
---|
1013 | # @param 1 The directory containing the stuff to sign.
|
---|
1014 | # @param 2 The expected .cat name. (Inf2Cat lowercases it)
|
---|
1015 | # @param 3 The list of OSes, separated by ';'.
|
---|
1016 | VBOX_MAKE_CAT_HLP_FN ?= \
|
---|
1017 | $(RM) -f $(2)\
|
---|
1018 | $(NL)$(TAB)$(VBOX_INF2CAT) /driver:$(strip $(1)) /os:$(strip $(subst ;,$(COMMA),$(3))) /verbose \
|
---|
1019 | $(NL)$(TAB)$(MV) $(2) $(2) \
|
---|
1020 | $(NL)$(TAB)$(call VBOX_SIGN_FILE_FN,$(2))
|
---|
1021 | VBOX_MAKE_CAT64_FN ?= $(call VBOX_MAKE_CAT_HLP_FN,$(1),$(2),XP_X64;Server2003_X64;Vista_X64)
|
---|
1022 | VBOX_MAKE_CAT32_FN ?= $(call VBOX_MAKE_CAT_HLP_FN,$(1),$(2),2000;XP_X86;Server2003_X86;Vista_X86)
|
---|
1023 | ifeq ($(BUILD_TARGET_ARCH),x86)
|
---|
1024 | VBOX_MAKE_CAT_FN ?= $(call VBOX_MAKE_CAT32_FN,$(1),$(2))
|
---|
1025 | else
|
---|
1026 | VBOX_MAKE_CAT_FN ?= $(call VBOX_MAKE_CAT64_FN,$(1),$(2))
|
---|
1027 | endif
|
---|
1028 |
|
---|
1029 | # Enable signing of the additions.
|
---|
1030 | VBOX_SIGN_ADDITIONS ?= 1
|
---|
1031 |
|
---|
1032 | else
|
---|
1033 | $(error Unknown VBOX_SIGNING_MODE: $(VBOX_SIGNING_MODE))
|
---|
1034 | endif
|
---|
1035 | else
|
---|
1036 | VBOX_SIGNING_MODE :=
|
---|
1037 | endif
|
---|
1038 | endif
|
---|
1039 |
|
---|
1040 | #
|
---|
1041 | # Windows .inf editing.
|
---|
1042 | #
|
---|
1043 | ifeq ($(BUILD_TARGET_ARCH),x86)
|
---|
1044 | VBOX_EDIT_INF_FN = $(call VBOX_EDIT_INF32_FN,$(1),$(2))
|
---|
1045 | else
|
---|
1046 | VBOX_EDIT_INF_FN = $(call VBOX_EDIT_INF64_FN,$(1),$(2))
|
---|
1047 | endif
|
---|
1048 | ## Edit an inf file an x86 target.
|
---|
1049 | # @param 1 The inf file to edit.
|
---|
1050 | # @param 2 The output file.
|
---|
1051 | VBOX_EDIT_INF32_FN = $(SED) $(if $(VBOX_SIGNING_MODE),-e 's/^;cat *//', -e '/^;cat /d') -e 's/^;x86 *//' -e '/^;amd64 /d' $(1) > $(2)
|
---|
1052 | ## Edit an inf file an x86 target.
|
---|
1053 | # @param 1 The inf file to edit.
|
---|
1054 | # @param 2 The output file.
|
---|
1055 | VBOX_EDIT_INF64_FN = $(SED) $(if $(VBOX_SIGNING_MODE),-e 's/^;cat *//', -e '/^;cat /d') -e 's/^;amd64 *//' -e '/^;x86 /d' $(1) > $(2)
|
---|
1056 |
|
---|
1057 | #
|
---|
1058 | # Default prefixes and suffixes.
|
---|
1059 | #
|
---|
1060 | VBOX_PREF_LIB =
|
---|
1061 | ifeq ($(filter-out win os2,$(BUILD_TARGET)),)
|
---|
1062 | VBOX_SUFF_LIB = .lib
|
---|
1063 | else
|
---|
1064 | VBOX_SUFF_LIB = .a
|
---|
1065 | endif
|
---|
1066 | VBOX_SUFF_DLL = $(SUFF_DLL)
|
---|
1067 | ifeq ($(BUILD_TARGET),os2) # GXX3OMF produces out .o at the moment.
|
---|
1068 | VBOX_SUFF_OBJ = .o
|
---|
1069 | else
|
---|
1070 | VBOX_SUFF_OBJ = $(SUFF_OBJ)
|
---|
1071 | endif
|
---|
1072 | VBOXW32GUEST_SUFF_LIB = .lib
|
---|
1073 | VBOXLNX32GUEST_SUFF_LIB = .a
|
---|
1074 |
|
---|
1075 | #
|
---|
1076 | # SDKs for external libraries.
|
---|
1077 | #
|
---|
1078 | SDK_VBOX_XERCES = .
|
---|
1079 | SDK_VBOX_XERCES_INCS ?= $(PATH_ROOT)/src/libs/xerces-2.6.0/src
|
---|
1080 | SDK_VBOX_XERCES_LIBS ?= $(PATH_LIB)/VBox-xerces$(VBOX_SUFF_LIB)
|
---|
1081 |
|
---|
1082 | SDK_VBOX_XALAN = .
|
---|
1083 | SDK_VBOX_XALAN_INCS ?= $(PATH_ROOT)/src/libs/xalan-1.10.0
|
---|
1084 | SDK_VBOX_XALAN_LIBS ?= $(PATH_LIB)/VBox-xalan$(VBOX_SUFF_LIB)
|
---|
1085 |
|
---|
1086 | SDK_VBOX_LIBPNG = .
|
---|
1087 | SDK_VBOX_LIBPNG_INCS ?= $(PATH_ROOT)/src/libs/libpng-1.2.8
|
---|
1088 | SDK_VBOX_LIBPNG_LIBS ?= $(PATH_LIB)/VBox-libpng$(VBOX_SUFF_LIB)
|
---|
1089 |
|
---|
1090 | SDK_VBOX_ZLIB = .
|
---|
1091 | ifeq ($(filter-out win os2,$(BUILD_TARGET)),)
|
---|
1092 | SDK_VBOX_ZLIB_INCS ?= $(PATH_ROOT)/src/libs/zlib-1.2.1
|
---|
1093 | SDK_VBOX_ZLIB_LIBS ?= $(PATH_LIB)/VBox-zlib$(VBOX_SUFF_LIB)
|
---|
1094 | else
|
---|
1095 | SDK_VBOX_ZLIB_INCS ?=
|
---|
1096 | SDK_VBOX_ZLIB_LIBS ?= z
|
---|
1097 | endif
|
---|
1098 |
|
---|
1099 | SDK_VBOX_OPENSSL = .
|
---|
1100 | SDK_VBOX_OPENSSL_INCS?= $(PATH_ROOT)/src/libs/openssl-0.9.7e/include
|
---|
1101 | SDK_VBOX_OPENSSL_LIBS?= $(PATH_LIB)/VBox-libcrypto$(VBOX_SUFF_LIB)
|
---|
1102 |
|
---|
1103 | SDK_VBOX_FFMPEG = .
|
---|
1104 | ifeq ($(filter-out win os2 darwin,$(BUILD_TARGET)),)
|
---|
1105 | SDK_VBOX_FFMPEG_INCS ?= \
|
---|
1106 | $(PATH_ROOT)/src/libs/ffmpeg-20060710/libavutil \
|
---|
1107 | $(PATH_ROOT)/src/libs/ffmpeg-20060710/libavcodec \
|
---|
1108 | $(PATH_ROOT)/src/libs/ffmpeg-20060710/libavformat
|
---|
1109 | ifeq ($(BUILD_TARGET),win)
|
---|
1110 | ## @todo Michael! Where is $(PATH_LIB)/VBoxFFmpegImp$(VBOX_SUFF_LIB) supposed to come from?
|
---|
1111 | #SDK_VBOX_FFMPEG_LIBS ?= $(PATH_LIB)/VBoxFFmpeg.a
|
---|
1112 | SDK_VBOX_FFMPEG_LIBS ?= $(PATH_LIB)/VBoxFFmpegImp.lib
|
---|
1113 | else
|
---|
1114 | SDK_VBOX_FFMPEG_LIBS ?= $(PATH_BIN)/VBoxFFmpeg$(SUFF_DLL)
|
---|
1115 | endif
|
---|
1116 | else
|
---|
1117 | SDK_VBOX_FFMPEG_INCS ?= /usr/include/ffmpeg /usr/include/libpng
|
---|
1118 | SDK_VBOX_FFMPEG_LIBS ?= avutil avcodec avformat
|
---|
1119 | endif
|
---|
1120 |
|
---|
1121 | #
|
---|
1122 | # Special SDK for the problematic NTDLL.LIB.
|
---|
1123 | #
|
---|
1124 | SDK_VBOX_NTDLL = Requires W2K3DDK
|
---|
1125 | SDK_VBOX_NTDLL_LIBS ?= $(PATH_SDK_W2K3DDK_LIB)/ntdll.lib
|
---|
1126 |
|
---|
1127 |
|
---|
1128 | #
|
---|
1129 | # Qt build tools and libraries.
|
---|
1130 | # For *NIX we require it to be present on the system.
|
---|
1131 | #
|
---|
1132 | ## @todo convert this into SDK and integrate the Qt stuff into kBuild.
|
---|
1133 | ifeq ($(BUILD_TARGET),win)
|
---|
1134 | ifeq ($(BUILD_TARGET_ARCH),x86)
|
---|
1135 | VBOX_PATH_QT ?= $(PATH_DEVTOOLS_TRG)/qt/v3.3.3
|
---|
1136 | LIB_QT ?= $(VBOX_PATH_QT)/lib/dynamic/qt-mt333.lib
|
---|
1137 | LIB_QTMAIN ?= $(VBOX_PATH_QT)/lib/dynamic/qtmain.lib
|
---|
1138 | else
|
---|
1139 | VBOX_PATH_QT ?= $(PATH_DEVTOOLS_TRG)/qt/v3.3.8
|
---|
1140 | LIB_QT ?= $(VBOX_PATH_QT)/lib/qt-mt338.lib
|
---|
1141 | LIB_QTMAIN ?= $(VBOX_PATH_QT)/lib/qtmain.lib
|
---|
1142 | endif
|
---|
1143 | ifndef QTDIR
|
---|
1144 | QTDIR := $(sort $(wildcard $(PATH_DEVTOOLS_BLD)/v*))
|
---|
1145 | QTDIR := $(call lastword,$(QTDIR))
|
---|
1146 | endif
|
---|
1147 | else ifeq ($(BUILD_TARGET),os2)
|
---|
1148 | QTDIR ?= $(PATH_DEVTOOLS_TRG)/qt/v3.3.1
|
---|
1149 | VBOX_PATH_QT ?= $(QTDIR)
|
---|
1150 | LIB_QT ?= $(lastword $(sort $(wildcard $(VBOX_PATH_QT)/lib/qt331*.lib)))
|
---|
1151 | QTDIR := $(VBOX_PATH_QT)
|
---|
1152 | else ifeq ($(BUILD_TARGET),darwin)
|
---|
1153 | ifndef VBOX_PATH_QT
|
---|
1154 | VBOX_PATH_QT := $(lastword $(sort $(wildcard $(PATH_DEVTOOLS_TRG)/qt/v3.*)))
|
---|
1155 | VBOX_PATH_QT ?= $(PATH_DEVTOOLS_TRG)/qt/v3.3.8-r1
|
---|
1156 | endif
|
---|
1157 | LIB_QT ?= $(VBOX_PATH_QT)/lib/libqt-mt.3.dylib
|
---|
1158 | LIB_QTMAIN ?= $(NO_SUCH_VARIABLE)
|
---|
1159 | ifndef QTDIR
|
---|
1160 | QTDIR := $(sort $(wildcard $(PATH_DEVTOOLS_BLD)/v*))
|
---|
1161 | QTDIR := $(call lastword,$(QTDIR))
|
---|
1162 | endif
|
---|
1163 | else
|
---|
1164 | ifndef QTDIR
|
---|
1165 | # This is a pretty safe shot.
|
---|
1166 | export QTDIR := $(wildcard /usr/share/qt3)
|
---|
1167 | endif
|
---|
1168 | endif
|
---|
1169 | ifndef VBOX_PATH_QT
|
---|
1170 | VBOX_PATH_QT ?= $(QTDIR)
|
---|
1171 | LIB_QT ?= qt-mt
|
---|
1172 | endif
|
---|
1173 | ifeq ($(BUILD_PLATFORM),$(BUILD_TARGET))
|
---|
1174 | VBOX_PATH_QT_HOST ?= $(VBOX_PATH_QT)
|
---|
1175 | else
|
---|
1176 | VBOX_PATH_QT_HOST ?= $(QTDIR)
|
---|
1177 | endif
|
---|
1178 | VBOX_UIC ?= $(VBOX_PATH_QT_HOST)/bin/uic$(HOSTSUFF_EXE)
|
---|
1179 | VBOX_MOC ?= $(VBOX_PATH_QT_HOST)/bin/moc$(HOSTSUFF_EXE)
|
---|
1180 | VBOX_LUPDATE ?= $(VBOX_PATH_QT_HOST)/bin/lupdate$(HOSTSUFF_EXE)
|
---|
1181 | VBOX_LRELEASE ?= $(VBOX_PATH_QT_HOST)/bin/lrelease$(HOSTSUFF_EXE)
|
---|
1182 |
|
---|
1183 | ifeq ($(BUILD_TARGET),os2)
|
---|
1184 | # search DLLs in the EXE directory first
|
---|
1185 | VBOX_UIC := BEGINLIBPATH="$(dir $(VBOX_UIC));$$BEGINLIBPATH" $(VBOX_UIC)
|
---|
1186 | VBOX_MOC := BEGINLIBPATH="$(dir $(VBOX_MOC));$$BEGINLIBPATH" $(VBOX_MOC)
|
---|
1187 | VBOX_LUPDATE := BEGINLIBPATH="$(dir $(VBOX_LUPDATE));$$BEGINLIBPATH" $(VBOX_LUPDATE)
|
---|
1188 | VBOX_LRELEASE := BEGINLIBPATH="$(dir $(VBOX_LRELEASE));$$BEGINLIBPATH" $(VBOX_LRELEASE)
|
---|
1189 | endif
|
---|
1190 |
|
---|
1191 | #
|
---|
1192 | # The linux kernel headers(/sources).
|
---|
1193 | #
|
---|
1194 | ifneq ($(filter linux,$(BUILD_TARGET)),)
|
---|
1195 | ifeq ($(origin VBOX_LINUX_SRC),undefined)
|
---|
1196 | ifneq ($(wildcard /lib/modules/$(shell uname -r)/build/include/linux/autoconf.h),)
|
---|
1197 | export VBOX_LINUX_SRC := /lib/modules/$(shell uname -r)/build
|
---|
1198 | else
|
---|
1199 | export VBOX_LINUX_SRC := /usr/src/linux
|
---|
1200 | endif
|
---|
1201 | endif
|
---|
1202 | ifeq ($(origin VBOX_LINUX_INCS),undefined)
|
---|
1203 | export VBOX_LINUX_INCS := $(VBOX_LINUX_SRC)/include
|
---|
1204 | # support splitted Linux kernels (make O=<build directory>)
|
---|
1205 | kernelsrc := $(shell $(SED_EXT) -ne 's+^KERNELSRC.*= *\(.*\)+\1+p' $(VBOX_LINUX_SRC)/Makefile)
|
---|
1206 | ifneq ($(kernelsrc),)
|
---|
1207 | kernelpath := $(realpath $(VBOX_LINUX_SRC)/$(kernelsrc))
|
---|
1208 | VBOX_LINUX_INCS += $(VBOX_LINUX_SRC)/include2 $(kernelpath)/include
|
---|
1209 | else
|
---|
1210 | kernelpath := $(VBOX_LINUX_SRC)
|
---|
1211 | endif
|
---|
1212 | ifeq ($(BUILD_TARGET_ARCH),x86)
|
---|
1213 | VBOX_LINUX_INCS += $(kernelpath)/include/asm-i386/mach-default
|
---|
1214 | endif
|
---|
1215 | endif
|
---|
1216 | endif
|
---|
1217 |
|
---|
1218 |
|
---|
1219 | #
|
---|
1220 | # Template for building GC things.
|
---|
1221 | #
|
---|
1222 | TEMPLATE_VBOXGC = VBox GC
|
---|
1223 | TEMPLATE_VBOXGC_ASTOOL = $(VBOX_ASTOOL)
|
---|
1224 | TEMPLATE_VBOXGC_ASFLAGS = $(VBOX_ASFLAGS32)
|
---|
1225 | TEMPLATE_VBOXGC_DEFS = IN_GC $(ARCH_BITS_DEFS)
|
---|
1226 | TEMPLATE_VBOXGC_SYSSUFF = .gc
|
---|
1227 | TEMPLATE_VBOXGC_BLD_TRG_ARCH = x86
|
---|
1228 |
|
---|
1229 | ifeq ($(VBOX_LDR_FMT32),pe)
|
---|
1230 | ifdef VBOX_USE_VCC80
|
---|
1231 | TEMPLATE_VBOXGC_TOOL = VCC80X86
|
---|
1232 | TEMPLATE_VBOXGC_CXXFLAGS = -Zi -Zl -GR- -GS- -EHs-c- -GF- -W3 -wd4244 -wd4996 -Zc:wchar_t- -Gs8192 $(VBOX_VCC_GC_OPT) $(VBOX_VCC_GC_FP)
|
---|
1233 | else
|
---|
1234 | TEMPLATE_VBOXGC_TOOL = VCC70
|
---|
1235 | TEMPLATE_VBOXGC_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -W3 -wd4244 $(VBOX_VCC_GC_OPT) $(VBOX_VCC_GC_FP)
|
---|
1236 | endif
|
---|
1237 | TEMPLATE_VBOXGC_CFLAGS = $(TEMPLATE_VBOXGC_CXXFLAGS)
|
---|
1238 | TEMPLATE_VBOXGC_LDFLAGS = -Driver -Subsystem:NATIVE -Incremental:NO -Align:32 -MapInfo:Lines -MapInfo:Exports -NoD
|
---|
1239 | ifdef VBOX_USE_VCC80
|
---|
1240 | include $(PATH_KBUILD)/sdks/W2K3DDKX86.kmk
|
---|
1241 | TEMPLATE_VBOXGC_LIBS = \
|
---|
1242 | $(PATH_SDK_W2K3DDKX86_LIB)/int64.lib
|
---|
1243 | else
|
---|
1244 | TEMPLATE_VBOXGC_LIBS = \
|
---|
1245 | $(PATH_TOOL_VCC70_LIB)/libcmt.lib # for 64-bit int
|
---|
1246 | endif
|
---|
1247 | endif
|
---|
1248 |
|
---|
1249 | ifeq ($(VBOX_LDR_FMT32),elf)
|
---|
1250 | TEMPLATE_VBOXGC_TOOL = $(VBOX_GCC32_TOOL)
|
---|
1251 | TEMPLATE_VBOXGC_CXXFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC32_Wno-variadic-macros) -pipe -fno-exceptions -fno-rtti $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -fno-strict-aliasing $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden)
|
---|
1252 | TEMPLATE_VBOXGC_CFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC32_Wno-variadic-macros) -pipe -Wmissing-prototypes -Wstrict-prototypes $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -fno-strict-aliasing $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_fvisibility-hidden)
|
---|
1253 | ifeq ($(BUILD_TARGET),solaris)
|
---|
1254 | TEMPLATE_VBOXGC_LDFLAGS = -r
|
---|
1255 | else
|
---|
1256 | TEMPLATE_VBOXGC_LDFLAGS = -nostdlib -Bsymbolic
|
---|
1257 | # temporarily, must fix the loader.
|
---|
1258 | TEMPLATE_VBOXGC_LDFLAGS += $(if $(VBOX_DO_STRIP_MODULES),-S,)
|
---|
1259 | TEMPLATE_VBOXGC_LDFLAGS.release = $(if $(VBOX_DO_STRIP_MODULES),-S,)
|
---|
1260 | endif
|
---|
1261 | ifneq ($(BUILD_TARGET),solaris)
|
---|
1262 | TEMPLATE_VBOXGC_LIBS = \
|
---|
1263 | $(VBOX_GCC32_LIBGCC) # instricts
|
---|
1264 | endif
|
---|
1265 | endif
|
---|
1266 |
|
---|
1267 | ifeq ($(VBOX_LDR_FMT32),macho)
|
---|
1268 | TEMPLATE_VBOXGC_TOOL = GXX4MACHO
|
---|
1269 | TEMPLATE_VBOXGC_CXXFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC32_Wno-variadic-macros) -pipe -fno-common -msoft-float -static -fno-exceptions -fno-rtti $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -fno-strict-aliasing
|
---|
1270 | TEMPLATE_VBOXGC_CFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC32_Wno-variadic-macros) -pipe -fno-common -msoft-float -static -Wno-trigraphs -Wmissing-prototypes -Wstrict-prototypes $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -fno-strict-aliasing
|
---|
1271 | TEMPLATE_VBOXGC_LDFLAGS = -nostdlib
|
---|
1272 | #TEMPLATE_VBOXGC_LDFLAGS.release = -Wl,-S ???
|
---|
1273 | endif
|
---|
1274 |
|
---|
1275 | ifeq ($(VBOX_LDR_FMT32),lx)
|
---|
1276 | TEMPLATE_VBOXGC_TOOL = GXX3OMF
|
---|
1277 | TEMPLATE_VBOXGC_CXXFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC32_Wno-variadic-macros) -pipe -fno-exceptions -fno-rtti $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -fno-strict-aliasing
|
---|
1278 | TEMPLATE_VBOXGC_CFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC32_Wno-variadic-macros) -pipe -Wmissing-prototypes -Wstrict-prototypes $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -fno-strict-aliasing
|
---|
1279 | TEMPLATE_VBOXGC_LDFLAGS = -Zdll -nostdlib
|
---|
1280 | TEMPLATE_VBOXGC_LIBS = \
|
---|
1281 | $(VBOX_GCC32_LIBGCC) \
|
---|
1282 | $(OBJ_SYS0) \
|
---|
1283 | end
|
---|
1284 | endif
|
---|
1285 |
|
---|
1286 |
|
---|
1287 | #
|
---|
1288 | # Template for building a GC ring-3 testcase (tstVMStructGC, tstDevStructGC).
|
---|
1289 | #
|
---|
1290 | TEMPLATE_VBOXGCEXE = VBox GC as ring-3 testcase
|
---|
1291 | TEMPLATE_VBOXGCEXE_EXTENDS = VBOXGC
|
---|
1292 |
|
---|
1293 | ifeq ($(VBOX_LDR_FMT32),pe)
|
---|
1294 | TEMPLATE_VBOXGCEXE_LDFLAGS = -Incremental:NO -MapInfo:Exports -NoD -Debug
|
---|
1295 | TEMPLATE_VBOXGCEXE_SDKS = WIN32SDK
|
---|
1296 | ifdef VBOX_USE_VCC80
|
---|
1297 | TEMPLATE_VBOXGCEXE_LIBS = \
|
---|
1298 | $(PATH_TOOL_VCC80X86_LIB)/libcmt.lib \
|
---|
1299 | $(PATH_TOOL_VCC80X86_LIB)/oldnames.lib
|
---|
1300 | else
|
---|
1301 | TEMPLATE_VBOXGCEXE_LIBS = \
|
---|
1302 | $(PATH_TOOL_VCC70_LIB)/libcmt.lib \
|
---|
1303 | $(PATH_TOOL_VCC70_LIB)/oldnames.lib
|
---|
1304 | endif
|
---|
1305 | endif
|
---|
1306 |
|
---|
1307 | ifeq ($(VBOX_LDR_FMT32),elf)
|
---|
1308 | TEMPLATE_VBOXGCEXE_LDFLAGS = -g
|
---|
1309 | TEMPLATE_VBOXGCEXE_LDFLAGS.release = -g
|
---|
1310 | endif
|
---|
1311 |
|
---|
1312 | ifeq ($(VBOX_LDR_FMT32),macho)
|
---|
1313 | TEMPLATE_VBOXGCEXE_CFLAGS = $(filter-out -static,$(TEMPLATE_VBOXGC_CFLAGS))
|
---|
1314 | TEMPLATE_VBOXGCEXE_CXXFLAGS = $(filter-out -static,$(TEMPLATE_VBOXGC_CXXFLAGS))
|
---|
1315 | TEMPLATE_VBOXGCEXE_LDFLAGS = -g
|
---|
1316 | endif
|
---|
1317 |
|
---|
1318 | ifeq ($(VBOX_LDR_FMT32),lx)
|
---|
1319 | TEMPLATE_VBOXGCEXE_LDFLAGS = -g
|
---|
1320 | TEMPLATE_VBOXGCEXE_LIBS = $(NO_SUCH_VARIABLE)
|
---|
1321 | endif
|
---|
1322 |
|
---|
1323 |
|
---|
1324 | #
|
---|
1325 | # Template for building R0 things.
|
---|
1326 | #
|
---|
1327 | TEMPLATE_VBOXR0 = VBox Ring 0
|
---|
1328 | TEMPLATE_VBOXR0_ASTOOL = $(VBOX_ASTOOL)
|
---|
1329 | TEMPLATE_VBOXR0_ASFLAGS = $(VBOX_ASFLAGS)
|
---|
1330 | TEMPLATE_VBOXR0_DEFS = IN_RING0 $(ARCH_BITS_DEFS)
|
---|
1331 |
|
---|
1332 | ifeq ($(VBOX_LDR_FMT),pe)
|
---|
1333 | TEMPLATE_VBOXR0_TOOL = $(VBOX_VCC_TOOL)
|
---|
1334 | ifdef VBOX_USE_VCC80
|
---|
1335 | TEMPLATE_VBOXR0_CXXFLAGS = -Zi -Zl -GR- -GS- -EHs-c- -GF- -W3 -wd4244 -wd4996 -Zc:wchar_t- $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
|
---|
1336 | else
|
---|
1337 | TEMPLATE_VBOXR0_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -W3 -wd4244 $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
|
---|
1338 | endif
|
---|
1339 | TEMPLATE_VBOXR0_CFLAGS = $(TEMPLATE_VBOXR0_CXXFLAGS)
|
---|
1340 | TEMPLATE_VBOXR0_LDFLAGS = -Driver -Subsystem:NATIVE -Incremental:NO -Align:32 -MapInfo:Exports -NoD
|
---|
1341 | ifdef VBOX_USE_VCC80
|
---|
1342 | TEMPLATE_VBOXR0_LIBS.x86 = \
|
---|
1343 | $(PATH_SDK_W2K3DDKX86_LIB)/int64.lib
|
---|
1344 | else
|
---|
1345 | TEMPLATE_VBOXR0_LIBS.x86 = \
|
---|
1346 | $(PATH_TOOL_VCC70_LIB)/libcmt.lib # for 64-bit int
|
---|
1347 | endif
|
---|
1348 | endif # pe
|
---|
1349 |
|
---|
1350 | ifeq ($(VBOX_LDR_FMT),elf)
|
---|
1351 | TEMPLATE_VBOXR0_TOOL = $(VBOX_GCC_TOOL)
|
---|
1352 | TEMPLATE_VBOXR0_CFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC_Wno-variadic-macros) -pipe -Wmissing-prototypes -Wstrict-prototypes $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_fvisibility-hidden)
|
---|
1353 | TEMPLATE_VBOXR0_CXXFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC_Wno-variadic-macros) -pipe -fno-rtti -fno-exceptions $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_fvisibility-inlines-hidden) $(VBOX_GCC_fvisibility-hidden)
|
---|
1354 | TEMPLATE_VBOXR0_CFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-asynchronous-unwind-tables -ffreestanding
|
---|
1355 | TEMPLATE_VBOXR0_CXXFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-asynchronous-unwind-tables
|
---|
1356 | ifeq ($(BUILD_TARGET),solaris)
|
---|
1357 | TEMPLATE_VBOXR0_LDFLAGS = -r
|
---|
1358 | else
|
---|
1359 | TEMPLATE_VBOXR0_LDFLAGS = -nostdlib -Bsymbolic
|
---|
1360 | # temporarily, must fix the loader.
|
---|
1361 | TEMPLATE_VBOXR0_LDFLAGS += $(if $(VBOX_DO_STRIP_MODULES),-S,)
|
---|
1362 | TEMPLATE_VBOXR0_LDFLAGS.release = $(if $(VBOX_DO_STRIP_MODULES),-S,)
|
---|
1363 | endif
|
---|
1364 |
|
---|
1365 | ifneq ($(BUILD_TARGET),solaris)
|
---|
1366 | TEMPLATE_VBOXR0_LIBS = \
|
---|
1367 | $(VBOX_GCC_LIBGCC) # instricts
|
---|
1368 | endif
|
---|
1369 | endif
|
---|
1370 |
|
---|
1371 | ifeq ($(VBOX_LDR_FMT),macho)
|
---|
1372 | TEMPLATE_VBOXR0_TOOL = GXX4MACHO
|
---|
1373 | TEMPLATE_VBOXR0_CXXFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC_Wno-variadic-macros) -pipe -fno-common -msoft-float -static -fno-rtti -fno-exceptions $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing
|
---|
1374 | TEMPLATE_VBOXR0_CFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC_Wno-variadic-macros) -pipe -fno-common -msoft-float -static -Wmissing-prototypes -Wstrict-prototypes $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing
|
---|
1375 | TEMPLATE_VBOXR0_LDFLAGS = -nostdlib
|
---|
1376 | #TEMPLATE_VBOXR0_LDFLAGS.release = -Wl,-S ???
|
---|
1377 | endif
|
---|
1378 |
|
---|
1379 | ifeq ($(VBOX_LDR_FMT),lx)
|
---|
1380 | TEMPLATE_VBOXR0_TOOL = GXX3OMF
|
---|
1381 | TEMPLATE_VBOXR0_CFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC_Wno-variadic-macros) -pipe -Wmissing-prototypes -Wstrict-prototypes $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing
|
---|
1382 | TEMPLATE_VBOXR0_CXXFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC_Wno-variadic-macros) -pipe -fno-rtti -fno-exceptions $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing
|
---|
1383 | TEMPLATE_VBOXR0_LDFLAGS = -Zdll -nostdlib
|
---|
1384 | TEMPLATE_VBOXR0_LIBS = \
|
---|
1385 | $(VBOX_GCC_LIBGCC) \
|
---|
1386 | $(OBJ_SYS0) \
|
---|
1387 | end
|
---|
1388 | endif
|
---|
1389 |
|
---|
1390 |
|
---|
1391 | #
|
---|
1392 | # Template for building SUPDRV R0 things.
|
---|
1393 | #
|
---|
1394 | TEMPLATE_VBOXR0DRV = VBox SUPDRV Ring 0
|
---|
1395 | TEMPLATE_VBOXR0DRV_ASTOOL = $(VBOX_ASTOOL)
|
---|
1396 | TEMPLATE_VBOXR0DRV_ASFLAGS = $(VBOX_ASFLAGS)
|
---|
1397 | TEMPLATE_VBOXR0DRV_DEFS = IN_RING0 IN_RT_R0 $(ARCH_BITS_DEFS)
|
---|
1398 |
|
---|
1399 | ifeq ($(BUILD_TARGET),win)
|
---|
1400 | TEMPLATE_VBOXR0DRV_TOOL = $(VBOX_VCC_TOOL)
|
---|
1401 | TEMPLATE_VBOXR0DRV_RCDEFS = \
|
---|
1402 | VBOX_VERSION_MAJOR=\"$(VBOX_VERSION_MAJOR)\" \
|
---|
1403 | VBOX_VERSION_MINOR=\"$(VBOX_VERSION_MINOR)\" \
|
---|
1404 | VBOX_VERSION_BUILD=\"$(VBOX_VERSION_BUILD)\" \
|
---|
1405 | VBOX_VERSION_MAJOR_NR=$(VBOX_VERSION_MAJOR) \
|
---|
1406 | VBOX_VERSION_MINOR_NR=$(VBOX_VERSION_MINOR) \
|
---|
1407 | VBOX_VERSION_BUILD_NR=$(VBOX_VERSION_BUILD)
|
---|
1408 | TEMPLATE_VBOXR0DRV_DEFS.x86 = _X86_
|
---|
1409 | TEMPLATE_VBOXR0DRV_DEFS.amd64 = _AMD64_
|
---|
1410 | ifdef VBOX_USE_VCC80
|
---|
1411 | TEMPLATE_VBOXR0DRV_CXXFLAGS = -Zi -Zl -GR- -GS- -EHs-c- -GF- -Gz -W3 -wd4996 -Zc:wchar_t- $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
|
---|
1412 | else
|
---|
1413 | TEMPLATE_VBOXR0DRV_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -Gz -W3 $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
|
---|
1414 | endif
|
---|
1415 | TEMPLATE_VBOXR0DRV_CFLAGS = $(TEMPLATE_VBOXR0DRV_CXXFLAGS)
|
---|
1416 | TEMPLATE_VBOXR0DRV_LDFLAGS = -Driver -Subsystem:NATIVE -Incremental:NO -Align:32 -MapInfo:Exports -NoD -Debug
|
---|
1417 | TEMPLATE_VBOXR0DRV_POST_CMDS = $(VBOX_SIGN_DRIVER_CMDS)
|
---|
1418 | endif
|
---|
1419 |
|
---|
1420 | ifeq ($(BUILD_TARGET),linux)
|
---|
1421 | TEMPLATE_VBOXR0DRV_TOOL = $(VBOX_GCC_TOOL)
|
---|
1422 | TEMPLATE_VBOXR0DRV_DEFS = __KERNEL__ MODULE IN_RING0 IN_RT_R0
|
---|
1423 | TEMPLATE_VBOXR0DRV_INCS = $(VBOX_LINUX_INCS)
|
---|
1424 | TEMPLATE_VBOXR0DRV_CFLAGS = -nostdinc -iwithprefix include \
|
---|
1425 | -Wall -Wstrict-prototypes -Wno-trigraphs $(VBOX_GCC_Wno-pointer-sign) \
|
---|
1426 | $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing -fno-common
|
---|
1427 | TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -mpreferred-stack-boundary=2 -msoft-float
|
---|
1428 | TEMPLATE_VBOXR0DRV_CFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow \
|
---|
1429 | -fno-reorder-blocks -ffreestanding -fno-asynchronous-unwind-tables -funit-at-a-time \
|
---|
1430 | -Wno-sign-compare -Wdeclaration-after-statement
|
---|
1431 | TEMPLATE_VBOXR0DRV_CXXFLAGS = $(filter-out -Wstrict-prototypes -Wno-pointer-sign -ffreestanding -Wdeclaration-after-statement,$(TEMPLATE_VBOXR0DRV_CFLAGS) $(TEMPLATE_VBOXR0DRV_CFLAGS.$(BUILD_TARGET_ARCH))) -fno-exceptions -fno-rtti
|
---|
1432 | ifndef VBOX_LINUX_VERSION_2_4
|
---|
1433 | # 2.6
|
---|
1434 | TEMPLATE_VBOXR0DRV_SYSSUFF = .ko
|
---|
1435 | TEMPLATE_VBOXR0DRV_LDFLAGS.x86 = -m elf_i386 -r
|
---|
1436 | TEMPLATE_VBOXR0DRV_LDFLAGS.amd64 = -m elf_x86_64 -r
|
---|
1437 | else
|
---|
1438 | # 2.4
|
---|
1439 | TEMPLATE_VBOXR0DRV_SYSSUFF = .o
|
---|
1440 | TEMPLATE_VBOXR0DRV_LDFLAGS = -r -s
|
---|
1441 | endif
|
---|
1442 | endif
|
---|
1443 |
|
---|
1444 | ifeq ($(BUILD_TARGET),os2)
|
---|
1445 | TEMPLATE_VBOXR0DRV_TOOL = GXX3OMF
|
---|
1446 | TEMPLATE_VBOXR0DRV_CXXFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC_Wno-variadic-macros) -pipe $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing -fno-rtti -fno-exceptions
|
---|
1447 | TEMPLATE_VBOXR0DRV_CFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC_Wno-variadic-macros) -pipe -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing
|
---|
1448 | TEMPLATE_VBOXR0DRV_LIBS = $(VBOX_GCC_LIBGCC)
|
---|
1449 | # wlink thinks physdevice doesn't need fixups and should have a stack - stupid!
|
---|
1450 | TEMPLATE_VBOXR0DRV_LDFLAGS = -Zlinker Option -Zlinker internalrelocs, -Zlinker togglerelocs
|
---|
1451 | endif
|
---|
1452 |
|
---|
1453 | ifeq ($(BUILD_TARGET),darwin)
|
---|
1454 | TEMPLATE_VBOXR0DRV_TOOL = GXX4MACHO
|
---|
1455 | TEMPLATE_VBOXR0DRV_DEFS += KERNEL KERNEL_PRIVATE DRIVER_PRIVATE APPLE NeXT
|
---|
1456 | TEMPLATE_VBOXR0DRV_INCS += \
|
---|
1457 | /System/Library/Frameworks/Kernel.framework/PrivateHeaders \
|
---|
1458 | /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/Kernel.framework/Headers
|
---|
1459 | TEMPLATE_VBOXR0DRV_CXXFLAGS = \
|
---|
1460 | -g -Wall -Wno-long-long -Wno-trigraphs -pipe -fno-common -nostdinc -fno-builtin -finline \
|
---|
1461 | -fno-keep-inline-functions -force_cpusubtype_ALL -fno-exceptions -msoft-float -static \
|
---|
1462 | -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk \
|
---|
1463 | -fapple-kext -fno-rtti -fcheck-new
|
---|
1464 | TEMPLATE_VBOXR0DRV_CXXFLAGS.release = $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing -fasm-blocks
|
---|
1465 | TEMPLATE_VBOXR0DRV_CXXFLAGS.profile = $(TEMPLATE_VBOXR0DRV_CXXFLAGS.release)
|
---|
1466 | TEMPLATE_VBOXR0DRV_CXXFLAGS.kprofile = $(TEMPLATE_VBOXR0DRV_CXXFLAGS.release)
|
---|
1467 | TEMPLATE_VBOXR0DRV_CFLAGS = \
|
---|
1468 | -g -Wall -Wno-long-long -Wno-trigraphs -pipe -fno-common -nostdinc -fno-builtin -finline \
|
---|
1469 | -fno-keep-inline-functions -force_cpusubtype_ALL -fno-exceptions -msoft-float -static \
|
---|
1470 | -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk \
|
---|
1471 | -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations
|
---|
1472 | TEMPLATE_VBOXR0DRV_CFLAGS.release = $(TEMPLATE_VBOXR0DRV_CXXFLAGS.release)
|
---|
1473 | TEMPLATE_VBOXR0DRV_CFLAGS.profile = $(TEMPLATE_VBOXR0DRV_CXXFLAGS.profile)
|
---|
1474 | TEMPLATE_VBOXR0DRV_CFLAGS.kprofile = $(TEMPLATE_VBOXR0DRV_CXXFLAGS.kprofile)
|
---|
1475 | TEMPLATE_VBOXR0DRV_LDFLAGS = -static -nostdlib -r -Wl,-Y,1455 \
|
---|
1476 | -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
|
---|
1477 | TEMPLATE_VBOXR0DRV_LIBS = kmodc++ kmod cc_kext cpp_kext $(VBOX_GCC_LIBGCC)
|
---|
1478 | endif
|
---|
1479 |
|
---|
1480 | ifeq ($(BUILD_TARGET),solaris)
|
---|
1481 | # x86 Solaris:
|
---|
1482 | ## The Solaris /usr/include.
|
---|
1483 | VBOX_SOLARIS_SYS_INCS ?= /usr/include
|
---|
1484 | TEMPLATE_VBOXR0DRV_TOOL = $(VBOX_GCC_TOOL)
|
---|
1485 | TEMPLATE_VBOXR0DRV_DEFS = _KERNEL _STRICT_STDC IN_RING0 IN_RT_R0
|
---|
1486 | #TEMPLATE_VBOXR0DRV_INCS = \
|
---|
1487 | # $(VBOX_SOLARIS_SYS_INCS)
|
---|
1488 | TEMPLATE_VBOXR0DRV_SYSSUFF = .o
|
---|
1489 | TEMPLATE_VBOXR0DRV_LDFLAGS = -r
|
---|
1490 | # exclude -Wall because of solaris headers' pragma ident warnings that gcc refuses to supress!!
|
---|
1491 | TEMPLATE_VBOXR0DRV_CFLAGS = -Wno-trigraphs -Wpointer-arith -Winline $(VBOX_GCC_Wno-pointer-sign) \
|
---|
1492 | -Wmissing-prototypes -Wstrict-prototypes -Wnested-externs \
|
---|
1493 | -O2 -ffreestanding -nodefaultlibs -fno-strict-aliasing -fno-common -std=c99
|
---|
1494 | ## *************************** SOLARISTODO ******************
|
---|
1495 | endif # solaris
|
---|
1496 |
|
---|
1497 | ifeq ($(BUILD_TARGET),freebsd)
|
---|
1498 | # x86 FreeBSD:
|
---|
1499 | # cc -O2 -fno-strict-aliasing -pipe -Werror -D_KERNEL -DKLD_MODULE \
|
---|
1500 | # -nostdinc -I- -I. -I@ -I@/contrib/altq -I@/../include -I/usr/include \
|
---|
1501 | # -finline-limit=8000 -fno-common -mno-align-long-strings -mpreferred-stack-boundary=2 \
|
---|
1502 | # -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -ffreestanding -Wall -Wredundant-decls -Wnested-externs \
|
---|
1503 | # -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -fformat-extensions \
|
---|
1504 | # -std=c99 -c ../my.c
|
---|
1505 | # ld -d -warn-common -r -d -o my.kld my.o
|
---|
1506 | # :> export_syms
|
---|
1507 | # awk -f /usr/src/sys/modules/my/../../conf/kmod_syms.awk my.kld export_syms | xargs -J% objcopy % my.kld
|
---|
1508 | # ld -Bsharable -d warn-commnon -o my.ko my.kld
|
---|
1509 | #
|
---|
1510 | # Note: @ -> /usr/src/sys and machine -> /usr/src/sys/i386/include
|
---|
1511 |
|
---|
1512 | ## The location of the FreeBSD kernel source.
|
---|
1513 | VBOX_FREEBSD_SRC ?= /usr/src/sys
|
---|
1514 | ## The FreeBSD /usr/include.
|
---|
1515 | VBOX_FREEBSD_SYS_INCS ?= /usr/include
|
---|
1516 |
|
---|
1517 | TEMPLATE_VBOXR0DRV_TOOL = $(VBOX_GCC_TOOL)
|
---|
1518 | TEMPLATE_VBOXR0DRV_LDTOOL = FREEBSDKMODLD
|
---|
1519 | TEMPLATE_VBOXR0DRV_DEFS = _KERNEL KLD_MODULE IN_RING0 IN_RT_R0
|
---|
1520 | TEMPLATE_VBOXR0DRV_INCS = \
|
---|
1521 | $(VBOX_FREEBSD_SRC) \
|
---|
1522 | $(VBOX_FREEBSD_SRC)/contrib/altq \
|
---|
1523 | $(VBOX_FREEBSD_SRC)/../include \
|
---|
1524 | $(VBOX_FREEBSD_SYS_INCS)
|
---|
1525 | # omitting: -Wcast-qual, -Wredundant-decls
|
---|
1526 | TEMPLATE_VBOXR0DRV_CFLAGS = \
|
---|
1527 | -Wall -Wno-trigraphs -Wpointer-arith -Winline $(VBOX_GCC_Wno-pointer-sign) \
|
---|
1528 | -Wstrict-prototypes -Wmissing-prototypes -Wstrict-prototypes -Wnested-externs \
|
---|
1529 | -O2 -fformat-extensions -ffreestanding -fno-strict-aliasing -fno-common -finline-limit=8000 \
|
---|
1530 | $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_OPT) $(VBOX_GCC_FP) \
|
---|
1531 | -nostdinc -std=c99
|
---|
1532 | TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -m32 -mno-align-long-strings -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2
|
---|
1533 | TEMPLATE_VBOXR0DRV_CFLAGS.amd64 = -m64 "Port me to amd64 FreeBSD"
|
---|
1534 | TEMPLATE_VBOXR0DRV_CXXFLAGS = -fno-exceptions -fno-rtti \
|
---|
1535 | -Wall -Wno-trigraphs -Wpointer-arith -Winline $(VBOX_GCC_Wno-pointer-sign) \
|
---|
1536 | -O2 -fno-format-extensions -fno-strict-aliasing -fno-common -finline-limit=8000 \
|
---|
1537 | $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_OPT) $(VBOX_GCC_FP) \
|
---|
1538 | -nostdinc
|
---|
1539 | TEMPLATE_VBOXR0DRV_SYSSUFF = .ko
|
---|
1540 | TEMPLATE_VBOXR0DRV_LDFLAGS = -d --warn-common
|
---|
1541 | TEMPLATE_VBOXR0DRV_LDFLAGS.x86 = -m elf_i386_fbsd
|
---|
1542 | TEMPLATE_VBOXR0DRV_LDFLAGS.amd64 = -m elf_x86_64 "Port me to amd64 FreeBSD"
|
---|
1543 |
|
---|
1544 | TOOL_FREEBSDKMODLD = FreeBSD kernel module linker.
|
---|
1545 | # See kBuild/tools/GCC3.kmk for docs.
|
---|
1546 | TOOL_FREEBSDKMODLD_LINK_SYSMOD_OUTPUT = $(outbase).kld
|
---|
1547 | TOOL_FREEBSDKMODLD_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).map
|
---|
1548 | TOOL_FREEBSDKMODLD_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
|
---|
1549 | TOOL_FREEBSDKMODLD_LINK_SYSMOD_DEPORD =
|
---|
1550 | define TOOL_FREEBSDKMODLD_LINK_SYSMOD_CMDS
|
---|
1551 | @# Link intermediate .kld (a relocatable object).
|
---|
1552 | ld $(flags) -r -o $(outbase).kld $(objs) \
|
---|
1553 | $(foreach p,$(libpath), -L$(p))\
|
---|
1554 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib)))
|
---|
1555 | @# Strip non-exported symbols private and localize the exported ones.
|
---|
1556 | awk -f $(VBOX_FREEBSD_SRC)/conf/kmod_syms.awk $(outbase).kld $(if $(othersrc), $(othersrc),/dev/null) \
|
---|
1557 | | xargs -J% objcopy % $(outbase).kld
|
---|
1558 | @# Link the final .ko (a shared object).
|
---|
1559 | ld $(flags) -Bshareable -o $(out) $(outbase).kld
|
---|
1560 | endef
|
---|
1561 |
|
---|
1562 | endif # FreeBSD
|
---|
1563 |
|
---|
1564 | ifdef VBOX_WITH_VBOXDRV
|
---|
1565 | ifndef TEMPLATE_VBOXR0DRV_TOOL
|
---|
1566 | $(warning Warning: VBox Build: Target $(BUILD_PLATFORM) is not officially supported!)
|
---|
1567 | endif
|
---|
1568 | endif
|
---|
1569 |
|
---|
1570 |
|
---|
1571 |
|
---|
1572 | #
|
---|
1573 | # Template for building R3 executables and static libraries which are linked into executables.
|
---|
1574 | #
|
---|
1575 | TEMPLATE_VBOXR3EXE = VBox Ring 3 Exe
|
---|
1576 | TEMPLATE_VBOXR3EXE_ASTOOL = $(VBOX_ASTOOL)
|
---|
1577 | TEMPLATE_VBOXR3EXE_ASFLAGS = $(VBOX_ASFLAGS)
|
---|
1578 | TEMPLATE_VBOXR3EXE_DEFS = IN_RING3 $(ARCH_BITS_DEFS)
|
---|
1579 | TEMPLATE_VBOXR3EXE_LIBS.kprofile = $(LIB_KPROFILE)
|
---|
1580 | ifeq ($(BUILD_TARGET),win)
|
---|
1581 | TEMPLATE_VBOXR3EXE_TOOL = $(VBOX_VCC_TOOL)
|
---|
1582 | TEMPLATE_VBOXR3EXE_RCDEFS = \
|
---|
1583 | VBOX_VERSION_MAJOR=\"$(VBOX_VERSION_MAJOR)\" \
|
---|
1584 | VBOX_VERSION_MINOR=\"$(VBOX_VERSION_MINOR)\" \
|
---|
1585 | VBOX_VERSION_BUILD=\"$(VBOX_VERSION_BUILD)\" \
|
---|
1586 | VBOX_VERSION_MAJOR_NR=$(VBOX_VERSION_MAJOR) \
|
---|
1587 | VBOX_VERSION_MINOR_NR=$(VBOX_VERSION_MINOR) \
|
---|
1588 | VBOX_VERSION_BUILD_NR=$(VBOX_VERSION_BUILD)
|
---|
1589 | TEMPLATE_VBOXR3EXE_SDKS = WINPSDK
|
---|
1590 | ifdef VBOX_USE_VCC80
|
---|
1591 | TEMPLATE_VBOXR3EXE_CXXFLAGS = -Zi -Zl -GR- -EHs-c- -GF- -MD -W3 -wd4065 -wd4244 -wd4996 -Zc:wchar_t- $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
|
---|
1592 | TEMPLATE_VBOXR3EXE_CXXFLAGS.debug = -RTCsu
|
---|
1593 | else
|
---|
1594 | TEMPLATE_VBOXR3EXE_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -MD -W3 -wd4065 -wd4244 $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
|
---|
1595 | TEMPLATE_VBOXR3EXE_CXXFLAGS.debug = -GZ
|
---|
1596 | endif
|
---|
1597 | TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile = -Gh -GH
|
---|
1598 | TEMPLATE_VBOXR3EXE_CFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS)
|
---|
1599 | TEMPLATE_VBOXR3EXE_CFLAGS.debug = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.debug)
|
---|
1600 | TEMPLATE_VBOXR3EXE_CFLAGS.kprofile = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile)
|
---|
1601 | TEMPLATE_VBOXR3EXE_LDFLAGS = \
|
---|
1602 | /NOD /INCREMENTAL:NO /MAPINFO:EXPORTS /LARGEADDRESSAWARE /DEBUG \
|
---|
1603 | /DISALLOWLIB:libc.lib \
|
---|
1604 | /DISALLOWLIB:libcd.lib \
|
---|
1605 | /DISALLOWLIB:libcmt.lib \
|
---|
1606 | /DISALLOWLIB:libcmtd.lib \
|
---|
1607 | /DISALLOWLIB:msvcrtd.lib
|
---|
1608 | TEMPLATE_VBOXR3EXE_LIBS = \
|
---|
1609 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt.lib \
|
---|
1610 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcprt.lib \
|
---|
1611 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/oldnames.lib
|
---|
1612 | TEMPLATE_VBOXR3EXE_POST_CMDS = $(VBOX_SIGN_IMAGE_CMDS)
|
---|
1613 |
|
---|
1614 | else # the gcc guys
|
---|
1615 | TEMPLATE_VBOXR3EXE_TOOL = $(VBOX_GCC_TOOL)
|
---|
1616 | TEMPLATE_VBOXR3EXE_CXXFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC_Wno-variadic-macros) -pipe $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing $(VBOX_GCC_fvisibility-inlines-hidden) $(VBOX_GCC_fvisibility-hidden)
|
---|
1617 | # L4 currently can't handle exception handling.
|
---|
1618 | TEMPLATE_VBOXR3EXE_CXXFLAGS.l4 = -fno-exceptions -nostdinc \
|
---|
1619 | $(addprefix -I,$(VBOX_PATH_GCC_INCS) $(L4_INCDIR) $(FILE_TOOL_GPP3_INCDIR)) \
|
---|
1620 | $(DEBUG_L4)
|
---|
1621 | TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile = -finstrument-functions
|
---|
1622 | TEMPLATE_VBOXR3EXE_CFLAGS.debug = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.debug)
|
---|
1623 | TEMPLATE_VBOXR3EXE_CFLAGS.kprofile = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile)
|
---|
1624 | TEMPLATE_VBOXR3EXE_CFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC_Wno-variadic-macros) -pipe -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing $(VBOX_GCC_fvisibility-hidden)
|
---|
1625 | TEMPLATE_VBOXR3EXE_CFLAGS.darwin = -fno-common
|
---|
1626 | TEMPLATE_VBOXR3EXE_CFLAGS.l4 = -nostdinc \
|
---|
1627 | $(addprefix -I,$(VBOX_PATH_GCC_INCS) $(L4_INCDIR)) $(DEBUG_L4)
|
---|
1628 | TEMPLATE_VBOXR3EXE_DEFS.l4 = L4_THREAD_SAFE
|
---|
1629 | TEMPLATE_VBOXR3EXE_LDFLAGS.l4 = \
|
---|
1630 | $(L4_LIBDIR)/../crt0.o \
|
---|
1631 | -T$(L4_LIBDIR)/../main_dyn.ld -nostdlib \
|
---|
1632 | -Wl,--export-dynamic,--dynamic-linker=libld-l4.s.so \
|
---|
1633 | -Wl,--rpath-link,$(L4_LIBDIR)
|
---|
1634 | TEMPLATE_VBOXR3EXE_LDFLAGS.linux = -Wl,-z,noexecstack
|
---|
1635 | ifeq ($(BUILD_TARGET),linux)
|
---|
1636 | TEMPLATE_VBOXR3EXE_LIBS = pthread m rt dl
|
---|
1637 | else ifeq ($(BUILD_TARGET),l4)
|
---|
1638 | TEMPLATE_VBOXR3EXE_LIBS = \
|
---|
1639 | $(L4_LIBDIR)/libvboxserver.s.so \
|
---|
1640 | $(L4_LIBDIR)/libuc++.0.s.so \
|
---|
1641 | supc++ gcc_eh gcc \
|
---|
1642 | $(L4_LIBDIR)/libdl.s.so \
|
---|
1643 | $(L4_LIBDIR)/libuc.0.s.so
|
---|
1644 | else ifeq ($(BUILD_TARGET),os2)
|
---|
1645 | TEMPLATE_VBOXR3EXE_TOOL = GXX3OMF
|
---|
1646 | TEMPLATE_VBOXR3EXE_LIBS = socket iconv
|
---|
1647 | else ifeq ($(BUILD_TARGET),darwin)
|
---|
1648 | TEMPLATE_VBOXR3EXE_TOOL = GXX4MACHO
|
---|
1649 | TEMPLATE_VBOXR3EXE_LIBS =
|
---|
1650 | TEMPLATE_VBOXR3EXE_LDFLAGS = -read_only_relocs suppress
|
---|
1651 | TEMPLATE_VBOXR3EXE_INCS += $(VBOX_PATH_MACOSX_SDK_INCS)
|
---|
1652 | else ifeq ($(filter-out freebsd netbsd openbsd,$(BUILD_TARGET)),)
|
---|
1653 | TEMPLATE_VBOXR3EXE_TOOL = GXX3
|
---|
1654 | TEMPLATE_VBOXR3EXE_LIBS = pthread
|
---|
1655 | else ifeq ($(BUILD_TARGET),solaris)
|
---|
1656 | TEMPLATE_VBOXR3EXE_TOOL = GXX3PLAIN
|
---|
1657 | TEMPLATE_VBOXR3EXE_DEFS += LIBICONV_PLUG # Avoid the GNU libiconv, for now at least.
|
---|
1658 | TEMPLATE_VBOXR3EXE_LIBS = rt socket
|
---|
1659 | else
|
---|
1660 | $(warning Warning: VBOX Build: Target $(BUILD_TARGET) is not officially supported!)
|
---|
1661 | TEMPLATE_VBOXR3EXE_CXXFLAGS.profile = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.release)
|
---|
1662 | TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.krelease)
|
---|
1663 | endif
|
---|
1664 | endif
|
---|
1665 |
|
---|
1666 | #
|
---|
1667 | # Template for building R3 shared objects / DLLs.
|
---|
1668 | # This is mostly identical to the VBOXR3EXE template. (Avoid PIC if possible!)
|
---|
1669 | #
|
---|
1670 | TEMPLATE_VBOXR3 = VBox Ring 3 SO/DLLs
|
---|
1671 | TEMPLATE_VBOXR3_EXTENDS = VBOXR3EXE
|
---|
1672 | TEMPLATE_VBOXR3_LDFLAGS.l4 = $(L4_LIBDIR)/../crt0.s.o -T$(L4_LIBDIR)/../main_rel.ld -nostdlib
|
---|
1673 | TEMPLATE_VBOXR3_DEFS.l4 = $(TEMPLATE_VBOXR3EXE_DEFS.l4) __PIC__
|
---|
1674 | TEMPLATE_VBOXR3_DEFS.darwin = $(TEMPLATE_VBOXR3EXE_DEFS.darwin) PIC
|
---|
1675 | ifeq ($(filter-out solaris.x86 %.amd64,$(BUILD_TARGET).$(BUILD_TARGET_ARCH)),)
|
---|
1676 | ifneq ($(BUILD_TARGET),win)
|
---|
1677 | TEMPLATE_VBOXR3_DEFS = $(TEMPLATE_VBOXR3EXE_DEFS) PIC
|
---|
1678 | TEMPLATE_VBOXR3_CFLAGS = $(TEMPLATE_VBOXR3EXE_CFLAGS) -fPIC
|
---|
1679 | TEMPLATE_VBOXR3_CXXFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS) -fPIC
|
---|
1680 | TEMPLATE_VBOXR3_LDFLAGS = $(TEMPLATE_VBOXR3EXE_LDFLAGS) -fPIC
|
---|
1681 | endif
|
---|
1682 | endif
|
---|
1683 |
|
---|
1684 | #
|
---|
1685 | # Ring-3 testcase.
|
---|
1686 | # This is the VBOXR3EXE template only with a different install dir.
|
---|
1687 | #
|
---|
1688 | TEMPLATE_VBOXR3TSTEXE = VBox Ring 3 Testcase Exe
|
---|
1689 | TEMPLATE_VBOXR3TSTEXE_EXTENDS = VBOXR3EXE
|
---|
1690 | TEMPLATE_VBOXR3TSTEXE_INST = $(INST_TESTCASE)
|
---|
1691 | TEMPLATE_VBOXR3TSTEXE_LIBS = $(LIB_RUNTIME) $(TEMPLATE_VBOXR3EXE_LIBS)
|
---|
1692 | ifeq ($(BUILD_TARGET),win)
|
---|
1693 | ifdef VBOX_SIGNING_MODE
|
---|
1694 | TEMPLATE_VBOXR3TSTEXE_POST_CMDS =
|
---|
1695 | endif
|
---|
1696 | endif
|
---|
1697 |
|
---|
1698 | #
|
---|
1699 | # Template for building bad C/C++ style R3 executables (no -pedantic).
|
---|
1700 | #
|
---|
1701 | TEMPLATE_VBOXR3NPEXE = VBox Ring 3 Non-pedantic
|
---|
1702 | TEMPLATE_VBOXR3NPEXE_EXTENDS = VBOXR3EXE
|
---|
1703 | ifneq ($(BUILD_TARGET),win)
|
---|
1704 | # (only gcc)
|
---|
1705 | TEMPLATE_VBOXR3NPEXE_TOOL = $(VBOX_GCC_TOOL)
|
---|
1706 | TEMPLATE_VBOXR3NPEXE_CXXFLAGS = $(filter-out -pedantic,$(TEMPLATE_VBOXR3EXE_CXXFLAGS))
|
---|
1707 | TEMPLATE_VBOXR3NPEXE_CFLAGS = $(filter-out -pedantic -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations,$(TEMPLATE_VBOXR3EXE_CFLAGS))
|
---|
1708 | endif
|
---|
1709 |
|
---|
1710 | #
|
---|
1711 | # Template for building bad C/C++ style R3 shared libraries / Dlls (no -pedantic).
|
---|
1712 | # This is mostly identical to the VBOXR3NPEXE template.
|
---|
1713 | #
|
---|
1714 | TEMPLATE_VBOXR3NP= VBox Ring 3 Non-pedantic
|
---|
1715 | TEMPLATE_VBOXR3NP_EXTENDS = VBOXR3NPEXE
|
---|
1716 | TEMPLATE_VBOXR3NP_LDFLAGS.l4 = \
|
---|
1717 | $(L4_LIBDIR)/../crt0.s.o \
|
---|
1718 | -T$(L4_LIBDIR)/../main_rel.ld \
|
---|
1719 | -nostdlib
|
---|
1720 | TEMPLATE_VBOXR3NP_DEFS.l4 = $(TEMPLATE_VBOXR3NPEXE_DEFS.l4) __PIC__
|
---|
1721 | ifeq ($(BUILD_TARGET_ARCH),amd64)
|
---|
1722 | ifneq ($(BUILD_TARGET),win)
|
---|
1723 | TEMPLATE_VBOXR3NP_DEFS = $(TEMPLATE_VBOXR3NPEXE_DEFS) PIC
|
---|
1724 | TEMPLATE_VBOXR3NP_CFLAGS = $(TEMPLATE_VBOXR3NPEXE_CFLAGS) -fPIC
|
---|
1725 | TEMPLATE_VBOXR3NP_CXXFLAGS = $(TEMPLATE_VBOXR3NPEXE_CXXFLAGS) -fPIC
|
---|
1726 | TEMPLATE_VBOXR3NP_LDFLAGS = $(TEMPLATE_VBOXR3NPEXE_LDFLAGS) -fPIC
|
---|
1727 | endif
|
---|
1728 | endif
|
---|
1729 |
|
---|
1730 |
|
---|
1731 | #
|
---|
1732 | # Template for building libraries, shared libraries / modules
|
---|
1733 | # which only depends on IPRT for crt.
|
---|
1734 | #
|
---|
1735 | TEMPLATE_VBOXNOCRTGCC = VBox no-crt GCC libraries and modules, yasm/nasm.
|
---|
1736 | TEMPLATE_VBOXNOCRTGCC_DEFS = IN_RING3 IPRT_NO_CRT $(ARCH_BITS_DEFS)
|
---|
1737 | TEMPLATE_VBOXNOCRTGCC_ASDEFS = ASM_CALL64_GCC
|
---|
1738 | ## @todo C++
|
---|
1739 | TEMPLATE_VBOXNOCRTGCC_CFLAGS = -nostdinc -fno-strict-aliasing -fno-math-errno -Wall
|
---|
1740 | TEMPLATE_VBOXNOCRTGCC_CFLAGS.amd64 = -mcmodel=medium -fno-common
|
---|
1741 | #TEMPLATE_VBOXNOCRTGCC_CFLAGS.release = -O0 -fno-math-errno -fno-peephole2 -fno-strict-aliasing - for win64.
|
---|
1742 | TEMPLATE_VBOXNOCRTGCC_CFLAGS.release = -O2 -fno-strict-aliasing
|
---|
1743 | TEMPLATE_VBOXNOCRTGCC_CFLAGS.profile = $(TEMPLATE_VBOXNOCRTGCC_CFLAGS.release)
|
---|
1744 | TEMPLATE_VBOXNOCRTGCC_CFLAGS.kprofile = $(TEMPLATE_VBOXNOCRTGCC_CFLAGS.release)
|
---|
1745 | TEMPLATE_VBOXNOCRTGCC_CFLAGS.darwin = -mdynamic-no-pic
|
---|
1746 | TEMPLATE_VBOXNOCRTGCC_INCS = $(PATH_ROOT)/include/iprt/nocrt
|
---|
1747 |
|
---|
1748 | ifeq ($(BUILD_TARGET).$(BUILD_TARGET_ARCH),win.amd64)
|
---|
1749 | # cross compile to 64-bit ELF (linux).
|
---|
1750 | TEMPLATE_VBOXNOCRTGCC_TOOL = XGCCAMD64LINUX
|
---|
1751 | TEMPLATE_VBOXNOCRTGCC_ASTOOL = YASM
|
---|
1752 | TEMPLATE_VBOXNOCRTGCC_ASFLAGS = -f elf64 -DASM_FORMAT_ELF -D__YASM__ -w+orphan-labels -g dwarf2
|
---|
1753 | TEMPLATE_VBOXNOCRTGCC_LIBS = $(PATH_DEVTOOLS)/win.x86/x86_64-unknown-linux-gnu/20060701-r2/lib/gcc/x86_64-unknown-linux-gnu/3.4.6/libgcc.a
|
---|
1754 | TEMPLATE_VBOXNOCRTGCC_LDFLAGS = -nostdlib
|
---|
1755 |
|
---|
1756 | else ifeq ($(BUILD_TARGET).$(BUILD_TARGET_ARCH),win.x86)
|
---|
1757 | # Use the default GCC (MinGW) with the Microsoft linker.
|
---|
1758 | # (Drop all '-g' options as we're unable to strip the debug info.)
|
---|
1759 | TEMPLATE_VBOXNOCRTGCC_TOOL = $(VBOX_GCC_TOOL)
|
---|
1760 | TEMPLATE_VBOXNOCRTGCC_ASTOOL = $(VBOX_ASTOOL)
|
---|
1761 | TEMPLATE_VBOXNOCRTGCC_ASFLAGS = $(VBOX_ASFLAGS)
|
---|
1762 | TEMPLATE_VBOXNOCRTGCC_LDTOOL = $(VBOX_VCC_TOOL)
|
---|
1763 | TEMPLATE_VBOXNOCRTGCC_LDFLAGS = -Incremental:NO -MapInfo:Exports -NoD
|
---|
1764 | TEMPLATE_VBOXNOCRTGCC_LIBS = $(VBOX_GCC_LIBGCC)
|
---|
1765 | TEMPLATE_VBOXNOCRTGCC_CFLAGS := $(filter-out -g,$(TEMPLATE_VBOXNOCRTGCC_CFLAGS)) -s
|
---|
1766 |
|
---|
1767 | else
|
---|
1768 | # Use the default GCC.
|
---|
1769 | # The use of --exclude-libs ALL is to avoid confusing the linux ld.so.
|
---|
1770 | TEMPLATE_VBOXNOCRTGCC_TOOL = $(VBOX_GCC_TOOL)
|
---|
1771 | TEMPLATE_VBOXNOCRTGCC_ASTOOL = $(VBOX_ASTOOL)
|
---|
1772 | TEMPLATE_VBOXNOCRTGCC_ASFLAGS = $(VBOX_ASFLAGS)
|
---|
1773 | TEMPLATE_VBOXNOCRTGCC_CFLAGS += $(VBOX_GCC_fno-stack-protector)
|
---|
1774 | TEMPLATE_VBOXNOCRTGCC_CXXFLAGS += $(VBOX_GCC_fno-stack-protector)
|
---|
1775 | TEMPLATE_VBOXNOCRTGCC_LDFLAGS = -nostdlib
|
---|
1776 | ifneq ($(filter-out os2 darwin solaris,$(BUILD_TARGET)),)
|
---|
1777 | ifneq ($(BUILD_TARGET_ARCH),amd64)
|
---|
1778 | TEMPLATE_VBOXNOCRTGCC_LDFLAGS += -Wl,--no-undefined
|
---|
1779 | endif
|
---|
1780 | endif
|
---|
1781 | ifneq ($(filter-out freebsd,$(BUILD_TARGET)),)
|
---|
1782 | TEMPLATE_VBOXNOCRTGCC_LIBS = # FIXME - has unwind mess.
|
---|
1783 | else
|
---|
1784 | TEMPLATE_VBOXNOCRTGCC_LIBS = $(VBOX_GCC_LIBGCC)
|
---|
1785 | endif
|
---|
1786 | endif
|
---|
1787 |
|
---|
1788 |
|
---|
1789 | #
|
---|
1790 | # Same as VBOXNOCRTGCC only it uses GAS as the assembler instead of yasm/nasm.
|
---|
1791 | #
|
---|
1792 | TEMPLATE_VBOXNOCRTGAS = VBox no-crt GCC libraries and modules, gas.
|
---|
1793 | TEMPLATE_VBOXNOCRTGAS_EXTENDS = VBOXNOCRTGCC
|
---|
1794 | TEMPLATE_VBOXNOCRTGAS_ASTOOL = $(TEMPLATE_VBOXNOCRTGCC_TOOL)
|
---|
1795 | ifeq ($(BUILD_TARGET).$(BUILD_TARGET_ARCH),win.x86)
|
---|
1796 | TEMPLATE_VBOXNOCRTGAS_ASFLAGS = -s
|
---|
1797 | else
|
---|
1798 | TEMPLATE_VBOXNOCRTGAS_ASFLAGS = -g
|
---|
1799 | endif
|
---|
1800 |
|
---|
1801 |
|
---|
1802 | #
|
---|
1803 | # Template for building executables that are part of the VBox Main component
|
---|
1804 | # (COM/XPCOM interface to VirtualBox).
|
---|
1805 | #
|
---|
1806 |
|
---|
1807 | TEMPLATE_VBOXMAINEXE = VBox Main Executable
|
---|
1808 | TEMPLATE_VBOXMAINEXE_ASTOOL = $(VBOX_ASTOOL)
|
---|
1809 | TEMPLATE_VBOXMAINEXE_ASFLAGS = $(VBOX_ASFLAGS)
|
---|
1810 | TEMPLATE_VBOXMAINEXE_DEFS = IN_RING3 UNICODE NDEBUG=1
|
---|
1811 | TEMPLATE_VBOXMAINEXE_DEFS.win = _UNICODE
|
---|
1812 | TEMPLATE_VBOXMAINEXE_RCDEFS = $(TEMPLATE_VBOXR3EXE_RCDEFS)
|
---|
1813 | TEMPLATE_VBOXMAINEXE_LIBS.kprofile = $(LIB_KPROFILE)
|
---|
1814 | TEMPLATE_VBOXMAINEXE_INCS = \
|
---|
1815 | $(VBOX_PATH_SDK)/include
|
---|
1816 |
|
---|
1817 | ifeq ($(BUILD_TARGET),win)
|
---|
1818 | TEMPLATE_VBOXMAINEXE_SDKS = WINPSDK W2K3DDK
|
---|
1819 | ifdef VBOX_USE_VCC80
|
---|
1820 | TEMPLATE_VBOXMAINEXE_TOOL = $(VBOX_VCC_TOOL)
|
---|
1821 | TEMPLATE_VBOXMAINEXE_CXXFLAGS = -Zi -Zl -GR -GF- -MD -EHsc -W3 -wd4065 -wd4996 -Zc:wchar_t- $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
|
---|
1822 | TEMPLATE_VBOXMAINEXE_CXXFLAGS.debug = -RTCsu
|
---|
1823 | else
|
---|
1824 | TEMPLATE_VBOXMAINEXE_TOOL = VCC70
|
---|
1825 | TEMPLATE_VBOXMAINEXE_CXXFLAGS = -Zi -Zl -GR -GX- -GF- -MD -EHsc -W3 -wd4065 $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
|
---|
1826 | TEMPLATE_VBOXMAINEXE_CXXFLAGS.debug = -GZ
|
---|
1827 | endif
|
---|
1828 | TEMPLATE_VBOXMAINEXE_CXXFLAGS.kprofile = -Gh -GH
|
---|
1829 | TEMPLATE_VBOXMAINEXE_CFLAGS = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS)
|
---|
1830 | TEMPLATE_VBOXMAINEXE_CFLAGS.debug = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.debug)
|
---|
1831 | TEMPLATE_VBOXMAINEXE_CFLAGS.kprofile = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.kprofile)
|
---|
1832 | TEMPLATE_VBOXMAINEXE_INCS += \
|
---|
1833 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_INC)
|
---|
1834 | TEMPLATE_VBOXMAINEXE_LDFLAGS = \
|
---|
1835 | /NOD /INCREMENTAL:NO /MAPINFO:EXPORTS /LARGEADDRESSAWARE /DEBUG\
|
---|
1836 | /DISALLOWLIB:libc.lib \
|
---|
1837 | /DISALLOWLIB:libcd.lib \
|
---|
1838 | /DISALLOWLIB:msvcrt.lib \
|
---|
1839 | /DISALLOWLIB:msvcrtd.lib \
|
---|
1840 | /DISALLOWLIB:libcmtd.lib \
|
---|
1841 | /DISALLOWLIB:libcmt.lib
|
---|
1842 | TEMPLATE_VBOXMAINEXE_LIBS = \
|
---|
1843 | $(LIB_RUNTIME) \
|
---|
1844 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt.lib \
|
---|
1845 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcprt.lib \
|
---|
1846 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/oldnames.lib \
|
---|
1847 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_LIB)/atls.lib
|
---|
1848 | TEMPLATE_VBOXMAINEXE_POST_CMDS = $(VBOX_SIGN_IMAGE_CMDS)
|
---|
1849 |
|
---|
1850 | else # the GCC guys:
|
---|
1851 |
|
---|
1852 | TEMPLATE_VBOXMAINEXE_TOOL = $(VBOX_GCC_TOOL)
|
---|
1853 | TEMPLATE_VBOXMAINEXE_CXXFLAGS = -g -Wall -Wno-long-long -Wno-trigraphs -pipe -Wno-non-virtual-dtor -fshort-wchar -fpermissive $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing $(VBOX_GCC_fvisibility-inlines-hidden) $(VBOX_GCC_fvisibility-hidden)
|
---|
1854 | TEMPLATE_VBOXMAINEXE_CXXFLAGS.debug = -fno-inline
|
---|
1855 | TEMPLATE_VBOXMAINEXE_CXXFLAGS.kprofile = -finstrument-functions
|
---|
1856 | TEMPLATE_VBOXMAINEXE_CFLAGS = -g -Wall -Wno-long-long -Wno-trigraphs -pipe -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing $(VBOX_GCC_fvisibility-hidden)
|
---|
1857 | TEMPLATE_VBOXMAINEXE_CFLAGS.debug = -fno-inline
|
---|
1858 | TEMPLATE_VBOXMAINEXE_CFLAGS.kprofile = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.kprofile)
|
---|
1859 | ifeq ($(BUILD_TARGET),linux)
|
---|
1860 | TEMPLATE_VBOXMAINEXE_LIBS = pthread m rt $(LIB_RUNTIME)
|
---|
1861 | else ifeq ($(BUILD_TARGET),l4)
|
---|
1862 | TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME)
|
---|
1863 | # no libs as yet in l4 target - must be added later
|
---|
1864 | else ifeq ($(BUILD_TARGET),os2)
|
---|
1865 | TEMPLATE_VBOXMAINEXE_TOOL = GXX3OMF
|
---|
1866 | TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME)
|
---|
1867 | else ifeq ($(BUILD_TARGET),darwin)
|
---|
1868 | TEMPLATE_VBOXMAINEXE_TOOL = GXX4MACHO
|
---|
1869 | TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME)
|
---|
1870 | TEMPLATE_VBOXMAINEXE_LDFLAGS.darwin = -bind_at_load -framework Carbon
|
---|
1871 | else ifeq ($(filter-out freebsd netbsd openbsd,$(BUILD_TARGET)),)
|
---|
1872 | TEMPLATE_VBOXMAINEXE_TOOL = GXX3
|
---|
1873 | TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME)
|
---|
1874 | TEMPLATE_VBOXMAINEXE_INCS += $(VBOX_PATH_MACOSX_SDK_INCS)
|
---|
1875 | else ifeq ($(BUILD_TARGET),solaris)
|
---|
1876 | TEMPLATE_VBOXMAINEXE_TOOL = GXX3PLAIN
|
---|
1877 | TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME) rt
|
---|
1878 | else
|
---|
1879 | $(warning Warning: VBOX Build: Target $(BUILD_TARGET) is not officially supported!)
|
---|
1880 | TEMPLATE_VBOXMAINEXE_LIBS =
|
---|
1881 | endif
|
---|
1882 |
|
---|
1883 | endif # !win
|
---|
1884 |
|
---|
1885 | # Add COM/XPCOM stuff
|
---|
1886 | TEMPLATE_VBOXMAINEXE_LIBS += \
|
---|
1887 | $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB)
|
---|
1888 | ifdef VBOX_WITH_XPCOM
|
---|
1889 | ## @todo may be worth creating the VBOX_XPCOM SDK def
|
---|
1890 | TEMPLATE_VBOXMAINEXE_DEFS += VBOX_WITH_XPCOM
|
---|
1891 | TEMPLATE_VBOXMAINEXE_INCS += \
|
---|
1892 | $(VBOX_XPCOM_INCS)
|
---|
1893 | TEMPLATE_VBOXMAINEXE_LIBS += \
|
---|
1894 | $(PATH_LIB)/VBoxXPCOMGlue$(VBOX_SUFF_LIB) \
|
---|
1895 | $(LIB_XPCOM)
|
---|
1896 | endif
|
---|
1897 |
|
---|
1898 | #
|
---|
1899 | # Template for building the Main DLL modules (such as in-process COM/XPCOM
|
---|
1900 | # components for Main).
|
---|
1901 | #
|
---|
1902 | # This differs from VBOXMAINEXE only in PIC handling and similar DLL stuff.
|
---|
1903 | #
|
---|
1904 |
|
---|
1905 | TEMPLATE_VBOXMAINDLL = VBox Main Component (shared library)
|
---|
1906 | TEMPLATE_VBOXMAINDLL_EXTENDS = VBOXMAINEXE
|
---|
1907 | ifeq ($(BUILD_TARGET_ARCH),amd64)
|
---|
1908 | ifneq ($(BUILD_TARGET),win)
|
---|
1909 | TEMPLATE_VBOXMAINDLL_DEFS = PIC $(TEMPLATE_VBOXMAINEXE_DEFS)
|
---|
1910 | TEMPLATE_VBOXMAINDLL_CFLAGS = -fPIC $(TEMPLATE_VBOXMAINEXE_CFLAGS)
|
---|
1911 | TEMPLATE_VBOXMAINDLL_CXXFLAGS = -fPIC $(TEMPLATE_VBOXMAINEXE_CXXFLAGS)
|
---|
1912 | TEMPLATE_VBOXMAINDLL_LDFLAGS = -fPIC $(TEMPLATE_VBOXMAINEXE_LDFLAGS)
|
---|
1913 | endif
|
---|
1914 | endif
|
---|
1915 | TEMPLATE_VBOXMAINDLL_LDFLAGS.darwin = $(filter-out -bind_at_load,$(TEMPLATE_VBOXMAINEXE_LDFLAGS.darwin))
|
---|
1916 |
|
---|
1917 | ifdef VBOX_WITH_XPCOM
|
---|
1918 | # XPCOM component modules don't need the XPCOM glue library
|
---|
1919 | TEMPLATE_VBOXMAINDLL_LIBS = $(filter-out \
|
---|
1920 | $(PATH_LIB)/VBoxXPCOMGlue$(VBOX_SUFF_LIB),\
|
---|
1921 | $(TEMPLATE_VBOXMAINEXE_LIBS))
|
---|
1922 | endif
|
---|
1923 |
|
---|
1924 | #
|
---|
1925 | # Template for building the Main static libraries.
|
---|
1926 | #
|
---|
1927 | # This differs from VBOXMAINDLL only that it zeroes out the _LIBS definition.
|
---|
1928 | #
|
---|
1929 |
|
---|
1930 | TEMPLATE_VBOXMAINLIB = VBox Main Component (static library)
|
---|
1931 | TEMPLATE_VBOXMAINLIB_EXTENDS = VBOXMAINDLL
|
---|
1932 | TEMPLATE_VBOXMAINLIB_LIBS =
|
---|
1933 |
|
---|
1934 | #
|
---|
1935 | # Template for building executables that use the VBox Main component.
|
---|
1936 | #
|
---|
1937 |
|
---|
1938 | TEMPLATE_VBOXMAINCLIENTEXE = VBox Main Client (executable)
|
---|
1939 | TEMPLATE_VBOXMAINCLIENTEXE_EXTENDS = VBOXMAINEXE
|
---|
1940 | ifeq ($(BUILD_TARGET),win)
|
---|
1941 | TEMPLATE_VBOXMAINCLIENTEXE_LIBS.win = $(TEMPLATE_VBOXMAINEXE_LIBS.win) \
|
---|
1942 | $(PATH_SDK_WINPSDK_LIB)/User32.Lib \
|
---|
1943 | $(PATH_SDK_WINPSDK_LIB)/Shell32.Lib \
|
---|
1944 | $(PATH_SDK_WINPSDK_LIB)/ShLwApi.Lib \
|
---|
1945 | $(PATH_SDK_WINPSDK_LIB)/Ole32.Lib \
|
---|
1946 | $(PATH_SDK_WINPSDK_LIB)/OleAut32.Lib \
|
---|
1947 | $(PATH_SDK_WINPSDK_LIB)/Uuid.Lib
|
---|
1948 | else
|
---|
1949 | TEMPLATE_VBOXMAINCLIENTEXE_DEFS = $(TEMPLATE_VBOXMAINEXE_DEFS) \
|
---|
1950 | NDEBUG TRIMMED
|
---|
1951 | ## @todo remove
|
---|
1952 | ## Wonder why we compile main with defaults for these two and then drops it
|
---|
1953 | ## in the client executables...
|
---|
1954 | #TEMPLATE_VBOXMAINCLIENTEXE_CXXFLAGS = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS) \
|
---|
1955 | # -fno-rtti -fno-exceptions
|
---|
1956 | TEMPLATE_VBOXMAINCLIENTEXE_CXXFLAGS.linux = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.linux) \
|
---|
1957 | -pthread
|
---|
1958 | TEMPLATE_VBOXMAINCLIENTEXE_LDFLAGS.darwin = $(TEMPLATE_VBOXMAINEXE_LDFLAGS.darwin) \
|
---|
1959 | -bind_at_load -framework Carbon
|
---|
1960 | endif
|
---|
1961 |
|
---|
1962 | #
|
---|
1963 | # Template for building shared libraries / DLLs that use the VBox Main component.
|
---|
1964 | #
|
---|
1965 | # This differs from VBOXMAINCLIENTEXE only in PIC handling and similar DLL stuff.
|
---|
1966 | #
|
---|
1967 |
|
---|
1968 | TEMPLATE_VBOXMAINCLIENTDLL = VBox MAIN Client (shared library)
|
---|
1969 | TEMPLATE_VBOXMAINCLIENTDLL_EXTENDS = VBOXMAINCLIENTEXE
|
---|
1970 | ifeq ($(BUILD_TARGET_ARCH),amd64)
|
---|
1971 | ifneq ($(BUILD_TARGET),win)
|
---|
1972 | TEMPLATE_VBOXMAINCLIENTDLL_DEFS = PIC $(TEMPLATE_VBOXMAINCLIENTEXE_DEFS)
|
---|
1973 | TEMPLATE_VBOXMAINCLIENTDLL_CFLAGS = -fPIC $(TEMPLATE_VBOXMAINCLIENTEXE_CFLAGS)
|
---|
1974 | TEMPLATE_VBOXMAINCLIENTDLL_CXXFLAGS = -fPIC $(TEMPLATE_VBOXMAINCLIENTEXE_CXXFLAGS)
|
---|
1975 | TEMPLATE_VBOXMAINCLIENTDLL_LDFLAGS = -fPIC $(TEMPLATE_VBOXMAINCLIENTEXE_LDFLAGS)
|
---|
1976 | endif
|
---|
1977 | endif
|
---|
1978 | TEMPLATE_VBOXMAINCLIENTDLL_LDFLAGS.darwin = $(filter-out -bind_at_load,$(TEMPLATE_VBOXMAINCLIENTEXE_LDFLAGS.darwin))
|
---|
1979 |
|
---|
1980 |
|
---|
1981 | #
|
---|
1982 | # Template for building Qt GUI executables.
|
---|
1983 | #
|
---|
1984 |
|
---|
1985 | TEMPLATE_VBOXQTGUIEXE = VBox Qt GUI Executable
|
---|
1986 | TEMPLATE_VBOXQTGUIEXE_DEFS = IN_RING3 QT_NO_DEBUG QT_THREAD_SUPPORT $(ARCH_BITS_DEFS)
|
---|
1987 | TEMPLATE_VBOXQTGUIEXE_INCS = \
|
---|
1988 | $(VBOX_PATH_SDK)/include \
|
---|
1989 | $(VBOX_PATH_QT)/include
|
---|
1990 |
|
---|
1991 | ifeq ($(BUILD_TARGET),win)
|
---|
1992 | TEMPLATE_VBOXQTGUIEXE_TOOL = $(VBOX_VCC_TOOL)
|
---|
1993 | TEMPLATE_VBOXQTGUIEXE_DEFS += \
|
---|
1994 | _WIN32_WINNT=0x0500 UNICODE _UNICODE \
|
---|
1995 | QT_DLL _CRT_SECURE_NO_DEPRECATE
|
---|
1996 | ## @todo VCC70 flags?
|
---|
1997 | ifdef VBOX_USE_VCC80
|
---|
1998 | TEMPLATE_VBOXQTGUIEXE_CXXFLAGS = \
|
---|
1999 | -nologo -Zm200 -W3 -MD -EHsc -Zc:wchar_t-
|
---|
2000 | TEMPLATE_VBOXQTGUIEXE_CXXFLAGS.debug = -RTCsu
|
---|
2001 | else
|
---|
2002 | TEMPLATE_VBOXQTGUIEXE_CXXFLAGS = \
|
---|
2003 | -nologo -Zm200 -W3 -MD -GX
|
---|
2004 | TEMPLATE_VBOXQTGUIEXE_CXXFLAGS.debug = -GZ
|
---|
2005 | endif
|
---|
2006 | TEMPLATE_VBOXQTGUIEXE_INCS += \
|
---|
2007 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_INC)
|
---|
2008 | TEMPLATE_VBOXQTGUIEXE_LDFLAGS = \
|
---|
2009 | /NOD /NOLOGO /INCREMENTAL:NO /MAPINFO:EXPORTS /DEBUG \
|
---|
2010 | /DELAYLOAD:oleaut32.dll
|
---|
2011 | TEMPLATE_VBOXQTGUIEXE_SDKS = WINPSDK
|
---|
2012 | TEMPLATE_VBOXQTGUIEXE_LIBS = \
|
---|
2013 | $(LIB_QT) \
|
---|
2014 | $(LIB_QTMAIN) \
|
---|
2015 | $(LIB_RUNTIME) \
|
---|
2016 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcprt.lib \
|
---|
2017 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt.lib \
|
---|
2018 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/oldnames.lib \
|
---|
2019 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib \
|
---|
2020 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_LIB)/atls.lib
|
---|
2021 | TEMPLATE_VBOXQTGUIEXE_POST_CMDS = $(VBOX_SIGN_IMAGE_CMDS)
|
---|
2022 |
|
---|
2023 | else # the gcc guys:
|
---|
2024 | TEMPLATE_VBOXQTGUIEXE_TOOL = $(VBOX_GCC_TOOL)
|
---|
2025 | TEMPLATE_VBOXQTGUIEXE_DEFS.linux = _REENTRANT
|
---|
2026 |
|
---|
2027 | TEMPLATE_VBOXQTGUIEXE_INCS += \
|
---|
2028 | $(LIB_SDL_INC)
|
---|
2029 | TEMPLATE_VBOXQTGUIEXE_CXXFLAGS = \
|
---|
2030 | -pipe -Wall -W -frtti -fno-exceptions -Wno-non-virtual-dtor \
|
---|
2031 | -Wno-long-long -fshort-wchar -fno-strict-aliasing \
|
---|
2032 | $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden)
|
---|
2033 | TEMPLATE_VBOXQTGUIEXE_CXXFLAGS.linux = -pthread
|
---|
2034 | ## @todo no $(LIB_QTMAIN) here?
|
---|
2035 | TEMPLATE_VBOXQTGUIEXE_LIBS = \
|
---|
2036 | $(LIB_QT) \
|
---|
2037 | $(LIB_SDL) \
|
---|
2038 | $(LIB_RUNTIME) \
|
---|
2039 | $(LIB_REM) \
|
---|
2040 | $(LIB_VMM)
|
---|
2041 |
|
---|
2042 | ifeq ($(BUILD_TARGET_ARCH),amd64)
|
---|
2043 | TEMPLATE_VBOXQTGUIEXE_LIBPATH = \
|
---|
2044 | $(VBOX_PATH_QT)/lib64 $(VBOX_PATH_QT)/lib
|
---|
2045 | else
|
---|
2046 | TEMPLATE_VBOXQTGUIEXE_LIBPATH = \
|
---|
2047 | $(VBOX_PATH_QT)/lib
|
---|
2048 | endif
|
---|
2049 |
|
---|
2050 | ifeq ($(BUILD_TARGET),darwin)
|
---|
2051 | TEMPLATE_VBOXQTGUIEXE_INCS += $(VBOX_PATH_MACOSX_SDK_INCS)
|
---|
2052 | TEMPLATE_VBOXQTGUIEXE_LDFLAGS += -framework Carbon -framework QuickTime -bind_at_load
|
---|
2053 | TEMPLATE_VBOXQTGUIEXE_LIBS +=
|
---|
2054 | TEMPLATE_VBOXQTGUIEXE_LIBPATH +=
|
---|
2055 | else ifeq ($(BUILD_TARGET),os2)
|
---|
2056 | TEMPLATE_VBOXQTGUIEXE_LIBS +=
|
---|
2057 | TEMPLATE_VBOXQTGUIEXE_LIBPATH +=
|
---|
2058 | else
|
---|
2059 | TEMPLATE_VBOXQTGUIEXE_LIBS += \
|
---|
2060 | Xext \
|
---|
2061 | X11 \
|
---|
2062 | m \
|
---|
2063 | $(LIB_PTHREAD)
|
---|
2064 | TEMPLATE_VBOXQTGUIEXE_LIBPATH += \
|
---|
2065 | $(VBOX_LIBPATH_X11)
|
---|
2066 | endif
|
---|
2067 |
|
---|
2068 | endif
|
---|
2069 |
|
---|
2070 | # Add COM/XPCOM stuff
|
---|
2071 | TEMPLATE_VBOXQTGUIEXE_LIBS += \
|
---|
2072 | $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB)
|
---|
2073 | ifdef VBOX_WITH_XPCOM
|
---|
2074 | ## @todo may be worth creating the VBOX_XPCOM SDK def
|
---|
2075 | TEMPLATE_VBOXQTGUIEXE_DEFS += VBOX_WITH_XPCOM
|
---|
2076 | TEMPLATE_VBOXQTGUIEXE_INCS += \
|
---|
2077 | $(VBOX_XPCOM_INCS)
|
---|
2078 | TEMPLATE_VBOXQTGUIEXE_LIBS += \
|
---|
2079 | $(PATH_LIB)/VBoxXPCOMGlue$(VBOX_SUFF_LIB) \
|
---|
2080 | $(LIB_XPCOM)
|
---|
2081 | endif
|
---|
2082 |
|
---|
2083 | #
|
---|
2084 | # Template for building Qt GUI components.
|
---|
2085 | #
|
---|
2086 | TEMPLATE_VBOXQTGUI = VBox Qt GUI Components
|
---|
2087 | TEMPLATE_VBOXQTGUI_EXTENDS = VBOXQTGUIEXE
|
---|
2088 | TEMPLATE_VBOXQTGUI_LIBS = $(filter-out $(QTMAIN) $(PATH_BIN)/VBoxXML$(VBOX_SUFF_DLL),$(TEMPLATE_VBOXQTGUIEXE_LIBS))
|
---|
2089 | ifeq ($(BUILD_TARGET),darwin)
|
---|
2090 | TEMPLATE_VBOXQTGUI_LDFLAGS = $(filter-out -framework Carbon -framework QuickTime -bind_at_load,$(TEMPLATE_VBOXQTGUIEXE_LDFLAGS))
|
---|
2091 | endif
|
---|
2092 | ifeq ($(BUILD_TARGET_ARCH),amd64)
|
---|
2093 | ifneq ($(BUILD_TARGET),win)
|
---|
2094 | TEMPLATE_VBOXQTGUI_DEFS = PIC $(TEMPLATE_VBOXQTGUIEXE_DEFS)
|
---|
2095 | TEMPLATE_VBOXQTGUI_CFLAGS = -fPIC $(TEMPLATE_VBOXQTGUIEXE_CFLAGS)
|
---|
2096 | TEMPLATE_VBOXQTGUI_CXXFLAGS = -fPIC $(TEMPLATE_VBOXQTGUIEXE_CXXFLAGS)
|
---|
2097 | TEMPLATE_VBOXQTGUI_LDFLAGS = -fPIC $(TEMPLATE_VBOXQTGUIEXE_LDFLAGS)
|
---|
2098 | endif
|
---|
2099 | endif
|
---|
2100 |
|
---|
2101 |
|
---|
2102 | #
|
---|
2103 | # Template for building build bldprogs.
|
---|
2104 | #
|
---|
2105 | TEMPLATE_VBOXBLDPROG = VBox Build Program
|
---|
2106 | TEMPLATE_VBOXBLDPROG_DEFS = IN_RING3
|
---|
2107 | ifeq ($(BUILD_PLATFORM),win)
|
---|
2108 | ifeq ($(BUILD_PLATFORM_ARCH),x86)
|
---|
2109 | ifdef VBOX_USE_VCC80
|
---|
2110 | TEMPLATE_VBOXBLDPROG_TOOL = VCC80X86
|
---|
2111 | else
|
---|
2112 | TEMPLATE_VBOXBLDPROG_TOOL = VCC70
|
---|
2113 | endif
|
---|
2114 | TEMPLATE_VBOXBLDPROG_SDKS = WIN32SDK
|
---|
2115 | else
|
---|
2116 | TEMPLATE_VBOXBLDPROG_TOOL = VCC80AMD64
|
---|
2117 | TEMPLATE_VBOXBLDPROG_SDKS = WIN64SDK
|
---|
2118 | endif
|
---|
2119 | ifneq ($(TEMPLATE_VBOXBLDPROG_TOOL),VCC70)
|
---|
2120 | TEMPLATE_VBOXBLDPROG_CXXFLAGS = -Zi -Zl -GR- -EHs-c- -GF- -MT -W3 -wd4996 -Zc:wchar_t-
|
---|
2121 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.debug = -RTCsu
|
---|
2122 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.release = -O2 -Oy- -GS-
|
---|
2123 | else
|
---|
2124 | TEMPLATE_VBOXBLDPROG_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -MT -W3
|
---|
2125 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.debug = -GZ
|
---|
2126 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.release = -Ogitb2 -Oy-
|
---|
2127 | endif
|
---|
2128 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.profile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.release)
|
---|
2129 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.kprofile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.release)
|
---|
2130 | TEMPLATE_VBOXBLDPROG_CFLAGS = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS)
|
---|
2131 | TEMPLATE_VBOXBLDPROG_CFLAGS.debug = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.debug)
|
---|
2132 | TEMPLATE_VBOXBLDPROG_CFLAGS.release = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.release)
|
---|
2133 | TEMPLATE_VBOXBLDPROG_CFLAGS.profile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.profile)
|
---|
2134 | TEMPLATE_VBOXBLDPROG_CFLAGS.kprofile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.kprofile)
|
---|
2135 | TEMPLATE_VBOXBLDPROG_LDFLAGS = \
|
---|
2136 | /NOD /INCREMENTAL:NO /MAPINFO:EXPORTS /LARGEADDRESSAWARE /DEBUG \
|
---|
2137 | /DISALLOWLIB:libcd.lib \
|
---|
2138 | /DISALLOWLIB:libcmtd.lib \
|
---|
2139 | /DISALLOWLIB:msvcrt.lib \
|
---|
2140 | /DISALLOWLIB:msvcrtd.lib \
|
---|
2141 | /DISALLOWLIB:msvcprt.lib \
|
---|
2142 | /DISALLOWLIB:msvcprtd.lib
|
---|
2143 | TEMPLATE_VBOXBLDPROG_LIBS = \
|
---|
2144 | $(PATH_TOOL_$(TEMPLATE_VBOXBLDPROG_TOOL)_LIB)/oldnames.lib \
|
---|
2145 | $(PATH_TOOL_$(TEMPLATE_VBOXBLDPROG_TOOL)_LIB)/libcmt.lib \
|
---|
2146 | $(PATH_TOOL_$(TEMPLATE_VBOXBLDPROG_TOOL)_LIB)/libcpmt.lib
|
---|
2147 |
|
---|
2148 | else
|
---|
2149 | # (gcc of some kind )
|
---|
2150 | TEMPLATE_VBOXBLDPROG_TOOL = GXX3
|
---|
2151 | TEMPLATE_VBOXBLDPROG_CFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC_Wno-variadic-macros) -pipe -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations
|
---|
2152 | TEMPLATE_VBOXBLDPROG_CFLAGS.debug = -fno-inline
|
---|
2153 | TEMPLATE_VBOXBLDPROG_CFLAGS.release = -O2 -fno-omit-frame-pointer -fno-strict-aliasing
|
---|
2154 | TEMPLATE_VBOXBLDPROG_CFLAGS.profile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.profile)
|
---|
2155 | TEMPLATE_VBOXBLDPROG_CFLAGS.kprofile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.kprofile)
|
---|
2156 | TEMPLATE_VBOXBLDPROG_CXXFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs -pipe
|
---|
2157 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.debug = -fno-inline
|
---|
2158 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.release = -O2 -fno-omit-frame-pointer -fno-strict-aliasing
|
---|
2159 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.profile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.release)
|
---|
2160 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.kprofile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.release)
|
---|
2161 | ifeq ($(BUILD_PLATFORM),linux)
|
---|
2162 | TEMPLATE_VBOXBLDPROG_LIBS = pthread m rt dl
|
---|
2163 | else ifeq ($(BUILD_PLATFORM),os2)
|
---|
2164 | TEMPLATE_VBOXBLDPROG_TOOL = GXX3OMF
|
---|
2165 | TEMPLATE_VBOXBLDPROG_LIBS = socket iconv
|
---|
2166 | else ifeq ($(BUILD_PLATFORM),darwin)
|
---|
2167 | TEMPLATE_VBOXBLDPROG_TOOL = GXX4MACHO
|
---|
2168 | TEMPLATE_VBOXBLDPROG_LIBS =
|
---|
2169 | TEMPLATE_VBOXBLDPROG_INCS += $(VBOX_PATH_MACOSX_SDK_INCS)
|
---|
2170 | else ifeq ($(filter-out freebsd netbsd openbsd,$(BUILD_PLATFORM)),)
|
---|
2171 | TEMPLATE_VBOXBLDPROG_TOOL = GXX3
|
---|
2172 | TEMPLATE_VBOXBLDPROG_LIBS =
|
---|
2173 | else ifeq ($(BUILD_PLATFORM),solaris)
|
---|
2174 | TEMPLATE_VBOXBLDPROG_TOOL = GXX3PLAIN
|
---|
2175 | TEMPLATE_VBOXBLDPROG_LIBS = rt
|
---|
2176 | else
|
---|
2177 | $(warning Warning: VBOX Build: Target $(BUILD_PLATFORM) is not officially supported!)
|
---|
2178 | endif
|
---|
2179 |
|
---|
2180 | endif # !win
|
---|
2181 |
|
---|
2182 |
|
---|
2183 |
|
---|
2184 | #
|
---|
2185 | # Template for building R3 win32 guest additions.
|
---|
2186 | #
|
---|
2187 | TEMPLATE_VBOXW32GUESTR3 = VBox Win32 Guest Program
|
---|
2188 | TEMPLATE_VBOXW32GUESTR3_INST = $(INST_ADDITIONS)
|
---|
2189 | TEMPLATE_VBOXW32GUESTR3_BLD_TRG = win
|
---|
2190 | TEMPLATE_VBOXW32GUESTR3_BLD_TRG_ARCH = x86
|
---|
2191 | TEMPLATE_VBOXW32GUESTR3_BLD_TRG_CPU = i386
|
---|
2192 | TEMPLATE_VBOXW32GUESTR3_DEFS = IN_GUEST IN_GUEST_R3 IN_RING3 IN_RT_R3 __WIN32__ __WIN__ HC_ARCH_BITS=32 GC_ARCH_BITS=32
|
---|
2193 | TEMPLATE_VBOXW32GUESTR3_RCDEFS = \
|
---|
2194 | VBOX_VERSION_MAJOR=\"$(VBOX_VERSION_MAJOR)\" \
|
---|
2195 | VBOX_VERSION_MINOR=\"$(VBOX_VERSION_MINOR)\" \
|
---|
2196 | VBOX_VERSION_BUILD=\"$(VBOX_VERSION_BUILD)\" \
|
---|
2197 | VBOX_VERSION_MAJOR_NR=$(VBOX_VERSION_MAJOR) \
|
---|
2198 | VBOX_VERSION_MINOR_NR=$(VBOX_VERSION_MINOR) \
|
---|
2199 | VBOX_VERSION_BUILD_NR=$(VBOX_VERSION_BUILD)
|
---|
2200 | TEMPLATE_VBOXW32GUESTR3_ASTOOL = YASM
|
---|
2201 | TEMPLATE_VBOXW32GUESTR3_ASFLAGS = -f win -DASM_FORMAT_PE -D__YASM__ -w+orphan-labels
|
---|
2202 | TEMPLATE_VBOXW32GUESTR3_DLLSUFF = .dll
|
---|
2203 | TEMPLATE_VBOXW32GUESTR3_EXESUFF = .exe
|
---|
2204 | TEMPLATE_VBOXW32GUESTR3_LIBSUFF = .lib
|
---|
2205 | TEMPLATE_VBOXW32GUESTR3_ARLIBSUFF = .lib
|
---|
2206 | TEMPLATE_VBOXW32GUESTR3_SDKS = WIN32SDK W2K3DDKX86
|
---|
2207 | ifdef VBOX_USE_VCC80
|
---|
2208 | TEMPLATE_VBOXW32GUESTR3_TOOL = VCC80X86
|
---|
2209 | TEMPLATE_VBOXW32GUESTR3_CXXFLAGS = -Zi -Zl -GR- -EHs-c- -GF- -MT -U__LINUX__ -U__OS2__ -W3 -wd4996 -Zc:wchar_t-
|
---|
2210 | TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.debug = -RTCsu
|
---|
2211 | TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.release = -O2 -Oy- -GS-
|
---|
2212 | else
|
---|
2213 | TEMPLATE_VBOXW32GUESTR3_TOOL = VCC70
|
---|
2214 | TEMPLATE_VBOXW32GUESTR3_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -MT -U__LINUX__ -U__OS2__ -W3
|
---|
2215 | TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.debug = -GZ
|
---|
2216 | TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.release = -Ogitb2 -Oy-
|
---|
2217 | endif
|
---|
2218 | TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.profile = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.release)
|
---|
2219 | TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.kprofile = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.release)
|
---|
2220 | TEMPLATE_VBOXW32GUESTR3_CFLAGS = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS)
|
---|
2221 | TEMPLATE_VBOXW32GUESTR3_CFLAGS.debug = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.debug)
|
---|
2222 | TEMPLATE_VBOXW32GUESTR3_CFLAGS.release = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.release)
|
---|
2223 | TEMPLATE_VBOXW32GUESTR3_CFLAGS.profile = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.profile)
|
---|
2224 | TEMPLATE_VBOXW32GUESTR3_CFLAGS.kprofile = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.kprofile)
|
---|
2225 | TEMPLATE_VBOXW32GUESTR3_INCS = \
|
---|
2226 | $(VBOX_PATH_SDK)/include
|
---|
2227 | TEMPLATE_VBOXW32GUESTR3_LDFLAGS = \
|
---|
2228 | /NOD /INCREMENTAL:NO /MAPINFO:EXPORTS /LARGEADDRESSAWARE \
|
---|
2229 | /DISALLOWLIB:libc.lib \
|
---|
2230 | /DISALLOWLIB:libcd.lib \
|
---|
2231 | /DISALLOWLIB:msvcrt.lib \
|
---|
2232 | /DISALLOWLIB:libcmtd.lib \
|
---|
2233 | /DISALLOWLIB:msvcrtd.lib
|
---|
2234 | ifdef VBOX_USE_VCC80
|
---|
2235 | TEMPLATE_VBOXW32GUESTR3_LIBS = \
|
---|
2236 | $(PATH_TOOL_VCC80X86_LIB)/oldnames.lib \
|
---|
2237 | $(PATH_TOOL_VCC80X86_LIB)/libcmt.lib \
|
---|
2238 | $(PATH_SDK_W2K3DDKX86_LIB)/ntdll.lib
|
---|
2239 | else
|
---|
2240 | TEMPLATE_VBOXW32GUESTR3_LIBS = \
|
---|
2241 | $(PATH_TOOL_VCC70_LIB)/oldnames.lib \
|
---|
2242 | $(PATH_TOOL_VCC70_LIB)/libcmt.lib \
|
---|
2243 | $(PATH_SDK_W2K3DDKX86_LIB)/ntdll.lib
|
---|
2244 | endif
|
---|
2245 | TEMPLATE_VBOXW32GUESTR3_POST_CMDS = $(VBOX_SIGN_IMAGE_CMDS)
|
---|
2246 |
|
---|
2247 | #
|
---|
2248 | # R3 win32 guest libraries
|
---|
2249 | #
|
---|
2250 | TEMPLATE_VBOXW32GUESTR3LIB = VBox Win32 Guest User Libraries
|
---|
2251 | TEMPLATE_VBOXW32GUESTR3LIB_EXTENDS = VBOXW32GUESTR3
|
---|
2252 | TEMPLATE_VBOXW32GUESTR3LIB_INST = $(INST_ADDITIONS_LIB)
|
---|
2253 |
|
---|
2254 |
|
---|
2255 | #
|
---|
2256 | # Template for building R0 win32 guest tools.
|
---|
2257 | #
|
---|
2258 | TEMPLATE_VBOXW32GUESTR0 = VBox Win32 Guest Driver
|
---|
2259 | TEMPLATE_VBOXW32GUESTR0_INST = $(INST_ADDITIONS)
|
---|
2260 | TEMPLATE_VBOXW32GUESTR0_BLD_TRG = win
|
---|
2261 | TEMPLATE_VBOXW32GUESTR0_BLD_TRG_ARCH = x86
|
---|
2262 | TEMPLATE_VBOXW32GUESTR0_BLD_TRG_CPU = i386
|
---|
2263 | TEMPLATE_VBOXW32GUESTR0_DEFS = _X86_ IN_GUEST IN_GUEST_R0 IN_RING0 IN_RT_R0 __WIN32__ __WIN__ HC_ARCH_BITS=32 GC_ARCH_BITS=32
|
---|
2264 | TEMPLATE_VBOXW32GUESTR0_RCDEFS = \
|
---|
2265 | VBOX_VERSION_MAJOR=\"$(VBOX_VERSION_MAJOR)\" \
|
---|
2266 | VBOX_VERSION_MINOR=\"$(VBOX_VERSION_MINOR)\" \
|
---|
2267 | VBOX_VERSION_BUILD=\"$(VBOX_VERSION_BUILD)\" \
|
---|
2268 | VBOX_VERSION_MAJOR_NR=$(VBOX_VERSION_MAJOR) \
|
---|
2269 | VBOX_VERSION_MINOR_NR=$(VBOX_VERSION_MINOR) \
|
---|
2270 | VBOX_VERSION_BUILD_NR=$(VBOX_VERSION_BUILD)
|
---|
2271 | TEMPLATE_VBOXW32GUESTR0_ASTOOL = YASM
|
---|
2272 | TEMPLATE_VBOXW32GUESTR0_ASFLAGS = -f win32 -DASM_FORMAT_PE -D__YASM__ -w+orphan-labels
|
---|
2273 | TEMPLATE_VBOXW32GUESTR0_SYSSUFF = .sys
|
---|
2274 | ifdef VBOX_USE_VCC80
|
---|
2275 | TEMPLATE_VBOXW32GUESTR0_TOOL = VCC80X86
|
---|
2276 | TEMPLATE_VBOXW32GUESTR0_CXXFLAGS = -Zi -Zl -GR- -GS- -EHs-c- -GF- -Gz -U__LINUX__ -W3 -wd4996 -Zc:wchar_t-
|
---|
2277 | TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.debug = -GR- -EHs-c- -Zl
|
---|
2278 | TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.release = -O2 -Oy-
|
---|
2279 | else
|
---|
2280 | TEMPLATE_VBOXW32GUESTR0_TOOL = VCC70
|
---|
2281 | TEMPLATE_VBOXW32GUESTR0_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -Gz -U__LINUX__ -W3
|
---|
2282 | TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.debug = -GR- -GX- -Zl
|
---|
2283 | TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.release = -Ogitb2 -Oy-
|
---|
2284 | endif
|
---|
2285 | TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.profile = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.release)
|
---|
2286 | TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.kprofile = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.release)
|
---|
2287 | TEMPLATE_VBOXW32GUESTR0_CFLAGS = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS)
|
---|
2288 | TEMPLATE_VBOXW32GUESTR0_CFLAGS.debug = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.debug)
|
---|
2289 | TEMPLATE_VBOXW32GUESTR0_CFLAGS.release = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.release)
|
---|
2290 | TEMPLATE_VBOXW32GUESTR0_CFLAGS.profile = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.profile)
|
---|
2291 | TEMPLATE_VBOXW32GUESTR0_CFLAGS.kprofile = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.kprofile)
|
---|
2292 | TEMPLATE_VBOXW32GUESTR0_LDFLAGS = \
|
---|
2293 | -Driver -Subsystem:NATIVE -Incremental:NO -Align:32 -MapInfo:Exports -NoD -Machine:X86 -Debug \
|
---|
2294 | /DISALLOWLIB:libcd.lib \
|
---|
2295 | /DISALLOWLIB:msvcrt.lib \
|
---|
2296 | /DISALLOWLIB:msvcrtd.lib \
|
---|
2297 | /DISALLOWLIB:libcmtd.lib
|
---|
2298 | TEMPLATE_VBOXW32GUESTR0_POST_CMDS = $(VBOX_SIGN_DRIVER_CMDS)
|
---|
2299 |
|
---|
2300 | #
|
---|
2301 | # R0 win32 guest libraries
|
---|
2302 | #
|
---|
2303 | TEMPLATE_VBOXW32GUESTR0LIB = VBox Win32 Guest Driver
|
---|
2304 | TEMPLATE_VBOXW32GUESTR0LIB_EXTENDS = VBOXW32GUESTR0
|
---|
2305 | TEMPLATE_VBOXW32GUESTR0LIB_INST = $(INST_ADDITIONS_LIB)
|
---|
2306 |
|
---|
2307 |
|
---|
2308 | #
|
---|
2309 | # Windows rc workaround for crosscompiling.
|
---|
2310 | # (Some (old) Wine versions fails loading msvcrt.dll from the VCC bin directory.)
|
---|
2311 | #
|
---|
2312 | ifneq ($(BUILD_PLATFORM),win)
|
---|
2313 | TOOL_VCC80X86_RC := $(EXEC_X86_WIN32) $(PATH_DEVTOOLS)/win.x86/bin/rc.exe
|
---|
2314 | TOOL_VCC80AMD64_RC := $(EXEC_X86_WIN32) $(PATH_DEVTOOLS)/win.x86/bin/rc.exe
|
---|
2315 | TOOL_VCC70_RC := $(EXEC_X86_WIN32) $(PATH_DEVTOOLS)/win.x86/bin/rc.exe
|
---|
2316 | WIN32_MC = $(EXEC_X86_WIN32) $(PATH_DEVTOOLS)/win.x86/bin/mc.exe
|
---|
2317 | else
|
---|
2318 | WIN32_MC = $(EXEC_X86_WIN32) $(firstword $(wildcard \
|
---|
2319 | $(PATH_SDK_WINPSDK_BIN)/MC.Exe\
|
---|
2320 | $(PATH_SDK_WINPSDK)/Bin/MC.Exe\
|
---|
2321 | $(PATH_SDK_WIN32SDK_BIN)/MC.Exe\
|
---|
2322 | $(PATH_SDK_WIN64SDK_BIN)/MC.Exe\
|
---|
2323 | $(PATH_DEVTOOLS)/win.x86/bin/mc.exe\
|
---|
2324 | ) Sorry_Cannot_find_mc_in_the_PSDK)
|
---|
2325 | endif
|
---|
2326 |
|
---|
2327 |
|
---|
2328 | #
|
---|
2329 | # Template for syntax checking the linux guest additions.
|
---|
2330 | # Not properly realized yet.
|
---|
2331 | #
|
---|
2332 | TEMPLATE_VBOXLNX32GUESTR0 = Template for *syntax checking* linux guest additions kernel modules
|
---|
2333 | TEMPLATE_VBOXLNX32GUESTR0_TOOL = $(VBOX_GCC_TOOL)
|
---|
2334 | TEMPLATE_VBOXLNX32GUESTR0_BLD_TRG = linux
|
---|
2335 | TEMPLATE_VBOXLNX32GUESTR0_DEFS = __KERNEL__ MODULE IN_GUEST IN_GUEST_R0 IN_RING0 IN_RT_R0
|
---|
2336 | TEMPLATE_VBOXLNX32GUESTR0_INCS = $(VBOX_LINUX_INCS)
|
---|
2337 | TEMPLATE_VBOXLNX32GUESTR0_CFLAGS = -nostdinc -iwithprefix include \
|
---|
2338 | -O2 -Wall -Wstrict-prototypes -Wno-trigraphs $(VBOX_GCC_Wno-pointer-sign) \
|
---|
2339 | $(VBOX_GCC_fno-stack-protector) -fno-strict-aliasing -fno-common \
|
---|
2340 | -mpreferred-stack-boundary=2 -msoft-float
|
---|
2341 | TEMPLATE_VBOXLNX32GUESTR0_CXXFLAGS = $(filter-out -Wstrict-prototypes -Wno-pointer-sign,$(TEMPLATE_VBOXLNX32GUESTR0_CFLAGS)) -fno-exceptions -fno-rtti
|
---|
2342 | ifndef VBOX_LINUX_VERSION_2_4
|
---|
2343 | # 2.6
|
---|
2344 | TEMPLATE_VBOXLNX32GUESTR0_SYSSUFF = .ko
|
---|
2345 | TEMPLATE_VBOXLNX32GUESTR0_LDFLAGS = -m elf_i386 -r
|
---|
2346 | else
|
---|
2347 | # 2.4
|
---|
2348 | TEMPLATE_VBOXLNX32GUESTR0_SYSSUFF = .o
|
---|
2349 | TEMPLATE_VBOXLNX32GUESTR0_LDFLAGS = -r -s
|
---|
2350 | endif
|
---|
2351 |
|
---|
2352 |
|
---|
2353 | #
|
---|
2354 | # Templates for building 32-bit linux guest additions.
|
---|
2355 | #
|
---|
2356 |
|
---|
2357 | TEMPLATE_VBOXLNX32GUESTR3EXE = Template for building 32-bit linux guest additions programs.
|
---|
2358 | TEMPLATE_VBOXLNX32GUESTR3EXE_INST = $(INST_ADDITIONS)
|
---|
2359 | TEMPLATE_VBOXLNX32GUESTR3EXE_BLD_TRG = linux
|
---|
2360 | TEMPLATE_VBOXLNX32GUESTR3EXE_BLD_TRG_ARCH = x86
|
---|
2361 | TEMPLATE_VBOXLNX32GUESTR3EXE_BLD_TRG_CPU = i386
|
---|
2362 | TEMPLATE_VBOXLNX32GUESTR3EXE_TOOL = $(VBOX_GCC32_TOOL)
|
---|
2363 | TEMPLATE_VBOXLNX32GUESTR3EXE_ASTOOL = YASM
|
---|
2364 | TEMPLATE_VBOXLNX32GUESTR3EXE_ASFLAGS = -f elf32 -DASM_FORMAT_ELF -D__YASM__ -w+orphan-labels
|
---|
2365 | TEMPLATE_VBOXLNX32GUESTR3EXE_DEFS = IN_GUEST IN_GUEST_R3 IN_RING3 HC_ARCH_BITS=32 GC_ARCH_BITS=32
|
---|
2366 | TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs -pipe $(VBOX_GCC_fno-stack-protector)
|
---|
2367 | TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.debug = -fno-inline
|
---|
2368 | TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.release = -O2 -fno-omit-frame-pointer -fno-strict-aliasing
|
---|
2369 | TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.profile = $(TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.release)
|
---|
2370 | TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.kprofile = $(TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.release)
|
---|
2371 | TEMPLATE_VBOXLNX32GUESTR3EXE_CFLAGS.release = $(TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.release)
|
---|
2372 | TEMPLATE_VBOXLNX32GUESTR3EXE_CFLAGS.debug = $(TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.debug)
|
---|
2373 | TEMPLATE_VBOXLNX32GUESTR3EXE_CFLAGS.profile = $(TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.profile)
|
---|
2374 | TEMPLATE_VBOXLNX32GUESTR3EXE_CFLAGS.kprofile = $(TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.kprofile)
|
---|
2375 | TEMPLATE_VBOXLNX32GUESTR3EXE_CFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs -pipe -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations $(VBOX_GCC_fno-stack-protector)
|
---|
2376 | # No LDFLAGS nor LIBS!
|
---|
2377 |
|
---|
2378 | TEMPLATE_VBOXLNX32GUESTR3EXENOCPP = Template for building 32-bit linux guest additions programs without any C++.
|
---|
2379 | TEMPLATE_VBOXLNX32GUESTR3EXENOCPP_EXTENDS = VBOXLNX32GUESTR3EXE
|
---|
2380 | TEMPLATE_VBOXLNX32GUESTR3EXENOCPP_TOOL := $(subst GXX,GCC,$(VBOX_GCC32_TOOL))
|
---|
2381 | # No LDFLAGS nor LIBS!
|
---|
2382 |
|
---|
2383 | TEMPLATE_VBOXLNX32GUESTR3DLLNOCPP = Template for building 32-bit linux guest additions shared objects without any C++.
|
---|
2384 | TEMPLATE_VBOXLNX32GUESTR3DLLNOCPP_EXTENDS = VBOXLNX32GUESTR3EXE
|
---|
2385 | TEMPLATE_VBOXLNX32GUESTR3DLLNOCPP_TOOL = $(TEMPLATE_VBOXLNX32GUESTR3EXENOCPP_TOOL)
|
---|
2386 | TEMPLATE_VBOXLNX32GUESTR3DLLNOCPP_CFLAGS = -fPIC $(TEMPLATE_VBOXLNX32GUESTR3EXE_CFLAGS)
|
---|
2387 | TEMPLATE_VBOXLNX32GUESTR3DLLNOCPP_CXXFLAGS = -fPIC $(TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS)
|
---|
2388 | TEMPLATE_VBOXLNX32GUESTR3DLLNOCPP_LDFLAGS = -fPIC
|
---|
2389 |
|
---|
2390 | TEMPLATE_VBOXLNX32GUESTR3LIB = Template for building 32-bit linux guest additions libraries.
|
---|
2391 | TEMPLATE_VBOXLNX32GUESTR3LIB_EXTENDS = VBOXLNX32GUESTR3EXE
|
---|
2392 | TEMPLATE_VBOXLNX32GUESTR3LIB_INST = $(INST_ADDITION_LIB)
|
---|
2393 |
|
---|
2394 |
|
---|
2395 |
|
---|
2396 |
|
---|
2397 | ifdef VBOX_WITH_OS2_ADDITIONS
|
---|
2398 |
|
---|
2399 | #
|
---|
2400 | # Template for building R3 OS/2 guest additions.
|
---|
2401 | #
|
---|
2402 | TEMPLATE_VBOXOS2GUESTR3 = VBox OS/2 Guest Programs and DLLs
|
---|
2403 | TEMPLATE_VBOXOS2GUESTR3_INST = $(INST_ADDITIONS)os2/
|
---|
2404 | TEMPLATE_VBOXOS2GUESTR3_BLD_TRG = os2
|
---|
2405 | TEMPLATE_VBOXOS2GUESTR3_BLD_TRG_ARCH = x86
|
---|
2406 | TEMPLATE_VBOXOS2GUESTR3_BLD_TRG_CPU = blend
|
---|
2407 | TEMPLATE_VBOXOS2GUESTR3_DEFS = IN_GUEST IN_GUEST_R3 IN_RING3 IN_RT_R3 HC_ARCH_BITS=32 GC_ARCH_BITS=32
|
---|
2408 | TEMPLATE_VBOXOS2GUESTR3_ASTOOL = NASM
|
---|
2409 | TEMPLATE_VBOXOS2GUESTR3_ASFLAGS = -f obj -DASM_FORMAT_OMF -D__NASM__ -w+orphan-labels -g
|
---|
2410 | TEMPLATE_VBOXOS2GUESTR3_DLLSUFF = .dll
|
---|
2411 | TEMPLATE_VBOXOS2GUESTR3_EXESUFF = .exe
|
---|
2412 | TEMPLATE_VBOXOS2GUESTR3_LIBSUFF = .lib
|
---|
2413 | TEMPLATE_VBOXOS2GUESTR3_ARLIBSUFF = .lib
|
---|
2414 | TEMPLATE_VBOXOS2GUESTR3_TOOL = GXX3OMF
|
---|
2415 | TEMPLATE_VBOXOS2GUESTR3_CXXFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs -pipe -fno-strict-aliasing -fno-rtti -fno-exceptions
|
---|
2416 | TEMPLATE_VBOXOS2GUESTR3_CFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs -pipe -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -fno-strict-aliasing
|
---|
2417 | ifneq ($(BUILD_TYPE),debug)
|
---|
2418 | TEMPLATE_VBOXOS2GUESTR3_CFLAGS += -O2 -fno-omit-frame-pointer
|
---|
2419 | TEMPLATE_VBOXOS2GUESTR3_CXXFLAGS += -O2 -fno-omit-frame-pointer
|
---|
2420 | endif
|
---|
2421 | TEMPLATE_VBOXOS2GUESTR3_INCS = \
|
---|
2422 | $(VBOX_PATH_SDK)/include
|
---|
2423 |
|
---|
2424 | #
|
---|
2425 | # Template for building OS/2 guest R3 libraries.
|
---|
2426 | #
|
---|
2427 | TEMPLATE_VBOXOS2GUESTR3LIB = VBox OS/2 Guest Usermode Libraries
|
---|
2428 | TEMPLATE_VBOXOS2GUESTR3LIB_EXTENDS = VBOXOS2GUESTR3
|
---|
2429 | TEMPLATE_VBOXOS2GUESTR3LIB_INST = $(INST_ADDITIONS_LIB)os2/
|
---|
2430 |
|
---|
2431 | #
|
---|
2432 | # Template for building OS/2 Guest R0 images.
|
---|
2433 | #
|
---|
2434 | TEMPLATE_VBOXOS2GUESTR0 = VBox OS/2 Guest Driver
|
---|
2435 | TEMPLATE_VBOXOS2GUESTR0_INST = $(INST_ADDITIONS)os2/
|
---|
2436 | TEMPLATE_VBOXOS2GUESTR0_BLD_TRG = os2
|
---|
2437 | TEMPLATE_VBOXOS2GUESTR0_BLD_TRG_ARCH = x86
|
---|
2438 | TEMPLATE_VBOXOS2GUESTR0_BLD_TRG_CPU = blend
|
---|
2439 | TEMPLATE_VBOXOS2GUESTR0_DEFS = IN_RING0 IN_GUEST IN_GUEST_R0 IN_RT_R0 HC_ARCH_BITS=32 GC_ARCH_BITS=32 LOG_TO_BACKDOOR
|
---|
2440 | TEMPLATE_VBOXOS2GUESTR0_SYSSUFF = .sys
|
---|
2441 | TEMPLATE_VBOXOS2GUESTR0_ASTOOL = NASM
|
---|
2442 | TEMPLATE_VBOXOS2GUESTR0_ASFLAGS = -f obj -DASM_FORMAT_OMF -D__NASM__ -w+orphan-labels -g
|
---|
2443 | TEMPLATE_VBOXOS2GUESTR0_TOOL = GXX3OMF
|
---|
2444 | TEMPLATE_VBOXOS2GUESTR0_CXXFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs -pipe -fno-strict-aliasing -fno-rtti -fno-exceptions
|
---|
2445 | TEMPLATE_VBOXOS2GUESTR0_CFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs -pipe -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -fno-strict-aliasing
|
---|
2446 | ifneq ($(BUILD_TYPE),debug)
|
---|
2447 | TEMPLATE_VBOXOS2GUESTR0_CFLAGS += -O2 -fno-omit-frame-pointer
|
---|
2448 | TEMPLATE_VBOXOS2GUESTR0_CXXFLAGS += -O2 -fno-omit-frame-pointer
|
---|
2449 | endif
|
---|
2450 | TEMPLATE_VBOXOS2GUESTR0_LIBS = $(VBOX_GCC_LIBGCC) ## @todo this isn't nice.
|
---|
2451 | TEMPLATE_VBOXOS2GUESTR0_LDFLAGS = -Zlinker Option -Zlinker internalrelocs, -Zlinker togglerelocs
|
---|
2452 |
|
---|
2453 | #
|
---|
2454 | # Template for building OS/2 Guest R0 libraries.
|
---|
2455 | #
|
---|
2456 | TEMPLATE_VBOXOS2GUESTR0LIB = VBox OS/2 Guest Driver Library
|
---|
2457 | TEMPLATE_VBOXOS2GUESTR0LIB_EXTENDS = VBOXOS2GUESTR0
|
---|
2458 | TEMPLATE_VBOXOS2GUESTR0LIB_INST = $(INST_ADDITIONS_LIB)os2/
|
---|
2459 |
|
---|
2460 | #
|
---|
2461 | # OS/2 Guest Libraries.
|
---|
2462 | #
|
---|
2463 | VBOX_LIB_IPRT_OS2_GUEST_R0 = $(PATH_LIB)/additions/os2/RuntimeOS2GuestR0.lib
|
---|
2464 | VBOX_LIB_IPRT_OS2_GUEST_R3 = $(PATH_LIB)/additions/os2/RuntimeOS2GuestR3.lib
|
---|
2465 | VBOX_LIB_VBGL_OS2_R3 = $(PATH_LIB)/additions/os2/VBoxGuestR3LibOS2.lib
|
---|
2466 | VBOX_LIB_VBGL_OS2_R0BASE = $(PATH_LIB)/additions/os2/VBoxGuestR0LibBaseOS2.lib
|
---|
2467 | VBOX_LIB_VBGL_OS2_R0 = $(PATH_LIB)/additions/os2/VBoxGuestR0LibOS2.lib
|
---|
2468 |
|
---|
2469 | endif # VBOX_WITH_OS2_ADDITIONS
|
---|
2470 |
|
---|
2471 |
|
---|
2472 | #
|
---|
2473 | # Two targets to coordinate version number changes properly. Note that the
|
---|
2474 | # only way to get a really consistent build is to run 'kmk' in the top-level
|
---|
2475 | # directory. If you don't run it there, you get a consistent sub-tree only.
|
---|
2476 | #
|
---|
2477 | VBOX_VERSION_STAMP = $(PATH_OUT)/version-stamp-$(VBOX_VERSION_STRING)
|
---|
2478 | VBOX_VERSION_HEADER = $(PATH_OUT)/version-generated.h
|
---|
2479 | VBOX_VERSION_MK = $(PATH_OUT)/version-generated.mk
|
---|
2480 |
|
---|
2481 | $(VBOX_VERSION_STAMP): | $(PATH_ROOT)/Config.kmk
|
---|
2482 | $(call MSG_GENERATE,,$@)
|
---|
2483 | $(QUIET)$(MKDIR) -p $(@D)
|
---|
2484 | $(QUIET)$(RM) -f $(filter-out $@,$(wildcard $(PATH_OUT)/version-stamp-*))
|
---|
2485 | $(QUIET)$(ECHO_EXT) > $@
|
---|
2486 |
|
---|
2487 | $(VBOX_VERSION_HEADER): $(VBOX_VERSION_STAMP)
|
---|
2488 | $(call MSG_GENERATE,,$@)
|
---|
2489 | $(QUIET)$(MKDIR) -p $(@D)
|
---|
2490 | $(QUIET)$(RM) -f $@ [email protected]
|
---|
2491 | $(QUIET)$(APPEND) [email protected] "#ifndef ___version_generated_h___"
|
---|
2492 | $(QUIET)$(APPEND) [email protected] "#define ___version_generated_h___"
|
---|
2493 | $(QUIET)$(APPEND) [email protected] ""
|
---|
2494 | $(QUIET)$(APPEND) [email protected] "#define VBOX_VERSION_MAJOR $(VBOX_VERSION_MAJOR)"
|
---|
2495 | $(QUIET)$(APPEND) [email protected] "#define VBOX_VERSION_MINOR $(VBOX_VERSION_MINOR)"
|
---|
2496 | $(QUIET)$(APPEND) [email protected] "#define VBOX_VERSION_BUILD $(VBOX_VERSION_BUILD)"
|
---|
2497 | $(QUIET)$(APPEND) [email protected] '#define VBOX_VERSION_STRING "$(VBOX_VERSION_STRING)"'
|
---|
2498 | $(QUIET)$(APPEND) [email protected] ""
|
---|
2499 | $(QUIET)$(APPEND) [email protected] "#endif"
|
---|
2500 | $(QUIET)$(MV) -f [email protected] $@
|
---|
2501 |
|
---|
2502 | #
|
---|
2503 | # Used for external makefiles which cannot include Config.kmk
|
---|
2504 | #
|
---|
2505 | $(VBOX_VERSION_MK): $(VBOX_VERSION_STAMP)
|
---|
2506 | $(call MSG_GENERATE,,$@)
|
---|
2507 | $(QUIET)$(RM) -f $@ [email protected]
|
---|
2508 | $(QUIET)$(MKDIR) -p $(@D)
|
---|
2509 | $(QUIET)$(APPEND) [email protected] "VBOX_VERSION_MAJOR = $(VBOX_VERSION_MAJOR)"
|
---|
2510 | $(QUIET)$(APPEND) [email protected] "VBOX_VERSION_MINOR = $(VBOX_VERSION_MINOR)"
|
---|
2511 | $(QUIET)$(APPEND) [email protected] "VBOX_VERSION_BUILD = $(VBOX_VERSION_BUILD)"
|
---|
2512 | $(QUIET)$(APPEND) [email protected] "VBOX_VERSION_STRING = $(VBOX_VERSION_STRING)"
|
---|
2513 | $(QUIET)$(MV) -f [email protected] $@
|
---|
2514 |
|
---|
2515 |
|
---|
2516 | # Force building of the version header file as the first thing anywhere in
|
---|
2517 | # the tree. This eliminates the need for manual dependencies on it.
|
---|
2518 | Makefile.kmk: | $(VBOX_VERSION_HEADER) $(VBOX_VERSION_MK)
|
---|
2519 | Makefile: | $(VBOX_VERSION_HEADER) $(VBOX_VERSION_MK)
|
---|
2520 | makefile: | $(VBOX_VERSION_HEADER) $(VBOX_VERSION_MK)
|
---|
2521 |
|
---|
2522 |
|
---|
2523 | #
|
---|
2524 | # Subversion tree revision.
|
---|
2525 | #
|
---|
2526 | # The VBOX_SVN_REV contains our best guess. Use svn info on the
|
---|
2527 | # root of the treeto determin this it if .svn/entries is found,
|
---|
2528 | # otherwise fall back on the Config.kmk revision.
|
---|
2529 | #
|
---|
2530 | SVN ?= svn$(HOSTSUFF_EXE)
|
---|
2531 | VBOX_SVN_REV_KMK = $(PATH_OUT)/revision.kmk
|
---|
2532 | ifndef VBOX_SVN_REV
|
---|
2533 | VBOX_SVN_REV_FALLBACK := $(patsubst %:,, $Rev: 4548 $ )
|
---|
2534 | VBOX_SVN_DEP := $(wildcard $(PATH_ROOT)/.svn/entries)
|
---|
2535 |
|
---|
2536 | # Rule for generating a timestamp and updating the real thing on change.
|
---|
2537 | ifneq ($(VBOX_SVN_DEP),)
|
---|
2538 | $(VBOX_SVN_REV_KMK).ts: $(VBOX_SVN_DEP)
|
---|
2539 | else
|
---|
2540 | $(VBOX_SVN_REV_KMK).ts: $(PATH_ROOT)/Config.kmk
|
---|
2541 | endif
|
---|
2542 | $(call MSG_GENERATE,,$(VBOX_SVN_REV_KMK))
|
---|
2543 | $(QUIET)$(RM) -f $@
|
---|
2544 | $(QUIET)$(MKDIR) -p $(@D)
|
---|
2545 | ifneq ($(VBOX_SVN_DEP),)
|
---|
2546 | # $(QUIET)$(APPEND) $@ "export VBOX_SVN_REV=$(shell LC_ALL=C $(SVN) info $(PATH_ROOT) | $(SED) -e '/^Last Changed Rev/!d' -e "s/Last Changed Rev\: *//")"
|
---|
2547 | $(QUIET)$(APPEND) $@ "export VBOX_SVN_REV=$(shell LC_ALL=C $(SVN) info $(PATH_ROOT) | $(SED) -e '/^Revision/!d' -e "s/Revision\: *//")"
|
---|
2548 | else
|
---|
2549 | $(QUIET)$(APPEND) $@ "export VBOX_SVN_REV=$(VBOX_SVN_REV_FALLBACK)"
|
---|
2550 | endif
|
---|
2551 | $(QUIET)if test ! -f $(VBOX_SVN_REV_KMK) \
|
---|
2552 | || test ! "`$(CAT_EXT) $@`" = "`$(CAT_EXT) $(VBOX_SVN_REV_KMK)`"; \
|
---|
2553 | then \
|
---|
2554 | $(RM_EXT) -f $(VBOX_SVN_REV_KMK); \
|
---|
2555 | $(CP_EXT) -f $@ $(VBOX_SVN_REV_KMK) || exit 1; \
|
---|
2556 | echo '* $(VBOX_SVN_REV_KMK) was updated:'; \
|
---|
2557 | else \
|
---|
2558 | echo '* $(VBOX_SVN_REV_KMK) was not changed:'; \
|
---|
2559 | fi
|
---|
2560 | $(QUIET)$(CAT_EXT) $(VBOX_SVN_REV_KMK)
|
---|
2561 |
|
---|
2562 | # Dependency on timestamp without any commands, so we
|
---|
2563 | # won't be bother if nothing changed.
|
---|
2564 | $(VBOX_SVN_REV_KMK): $(VBOX_SVN_REV_KMK).ts
|
---|
2565 |
|
---|
2566 | ## @todo kBuild: Fix problem with using '$(VBOX_SVN_REV_KMK).ts +| $(VBOX_SVN_REV_KMK)' so the
|
---|
2567 | # problem with missing $(VBOX_SVN_REV_KMK) and not $(VBOX_SVN_REV_KMK).ts can be addressed
|
---|
2568 |
|
---|
2569 | ## @todo kbuild: Need $(CMP)!
|
---|
2570 |
|
---|
2571 | include $(VBOX_SVN_REV_KMK)
|
---|
2572 | else
|
---|
2573 | # allow to overwrite VBOX_SVN_REV externally (mainly for building .debs/.rpms)
|
---|
2574 | $(VBOX_SVN_REV_KMK):
|
---|
2575 | $(call MSG_GENERATE,,$(VBOX_SVN_REV_KMK))
|
---|
2576 | $(QUIET)$(RM) -f $@
|
---|
2577 | $(QUIET)$(MKDIR) -p $(@D)
|
---|
2578 | $(QUIET)$(APPEND) $@ "export VBOX_SVN_REV=$(VBOX_SVN_REV)"
|
---|
2579 | $(QUIET)echo '* $(VBOX_SVN_REV_KMK) was externally overwritten:'
|
---|
2580 | $(QUIET)$(CAT_EXT) $(VBOX_SVN_REV_KMK)
|
---|
2581 | endif
|
---|
2582 |
|
---|
2583 |
|
---|
2584 | #
|
---|
2585 | # Legacy.
|
---|
2586 | #
|
---|
2587 | ifneq ($(LOCALCFG),)
|
---|
2588 | include $(LOCALCFG)
|
---|
2589 | endif
|
---|
2590 |
|
---|
2591 |
|
---|
2592 | #
|
---|
2593 | # Some extra goals.
|
---|
2594 | #
|
---|
2595 | .PHONY: up update st stat status
|
---|
2596 | up update::
|
---|
2597 | $(SVN) up
|
---|
2598 |
|
---|
2599 | st stat status:
|
---|
2600 | $(SVN) status
|
---|
2601 |
|
---|
2602 | quick:
|
---|
2603 | $(MAKE) VBOX_QUICK=1
|
---|
2604 |
|
---|