VirtualBox

source: vbox/trunk/Config.kmk@ 1844

Last change on this file since 1844 was 1844, checked in by vboxsync, 18 years ago

More FFmpeg hacking.

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette