VirtualBox

source: vbox/trunk/Config.kmk@ 376

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

Libraries goes into LIBS not LDFLAGS, stupid. The C++ kext stuff builds fine now.

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