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