VirtualBox

source: vbox/trunk/Config.kmk@ 339

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

64-bit: fixed VBOXR0 and rearranged VBOXR0DRV options (Linux/GNU only)

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