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