VirtualBox

source: vbox/trunk/Config.kmk@ 1941

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

L4 fixes

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