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