VirtualBox

source: vbox/trunk/Config.kmk@ 137

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

More PIC stuff on amd64.

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