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