VirtualBox

source: vbox/trunk/Config.kmk@ 350

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

don't build Linux/GNU additions on amd64 yet.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 70.5 KB
Line 
1# $Id: Config.kmk 343 2007-01-26 03:06:51Z 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
752else
753 VBOX_GCC32_Wno-variadic-macros ?= $(VBOX_GCC_Wno-variadic-macros)
754endif
755
756# Find the compiler defines (for IPRT no-crt).
757ifndef VBOX_PATH_GCC_INCS
758 export VBOX_PATH_GCC_INCS := $(abspath $(dir $(shell LC_ALL=C $(TOOL_$(VBOX_GCC_TOOL)_CC) -print-libgcc-file-name)))/include
759endif
760
761# L4
762ifeq ($(BUILD_TARGET),l4)
763 ifndef VBOX_PATH_L4_GCC3_INSTALL
764 export VBOX_PATH_L4_GCC3_INSTALL := $(shell LANG=C $(TOOL_$(VBOX_GCC_TOOL)_CC) -print-search-dirs|sed -ne 's+^install: \(.*[^/][^/]*\)/\?+\1+p')
765 endif
766 VBOX_L4_GCC3_INCS := $(VBOX_PATH_L4_GCC3_INSTALL)/include
767 # L4_GPP3_INCS := \
768 # $(VBOX_PATH_L4_GCC3_INSTALL)/include/g++-v3/ \
769 # $(VBOX_PATH_L4_GCC3_INSTALL)/include/g++-v3/i386-pc-linux-gnu/
770endif
771
772#
773# Default prefixes and suffixes.
774#
775VBOX_PREF_LIB =
776ifeq ($(filter-out win os2,$(BUILD_TARGET)),)
777VBOX_SUFF_LIB = .lib
778else
779VBOX_SUFF_LIB = .a
780endif
781VBOXW32GUEST_SUFF_LIB = .lib
782VBOXLNX32GUEST_SUFF_LIB = .a
783
784#
785# SDKs for external libraries.
786#
787SDK_VBOX_XERCES = .
788SDK_VBOX_XERCES_INCS ?= $(PATH_ROOT)/src/libs/xerces-2.6.0/src
789SDK_VBOX_XERCES_LIBS ?= $(PATH_LIB)/VBox-xerces$(VBOX_SUFF_LIB)
790
791SDK_VBOX_XALAN = .
792SDK_VBOX_XALAN_INCS ?= $(PATH_ROOT)/src/libs/xalan-1.10.0
793SDK_VBOX_XALAN_LIBS ?= $(PATH_LIB)/VBox-xalan$(VBOX_SUFF_LIB)
794
795SDK_VBOX_LIBPNG = .
796SDK_VBOX_LIBPNG_INCS ?= $(PATH_ROOT)/src/libs/libpng-1.2.8
797SDK_VBOX_LIBPNG_LIBS ?= $(PATH_LIB)/VBox-libpng$(VBOX_SUFF_LIB)
798
799SDK_VBOX_ZLIB = .
800ifeq ($(filter-out win os2,$(BUILD_TARGET)),)
801 SDK_VBOX_ZLIB_INCS ?= $(PATH_ROOT)/src/libs/zlib-1.2.1
802 SDK_VBOX_ZLIB_LIBS ?= $(PATH_LIB)/VBox-zlib$(VBOX_SUFF_LIB)
803else
804 SDK_VBOX_ZLIB_INCS ?=
805 SDK_VBOX_ZLIB_LIBS ?= z
806endif
807
808SDK_VBOX_OPENSSL = .
809SDK_VBOX_OPENSSL_INCS?= $(PATH_ROOT)/src/libs/openssl-0.9.7e/include
810SDK_VBOX_OPENSSL_LIBS?= $(PATH_LIB)/VBox-libcrypto$(VBOX_SUFF_LIB)
811
812SDK_VBOX_FFMPEG = .
813ifeq ($(filter-out win os2,$(BUILD_TARGET)),)
814 SDK_VBOX_FFMPEG_INCS ?= \
815 $(PATH_ROOT)/src/libs/ffmpeg-20060710/libavutil \
816 $(PATH_ROOT)/src/libs/ffmpeg-20060710/libavcodec \
817 $(PATH_ROOT)/src/libs/ffmpeg-20060710/libavformat
818 ifeq ($(BUILD_TARGET),win)
819 ## Michael! Where is $(PATH_LIB)/VBoxFFmpegImp$(VBOX_SUFF_LIB) supposed to come from?
820 SDK_VBOX_FFMPEG_LIBS ?= $(PATH_LIB)/VBoxFFmpeg.a
821 else
822 SDK_VBOX_FFMPEG_LIBS ?= $(PATH_BIN)/VBoxFFmpeg$(SUFF_DLL)
823 endif
824else
825 SDK_VBOX_FFMPEG_INCS ?=
826 SDK_VBOX_FFMPEG_LIBS ?= avutil avcodec avformat
827endif
828
829#
830# Special SDK for the problematic NTDLL.LIB.
831#
832SDK_VBOX_NTDLL = Requires W2K3DDK
833SDK_VBOX_NTDLL_LIBS ?= $(PATH_SDK_W2K3DDK_LIB)/ntdll.lib
834
835
836#
837# Qt build tools, for Linux we require it to be present on the system
838#
839## @todo convert this into SDK and integrate the Qt stuff into kBuild.
840ifeq ($(BUILD_TARGET),win)
841 ifeq ($(BUILD_TARGET_ARCH),x86)
842 VBOX_PATH_QT ?= $(PATH_DEVTOOLS_TRG)/qt/v3.3.3
843 LIB_QT ?= $(VBOX_PATH_QT)/lib/dynamic/qt-mt333.lib
844 else
845 VBOX_PATH_QT ?= $(PATH_DEVTOOLS_TRG)/qt/v3.3.6
846 LIB_QT ?= $(VBOX_PATH_QT)/lib/dynamic/qt-mt336.lib
847 endif
848 LIB_QTMAIN ?= $(VBOX_PATH_QT)/lib/dynamic/qtmain.lib
849 ifndef QTDIR
850 QTDIR := $(sort $(wildcard $(PATH_DEVTOOLS_BLD)/v*))
851 QTDIR := $(call lastword,$(QTDIR))
852 endif
853endif
854ifndef VBOX_PATH_QT
855 VBOX_PATH_QT ?= $(QTDIR)
856 LIB_QT ?= qt-mt
857endif
858ifeq ($(BUILD_PLATFORM),$(BUILD_TARGET))
859 VBOX_PATH_QT_HOST ?= $(VBOX_PATH_QT)
860else
861 VBOX_PATH_QT_HOST ?= $(QTDIR)
862endif
863VBOX_UIC ?= $(VBOX_PATH_QT_HOST)/bin/uic$(HOSTSUFF_EXE)
864VBOX_MOC ?= $(VBOX_PATH_QT_HOST)/bin/moc$(HOSTSUFF_EXE)
865VBOX_LUPDATE ?= $(VBOX_PATH_QT_HOST)/bin/lupdate$(HOSTSUFF_EXE)
866VBOX_LRELEASE ?= $(VBOX_PATH_QT_HOST)/bin/lrelease$(HOSTSUFF_EXE)
867
868#
869# The linux kernel headers(/sources).
870#
871ifneq ($(filter linux l4,$(BUILD_TARGET)),)
872 ifeq ($(origin VBOX_LINUX_SRC),undefined)
873 ifneq ($(wildcard /lib/modules/$(shell uname -r)/build/include/linux/autoconf.h),)
874 export VBOX_LINUX_SRC := /lib/modules/$(shell uname -r)/build
875 else
876 export VBOX_LINUX_SRC := /usr/src/linux
877 endif
878 endif
879endif
880
881
882#
883# Template for building GC things.
884#
885TEMPLATE_VBOXGC = VBox GC
886TEMPLATE_VBOXGC_ASTOOL = $(VBOX_ASTOOL)
887TEMPLATE_VBOXGC_ASFLAGS = $(VBOX_ASFLAGS32)
888TEMPLATE_VBOXGC_DEFS = IN_GC $(ARCH_BITS_DEFS)
889TEMPLATE_VBOXGC_SYSSUFF = .gc
890TEMPLATE_VBOXGC_BLD_TRG_ARCH = x86
891
892ifeq ($(VBOX_LDR_FMT32),pe)
893ifdef VBOX_USE_VCC80
894 TEMPLATE_VBOXGC_TOOL = VCC80X86
895 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)
896else
897 TEMPLATE_VBOXGC_TOOL = VCC70
898 TEMPLATE_VBOXGC_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -W3 -wd4244 $(VBOX_VCC_GC_OPT) $(VBOX_VCC_GC_FP)
899endif
900TEMPLATE_VBOXGC_CFLAGS = $(TEMPLATE_VBOXGC_CXXFLAGS)
901TEMPLATE_VBOXGC_LDFLAGS = -Driver -Subsystem:NATIVE -Incremental:NO -Align:32 -MapInfo:Lines -MapInfo:Exports -NoD
902ifdef VBOX_USE_VCC80
903 include $(PATH_KBUILD)/sdks/W2K3DDKX86.kmk
904 TEMPLATE_VBOXGC_LIBS = \
905 $(PATH_SDK_W2K3DDKX86_LIB)/int64.lib
906else
907 TEMPLATE_VBOXGC_LIBS = \
908 $(PATH_TOOL_VCC70_LIB)/libcmt.lib # for 64-bit int
909endif
910endif
911
912ifeq ($(VBOX_LDR_FMT32),elf)
913TEMPLATE_VBOXGC_TOOL = $(VBOX_GCC32_TOOL)
914TEMPLATE_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)
915TEMPLATE_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)
916TEMPLATE_VBOXGC_LDFLAGS = -nostdlib -Bsymbolic
917# temporarily, must fix the loader.
918TEMPLATE_VBOXGC_LDFLAGS += -S
919TEMPLATE_VBOXGC_LDFLAGS.release = -S
920TEMPLATE_VBOXGC_LIBS = \
921 $(VBOX_GCC_LIBGCC) # instricts
922endif
923
924ifeq ($(VBOX_LDR_FMT32),macho)
925TEMPLATE_VBOXGC_TOOL = GCC4MACHO
926TEMPLATE_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
927TEMPLATE_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
928TEMPLATE_VBOXGC_LDFLAGS = -dynamic -nostdlib
929#TEMPLATE_VBOXGC_LDFLAGS.release = -Wl,-S ???
930TEMPLATE_VBOXGC_LIBS = \
931 $(VBOX_GCC_LIBGCC) # instricts
932endif
933
934ifeq ($(VBOX_LDR_FMT32),lx)
935TEMPLATE_VBOXGC_TOOL = GCC3OMF
936TEMPLATE_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
937TEMPLATE_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
938TEMPLATE_VBOXGC_LDFLAGS = -Zdll -nostdlib
939TEMPLATE_VBOXGC_LIBS = \
940 $(VBOX_GCC_LIBGCC) \
941 $(OBJ_SYS0) \
942 end
943endif
944
945
946#
947# Template for building a GC ring-3 testcase (tstVMStructGC, tstDevStructGC).
948#
949TEMPLATE_VBOXGCEXE = VBox GC as ring-3 testcase
950TEMPLATE_VBOXGCEXE_EXTENDS = VBOXGC
951
952ifeq ($(VBOX_LDR_FMT32),pe)
953 TEMPLATE_VBOXGCEXE_LDFLAGS = -Incremental:NO -MapInfo:Exports -NoD -Debug
954 TEMPLATE_VBOXGCEXE_SDKS = WIN32SDK
955 ifdef VBOX_USE_VCC80
956 TEMPLATE_VBOXGCEXE_LIBS = \
957 $(PATH_TOOL_VCC80X86_LIB)/libcmt.lib \
958 $(PATH_TOOL_VCC80X86_LIB)/oldnames.lib
959 else
960 TEMPLATE_VBOXGCEXE_LIBS = \
961 $(PATH_TOOL_VCC70_LIB)/libcmt.lib \
962 $(PATH_TOOL_VCC70_LIB)/oldnames.lib
963 endif
964endif
965
966ifeq ($(VBOX_LDR_FMT32),elf)
967 TEMPLATE_VBOXGCEXE_LDFLAGS := -g
968 TEMPLATE_VBOXGCEXE_LDFLAGS.release := -g
969endif
970
971ifeq ($(VBOX_LDR_FMT32),macho)
972 TEMPLATE_VBOXGCEXE_LDFLAGS := -g
973endif
974
975ifeq ($(VBOX_LDR_FMT32),lx)
976 TEMPLATE_VBOXGCEXE_LDFLAGS := -g
977 TEMPLATE_VBOXGCEXE_LIBS := $(NO_SUCH_VARIABLE)
978endif
979
980
981#
982# Template for building R0 things.
983#
984TEMPLATE_VBOXR0 = VBox Ring 0
985TEMPLATE_VBOXR0_ASTOOL = $(VBOX_ASTOOL)
986TEMPLATE_VBOXR0_ASFLAGS = $(VBOX_ASFLAGS)
987TEMPLATE_VBOXR0_DEFS = IN_RING0 $(ARCH_BITS_DEFS)
988
989ifeq ($(VBOX_LDR_FMT),pe)
990TEMPLATE_VBOXR0_TOOL = $(VBOX_VCC_TOOL)
991ifdef VBOX_USE_VCC80
992 TEMPLATE_VBOXR0_CXXFLAGS = -Zi -Zl -GR- -GS- -EHs-c- -GF- -W3 -wd4244 -wd4996 -Zc:wchar_t- $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
993else
994 TEMPLATE_VBOXR0_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -W3 -wd4244 $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
995endif
996TEMPLATE_VBOXR0_CFLAGS = $(TEMPLATE_VBOXR0_CXXFLAGS)
997TEMPLATE_VBOXR0_LDFLAGS = -Driver -Subsystem:NATIVE -Incremental:NO -Align:32 -MapInfo:Exports -NoD
998ifdef VBOX_USE_VCC80
999 TEMPLATE_VBOXR0_LIBS.x86 = \
1000 $(PATH_SDK_W2K3DDKX86_LIB)/int64.lib
1001else
1002 TEMPLATE_VBOXR0_LIBS.x86 = \
1003 $(PATH_TOOL_VCC70_LIB)/libcmt.lib # for 64-bit int
1004endif
1005endif # pe
1006
1007ifeq ($(VBOX_LDR_FMT),elf)
1008TEMPLATE_VBOXR0_TOOL = $(VBOX_GCC_TOOL)
1009TEMPLATE_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)
1010TEMPLATE_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)
1011TEMPLATE_VBOXR0_CFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-asynchronous-unwind-tables -ffreestanding
1012TEMPLATE_VBOXR0_CXXFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-asynchronous-unwind-tables
1013TEMPLATE_VBOXR0_LDFLAGS = -nostdlib -Bsymbolic
1014# temporarily, must fix the loader.
1015TEMPLATE_VBOXR0_LDFLAGS += -S
1016TEMPLATE_VBOXR0_LDFLAGS.release = -S
1017TEMPLATE_VBOXR0_LIBS = \
1018 $(VBOX_GCC_LIBGCC) # instricts
1019endif
1020
1021ifeq ($(VBOX_LDR_FMT),macho)
1022TEMPLATE_VBOXR0_TOOL = GCC4MACHO
1023TEMPLATE_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
1024TEMPLATE_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
1025TEMPLATE_VBOXR0_LDFLAGS = -dynamic -nostdlib
1026#TEMPLATE_VBOXR0_LDFLAGS.release = -Wl,-S ???
1027TEMPLATE_VBOXR0_LIBS = \
1028 $(VBOX_GCC_LIBGCC) # instricts
1029endif
1030
1031ifeq ($(VBOX_LDR_FMT),lx)
1032TEMPLATE_VBOXR0_TOOL = GCC3OMF
1033TEMPLATE_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
1034TEMPLATE_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
1035TEMPLATE_VBOXR0_LDFLAGS = -Zdll -nostdlib
1036TEMPLATE_VBOXR0_LIBS = \
1037 $(VBOX_GCC_LIBGCC) \
1038 $(OBJ_SYS0) \
1039 end
1040endif
1041
1042
1043#
1044# Template for building SUPDRV R0 things.
1045#
1046TEMPLATE_VBOXR0DRV = VBox SUPDRV Ring 0
1047TEMPLATE_VBOXR0DRV_ASTOOL = $(VBOX_ASTOOL)
1048TEMPLATE_VBOXR0DRV_ASFLAGS = $(VBOX_ASFLAGS)
1049TEMPLATE_VBOXR0DRV_DEFS = IN_RING0 IN_RT_R0 $(ARCH_BITS_DEFS)
1050
1051ifeq ($(BUILD_TARGET),win)
1052 TEMPLATE_VBOXR0DRV_TOOL = $(VBOX_VCC_TOOL)
1053 TEMPLATE_VBOXR0DRV_RCDEFS = \
1054 VBOX_VERSION_MAJOR=\"$(VBOX_VERSION_MAJOR)\" \
1055 VBOX_VERSION_MINOR=\"$(VBOX_VERSION_MINOR)\" \
1056 VBOX_VERSION_BUILD=\"$(VBOX_VERSION_BUILD)\" \
1057 VBOX_VERSION_MAJOR_NR=$(VBOX_VERSION_MAJOR) \
1058 VBOX_VERSION_MINOR_NR=$(VBOX_VERSION_MINOR) \
1059 VBOX_VERSION_BUILD_NR=$(VBOX_VERSION_BUILD)
1060 TEMPLATE_VBOXR0DRV_DEFS.x86 = _X86_
1061 TEMPLATE_VBOXR0DRV_DEFS.amd64 = _AMD64_
1062 ifdef VBOX_USE_VCC80
1063 TEMPLATE_VBOXR0DRV_CXXFLAGS = -Zi -Zl -GR- -GS- -EHs-c- -GF- -Gz -W3 -wd4996 -Zc:wchar_t- $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
1064 else
1065 TEMPLATE_VBOXR0DRV_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -Gz -W3 $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
1066 endif
1067 TEMPLATE_VBOXR0DRV_CFLAGS = $(TEMPLATE_VBOXR0DRV_CXXFLAGS)
1068 TEMPLATE_VBOXR0DRV_LDFLAGS = -Driver -Subsystem:NATIVE -Incremental:NO -Align:32 -MapInfo:Exports -NoD -Debug
1069endif
1070
1071ifeq ($(BUILD_TARGET),linux)
1072TEMPLATE_VBOXR0DRV_TOOL = $(VBOX_GCC_TOOL)
1073TEMPLATE_VBOXR0DRV_DEFS = __KERNEL__ MODULE IN_RING0 IN_RT_R0
1074TEMPLATE_VBOXR0DRV_INCS.x86 = \
1075 $(VBOX_LINUX_SRC)/include \
1076 $(VBOX_LINUX_SRC)/include/asm-i386/mach-default
1077TEMPLATE_VBOXR0DRV_INCS.amd64 = \
1078 $(VBOX_LINUX_SRC)/include
1079TEMPLATE_VBOXR0DRV_CFLAGS = -nostdinc -iwithprefix include \
1080 -Wall -Wstrict-prototypes -Wno-trigraphs $(VBOX_GCC_Wno-pointer-sign) \
1081 $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing -fno-common
1082TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -mpreferred-stack-boundary=2 -msoft-float
1083TEMPLATE_VBOXR0DRV_CFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow \
1084 -fno-reorder-blocks -ffreestanding -fno-asynchronous-unwind-tables -funit-at-a-time \
1085 -Wno-sign-compare -Wdeclaration-after-statement
1086TEMPLATE_VBOXR0DRV_CXXFLAGS = $(filter-out -Wstrict-prototypes -Wno-pointer-sign,$(TEMPLATE_VBOXR0DRV_CFLAGS)) -fno-exceptions -fno-rtti
1087 ifndef VBOX_LINUX_VERSION_2_4
1088# 2.6
1089TEMPLATE_VBOXR0DRV_SYSSUFF = .ko
1090TEMPLATE_VBOXR0DRV_LDFLAGS.x86 = -m elf_i386 -r
1091TEMPLATE_VBOXR0DRV_LDFLAGS.amd64 = -m elf_x86_64 -r
1092 else
1093# 2.4
1094TEMPLATE_VBOXR0DRV_SYSSUFF = .o
1095TEMPLATE_VBOXR0DRV_LDFLAGS = -r -s
1096 endif
1097endif
1098
1099ifeq ($(BUILD_TARGET),os2)
1100TEMPLATE_VBOXR0DRV_TOOL = GCC3OMF
1101TEMPLATE_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
1102TEMPLATE_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
1103endif
1104
1105ifeq ($(BUILD_TARGET),darwin)
1106TEMPLATE_VBOXR0DRV_TOOL = GCC4MACHO
1107TEMPLATE_VBOXR0DRV_DEFS += KERNEL KERNEL_PRIVATE DRIVER_PRIVATE APPLE NeXT
1108TEMPLATE_VBOXR0DRV_INCS += \
1109 /System/Library/Frameworks/Kernel.framework/PrivateHeaders \
1110 /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/Kernel.framework/Headers
1111TEMPLATE_VBOXR0DRV_CXXFLAGS = \
1112 -g -Wall -Wno-long-long -Wno-trigraphs -pipe -fno-common -nostdinc -fno-builtin -finline \
1113 -fno-keep-inline-functions -force_cpusubtype_ALL -fno-exceptions -msoft-float -static \
1114 -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk \
1115 -fapple-kext -fno-rtti -fcheck-new
1116TEMPLATE_VBOXR0DRV_CXXFLAGS.release = $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing -fasm-blocks
1117TEMPLATE_VBOXR0DRV_CXXFLAGS.profile = $(TEMPLATE_VBOXR0DRV_CXXFLAGS.release)
1118TEMPLATE_VBOXR0DRV_CXXFLAGS.kprofile = $(TEMPLATE_VBOXR0DRV_CXXFLAGS.release)
1119TEMPLATE_VBOXR0DRV_CFLAGS = \
1120 -g -Wall -Wno-long-long -Wno-trigraphs -pipe -fno-common -nostdinc -fno-builtin -finline \
1121 -fno-keep-inline-functions -force_cpusubtype_ALL -fno-exceptions -msoft-float -static \
1122 -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk \
1123 -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations
1124TEMPLATE_VBOXR0DRV_CFLAGS.release = $(TEMPLATE_VBOXR0DRV_CXXFLAGS.release)
1125TEMPLATE_VBOXR0DRV_CFLAGS.profile = $(TEMPLATE_VBOXR0DRV_CXXFLAGS.profile)
1126TEMPLATE_VBOXR0DRV_CFLAGS.kprofile = $(TEMPLATE_VBOXR0DRV_CXXFLAGS.kprofile)
1127TEMPLATE_VBOXR0DRV_LDFLAGS = \
1128 -static -nostdlib -r -lkmodc++ -lkmod -lcc_kext -lcpp_kext -Wl,-Y,1455 \
1129 -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
1130endif
1131
1132ifdef VBOX_WITH_VBOXDRV
1133 ifndef TEMPLATE_VBOXR0DRV_TOOL
1134 $(warning Warning: VBox Build: Target $(BUILD_PLATFORM) is not officially supported!)
1135 endif
1136endif
1137
1138
1139
1140#
1141# Template for building R3 executables and static libraries which are linked into executables.
1142#
1143TEMPLATE_VBOXR3EXE = VBox Ring 3 Exe
1144TEMPLATE_VBOXR3EXE_ASTOOL = $(VBOX_ASTOOL)
1145TEMPLATE_VBOXR3EXE_ASFLAGS = $(VBOX_ASFLAGS)
1146TEMPLATE_VBOXR3EXE_DEFS = IN_RING3
1147TEMPLATE_VBOXR3EXE_LIBS.kprofile = $(LIB_KPROFILE)
1148ifeq ($(BUILD_TARGET),win)
1149 TEMPLATE_VBOXR3EXE_TOOL = $(VBOX_VCC_TOOL)
1150 TEMPLATE_VBOXR3EXE_RCDEFS = \
1151 VBOX_VERSION_MAJOR=\"$(VBOX_VERSION_MAJOR)\" \
1152 VBOX_VERSION_MINOR=\"$(VBOX_VERSION_MINOR)\" \
1153 VBOX_VERSION_BUILD=\"$(VBOX_VERSION_BUILD)\" \
1154 VBOX_VERSION_MAJOR_NR=$(VBOX_VERSION_MAJOR) \
1155 VBOX_VERSION_MINOR_NR=$(VBOX_VERSION_MINOR) \
1156 VBOX_VERSION_BUILD_NR=$(VBOX_VERSION_BUILD)
1157 TEMPLATE_VBOXR3EXE_SDKS = WINPSDK
1158 ifdef VBOX_USE_VCC80
1159 TEMPLATE_VBOXR3EXE_CXXFLAGS = -Zi -Zl -GR- -EHs-c- -GF- -MD -W3 -wd4065 -wd4244 -wd4996 -Zc:wchar_t- $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
1160 TEMPLATE_VBOXR3EXE_CXXFLAGS.debug = -RTCsu
1161 else
1162 TEMPLATE_VBOXR3EXE_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -MD -W3 -wd4065 -wd4244 $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
1163 TEMPLATE_VBOXR3EXE_CXXFLAGS.debug = -GZ
1164 endif
1165 TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile = -Gh -GH
1166 TEMPLATE_VBOXR3EXE_CFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS)
1167 TEMPLATE_VBOXR3EXE_CFLAGS.debug = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.debug)
1168 TEMPLATE_VBOXR3EXE_CFLAGS.kprofile = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile)
1169 TEMPLATE_VBOXR3EXE_LDFLAGS = \
1170 /NOD /INCREMENTAL:NO /MAPINFO:EXPORTS /LARGEADDRESSAWARE /DEBUG \
1171 /DISALLOWLIB:libc.lib \
1172 /DISALLOWLIB:libcd.lib \
1173 /DISALLOWLIB:libcmt.lib \
1174 /DISALLOWLIB:libcmtd.lib \
1175 /DISALLOWLIB:msvcrtd.lib
1176 TEMPLATE_VBOXR3EXE_LIBS = \
1177 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt.lib \
1178 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcprt.lib \
1179 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/oldnames.lib
1180
1181else # the gcc guys
1182TEMPLATE_VBOXR3EXE_TOOL = $(VBOX_GCC_TOOL)
1183TEMPLATE_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
1184# L4 currently can't handle exception handling.
1185TEMPLATE_VBOXR3EXE_CXXFLAGS.l4 = -fno-exceptions -nostdinc \
1186 $(addprefix -I,$(VBOX_L4_GCC3_INCS) $(L4_INCDIR) $(FILE_TOOL_GPP3_INCDIR)) \
1187 $(DEBUG_L4)
1188TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile = -finstrument-functions
1189TEMPLATE_VBOXR3EXE_CFLAGS.debug = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.debug)
1190TEMPLATE_VBOXR3EXE_CFLAGS.kprofile = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile)
1191TEMPLATE_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
1192TEMPLATE_VBOXR3EXE_CFLAGS.darwin = -fno-common
1193TEMPLATE_VBOXR3EXE_CFLAGS.l4 = -nostdinc \
1194 $(addprefix -I,$(VBOX_L4_GCC3_INCS) $(L4_INCDIR)) $(DEBUG_L4)
1195TEMPLATE_VBOXR3EXE_DEFS.l4 = L4_THREAD_SAFE
1196TEMPLATE_VBOXR3EXE_LDFLAGS.l4 = \
1197 $(L4_LIBDIR)/../crt0.o \
1198 -T$(L4_LIBDIR)/../main_dyn.ld -nostdlib \
1199 -Wl,--export-dynamic,--dynamic-linker=libld-l4.s.so \
1200 -Wl,--rpath-link,$(L4_LIBDIR)
1201 ifeq ($(BUILD_TARGET),linux)
1202TEMPLATE_VBOXR3EXE_LIBS = pthread m $(LIB_UUID) rt dl
1203 else
1204 ifeq ($(BUILD_TARGET),l4)
1205TEMPLATE_VBOXR3EXE_LIBS = \
1206 $(L4_LIBDIR)/libvboxserver.s.so \
1207 $(L4_LIBDIR)/libuc++.0.s.so \
1208 supc++ gcc_eh gcc \
1209 $(L4_LIBDIR)/libdl.s.so \
1210 $(L4_LIBDIR)/libuc.0.s.so
1211 else
1212 ifeq ($(BUILD_TARGET),os2)
1213TEMPLATE_VBOXR3EXE_TOOL = GCC3OMF
1214TEMPLATE_VBOXR3EXE_LIBS = socket iconv
1215 else
1216 ifeq ($(BUILD_TARGET),darwin)
1217TEMPLATE_VBOXR3EXE_TOOL = GCC4MACHO
1218TEMPLATE_VBOXR3EXE_LIBS =
1219TEMPLATE_VBOXR3EXE_LDFLAGS = -read_only_relocs suppress
1220 else
1221$(warning Warning: VBOX Build: Target $(BUILD_TARGET) is not officially supported!)
1222TEMPLATE_VBOXR3EXE_CXXFLAGS.profile = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.release)
1223TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.krelease)
1224 endif
1225 endif
1226 endif
1227 endif
1228endif
1229
1230#
1231# Template for building R3 shared objects / DLLs.
1232# This is mostly identical to the VBOXR3EXE template.
1233#
1234TEMPLATE_VBOXR3 = VBox Ring 3 SO/DLLs
1235TEMPLATE_VBOXR3_EXTENDS = VBOXR3EXE
1236TEMPLATE_VBOXR3_LDFLAGS.l4 = $(L4_LIBDIR)/../crt0.s.o -T$(L4_LIBDIR)/../main_rel.ld -nostdlib
1237TEMPLATE_VBOXR3_DEFS.darwin = $(TEMPLATE_VBOXR3EXE_DEFS.darwin) PIC
1238ifeq ($(BUILD_TARGET_ARCH),amd64)
1239 ifneq ($(BUILD_TARGET),win)
1240 TEMPLATE_VBOXR3_DEFS = $(TEMPLATE_VBOXR3EXE_DEFS) PIC
1241 TEMPLATE_VBOXR3_CFLAGS = $(TEMPLATE_VBOXR3EXE_CFLAGS) -fPIC
1242 TEMPLATE_VBOXR3_CXXFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS) -fPIC
1243 TEMPLATE_VBOXR3_LDFLAGS = $(TEMPLATE_VBOXR3EXE_LDFLAGS) -fPIC
1244 endif
1245endif
1246
1247#
1248# Ring-3 testcase.
1249# This is the VBOXR3EXE template only with a different install dir.
1250#
1251TEMPLATE_VBOXR3TSTEXE = VBox Ring 3 Testcase Exe
1252TEMPLATE_VBOXR3TSTEXE_EXTENDS = VBOXR3EXE
1253TEMPLATE_VBOXR3TSTEXE_INST = $(INST_TESTCASE)
1254TEMPLATE_VBOXR3TSTEXE_LIBS = $(LIB_RUNTIME) $(TEMPLATE_VBOXR3EXE_LIBS)
1255
1256#
1257# Template for building bad C/C++ style R3 executables (no -pedantic).
1258#
1259TEMPLATE_VBOXR3NPEXE = VBox Ring 3 Non-pedantic
1260TEMPLATE_VBOXR3NPEXE_EXTENDS = VBOXR3EXE
1261ifneq ($(BUILD_TARGET),win)
1262 # (only gcc)
1263 TEMPLATE_VBOXR3NPEXE_TOOL = $(VBOX_GCC_TOOL)
1264 TEMPLATE_VBOXR3NPEXE_CXXFLAGS = $(filter-out -pedantic,$(TEMPLATE_VBOXR3EXE_CXXFLAGS))
1265 TEMPLATE_VBOXR3NPEXE_CFLAGS = $(filter-out -pedantic -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations ,$(TEMPLATE_VBOXR3EXE_CXXFLAGS))
1266endif
1267
1268#
1269# Template for building bad C/C++ style R3 shared libraries / Dlls (no -pedantic).
1270# This is mostly identical to the VBOXR3NPEXE template.
1271#
1272TEMPLATE_VBOXR3NP= VBox Ring 3 Non-pedantic
1273TEMPLATE_VBOXR3NP_EXTENDS = VBOXR3NPEXE
1274TEMPLATE_VBOXR3NP_LDFLAGS.l4 = \
1275 $(L4_LIBDIR)/../crt0.s.o \
1276 -T$(L4_LIBDIR)/../main_rel.ld \
1277 -nostdlib
1278ifeq ($(BUILD_TARGET_ARCH),amd64)
1279 ifneq ($(BUILD_TARGET),win)
1280 TEMPLATE_VBOXR3NP_DEFS = $(TEMPLATE_VBOXR3NPEXE_DEFS) PIC
1281 TEMPLATE_VBOXR3NP_CFLAGS = $(TEMPLATE_VBOXR3NPEXE_CFLAGS) -fPIC
1282 TEMPLATE_VBOXR3NP_CXXFLAGS = $(TEMPLATE_VBOXR3NPEXE_CXXFLAGS) -fPIC
1283 TEMPLATE_VBOXR3NP_LDFLAGS = $(TEMPLATE_VBOXR3NPEXE_LDFLAGS) -fPIC
1284 endif
1285endif
1286
1287
1288#
1289# Template for building libraries, shared libraries / modules
1290# which only depends on IPRT for crt.
1291#
1292TEMPLATE_VBOXNOCRTGCC = VBox no-crt GCC libraries and modules, yasm/nasm.
1293TEMPLATE_VBOXNOCRTGCC_DEFS = IN_RING3 IPRT_NO_CRT $(ARCH_BITS_DEFS)
1294TEMPLATE_VBOXNOCRTGCC_ASDEFS = ASM_CALL64_GCC
1295## @todo C++
1296TEMPLATE_VBOXNOCRTGCC_CFLAGS = -nostdinc -fno-strict-aliasing -fno-math-errno -Wall
1297TEMPLATE_VBOXNOCRTGCC_CFLAGS.amd64 = -mcmodel=medium -fno-common
1298#TEMPLATE_VBOXNOCRTGCC_CFLAGS.release = -O0 -fno-math-errno -fno-peephole2 -fno-strict-aliasing - for win64.
1299TEMPLATE_VBOXNOCRTGCC_CFLAGS.release = -O2 -fno-strict-aliasing
1300TEMPLATE_VBOXNOCRTGCC_CFLAGS.profile = $(TEMPLATE_VBOXNOCRTGCC_CFLAGS.release)
1301TEMPLATE_VBOXNOCRTGCC_CFLAGS.kprofile = $(TEMPLATE_VBOXNOCRTGCC_CFLAGS.release)
1302TEMPLATE_VBOXNOCRTGCC_CFLAGS.darwin = -mdynamic-no-pic
1303TEMPLATE_VBOXNOCRTGCC_INCS = $(VBOX_PATH_GCC_INCS) $(PATH_ROOT)/include/iprt/nocrt
1304#TEMPLATE_VBOXNOCRTGCC_INCS.l4 = $(VBOX_PATH_GCC_INCS) $(L4_INCDIR) - enable if necessary.
1305
1306ifeq ($(BUILD_TARGET).$(BUILD_TARGET_ARCH),win.amd64)
1307 # cross compile to 64-bit ELF (linux).
1308 TEMPLATE_VBOXNOCRTGCC_TOOL = XGCCAMD64LINUX
1309 TEMPLATE_VBOXNOCRTGCC_ASTOOL = yasm
1310 TEMPLATE_VBOXNOCRTGCC_ASFLAGS = -f elf64 -DASM_FORMAT_ELF -D__YASM__ -w+orphan-labels -g dwarf2
1311 TEMPLATE_VBOXNOCRTGCC_INCS = $(PATH_DEVTOOLS)/win.x86/x86_64-unknown-linux-gnu/20060701/libc/gcc/x86_64-unknown-linux-gnu/3.4.6/include
1312 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
1313 TEMPLATE_VBOXNOCRTGCC_LDFLAGS = -nostdlib
1314
1315else ifeq ($(BUILD_TARGET).$(BUILD_TARGET_ARCH),win.x86)
1316 # Use the default GCC (MinGW) with the Microsoft linker.
1317 # (Drop all '-g' options as we're unable to strip the debug info.)
1318 TEMPLATE_VBOXNOCRTGCC_TOOL = $(VBOX_GCC_TOOL)
1319 TEMPLATE_VBOXNOCRTGCC_ASTOOL = $(VBOX_ASTOOL)
1320 TEMPLATE_VBOXNOCRTGCC_ASFLAGS = $(VBOX_ASFLAGS)
1321 TEMPLATE_VBOXNOCRTGCC_LDTOOL = $(VBOX_VCC_TOOL)
1322 TEMPLATE_VBOXNOCRTGCC_LDFLAGS = -Incremental:NO -MapInfo:Exports -NoD
1323 TEMPLATE_VBOXNOCRTGCC_LIBS = $(VBOX_GCC_LIBGCC)
1324 TEMPLATE_VBOXNOCRTGCC_CFLAGS := $(filter-out -g,$(TEMPLATE_VBOXNOCRTGCC_CFLAGS)) -s
1325
1326else
1327 # Use the default GCC.
1328 # The use of --exclude-libs ALL is to avoid confusing the linux ld.so.
1329 TEMPLATE_VBOXNOCRTGCC_TOOL = $(VBOX_GCC_TOOL)
1330 TEMPLATE_VBOXNOCRTGCC_ASTOOL = $(VBOX_ASTOOL)
1331 TEMPLATE_VBOXNOCRTGCC_ASFLAGS = $(VBOX_ASFLAGS)
1332 TEMPLATE_VBOXNOCRTGCC_LDFLAGS = -nostdlib
1333 ifneq ($(filter-out os2 darwin,$(BUILD_TARGET)),)
1334 ifneq ($(BUILD_TARGET_ARCH),amd64)
1335 TEMPLATE_VBOXNOCRTGCC_LDFLAGS += -Wl,--no-undefined
1336 endif
1337 endif
1338 TEMPLATE_VBOXNOCRTGCC_LIBS = $(VBOX_GCC_LIBGCC)
1339endif
1340
1341
1342#
1343# Same as VBOXNOCRTGCC only it uses GAS as the assembler instead of yasm/nasm.
1344#
1345TEMPLATE_VBOXNOCRTGAS = VBox no-crt GCC libraries and modules, gas.
1346TEMPLATE_VBOXNOCRTGAS_EXTENDS = VBOXNOCRTGCC
1347TEMPLATE_VBOXNOCRTGAS_ASTOOL = $(TEMPLATE_VBOXNOCRTGCC_TOOL)
1348ifeq ($(BUILD_TARGET).$(BUILD_TARGET_ARCH),win.x86)
1349 TEMPLATE_VBOXNOCRTGAS_ASFLAGS = -s
1350else
1351 TEMPLATE_VBOXNOCRTGAS_ASFLAGS = -g
1352endif
1353
1354
1355#
1356# Template for building executables that is part of the VBox MAIN component.
1357#
1358TEMPLATE_VBOXMAINEXE = VBox Main Executables
1359TEMPLATE_VBOXMAINEXE_ASTOOL = $(VBOX_ASTOOL)
1360TEMPLATE_VBOXMAINEXE_ASFLAGS = $(VBOX_ASFLAGS)
1361TEMPLATE_VBOXMAINEXE_DEFS = IN_RING3 UNICODE
1362TEMPLATE_VBOXMAINEXE_LIBS.kprofile = $(LIB_KPROFILE)
1363
1364ifeq ($(BUILD_TARGET),win)
1365 TEMPLATE_VBOXMAINEXE_SDKS = WINPSDK W2K3DDK
1366 ifdef VBOX_USE_VCC80
1367 TEMPLATE_VBOXMAINEXE_TOOL = $(VBOX_VCC_TOOL)
1368 TEMPLATE_VBOXMAINEXE_CXXFLAGS = -Zi -Zl -GR -GF- -MD -EHsc -W3 -wd4065 -wd4996 -Zc:wchar_t- $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
1369 TEMPLATE_VBOXMAINEXE_CXXFLAGS.debug = -RTCsu
1370 else
1371 TEMPLATE_VBOXMAINEXE_TOOL = VCC70
1372 TEMPLATE_VBOXMAINEXE_CXXFLAGS = -Zi -Zl -GR -GX- -GF- -MD -EHsc -W3 -wd4065 $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
1373 TEMPLATE_VBOXMAINEXE_CXXFLAGS.debug = -GZ
1374 endif
1375 TEMPLATE_VBOXMAINEXE_CXXFLAGS.kprofile = -Gh -GH
1376 TEMPLATE_VBOXMAINEXE_CFLAGS = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS)
1377 TEMPLATE_VBOXMAINEXE_CFLAGS.debug = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.debug)
1378 TEMPLATE_VBOXMAINEXE_CFLAGS.kprofile = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.kprofile)
1379 TEMPLATE_VBOXMAINEXE_INCS = \
1380 $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_INC)
1381 TEMPLATE_VBOXMAINEXE_LDFLAGS = \
1382 /NOD /INCREMENTAL:NO /MAPINFO:EXPORTS /LARGEADDRESSAWARE /DEBUG\
1383 /DISALLOWLIB:libc.lib \
1384 /DISALLOWLIB:libcd.lib \
1385 /DISALLOWLIB:msvcrt.lib \
1386 /DISALLOWLIB:msvcrtd.lib \
1387 /DISALLOWLIB:libcmtd.lib \
1388 /DISALLOWLIB:libcmt.lib
1389 TEMPLATE_VBOXMAINEXE_LIBS = \
1390 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt.lib \
1391 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcprt.lib \
1392 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/oldnames.lib \
1393 $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_LIB)/atls.lib
1394
1395else # the GCC guys:
1396
1397TEMPLATE_VBOXMAINEXE_TOOL = $(VBOX_GCC_TOOL)
1398TEMPLATE_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
1399TEMPLATE_VBOXMAINEXE_CXXFLAGS.debug = -fno-inline
1400TEMPLATE_VBOXMAINEXE_CXXFLAGS.kprofile = -finstrument-functions
1401TEMPLATE_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
1402TEMPLATE_VBOXMAINEXE_CFLAGS.debug = -fno-inline
1403TEMPLATE_VBOXMAINEXE_CFLAGS.kprofile = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.kprofile)
1404 ifeq ($(BUILD_TARGET),linux)
1405TEMPLATE_VBOXMAINEXE_LIBS = pthread m $(LIB_UUID) rt
1406 else
1407 ifeq ($(BUILD_TARGET),l4)
1408TEMPLATE_VBOXMAINEXE_LIBS =
1409# no libs as yet in l4 target - must be added later
1410 else
1411 ifeq ($(BUILD_TARGET),os2)
1412TEMPLATE_VBOXMAINEXE_TOOL = GCC3OMF
1413TEMPLATE_VBOXMAINEXE_LIBS =
1414 else
1415 ifeq ($(BUILD_TARGET),darwin)
1416TEMPLATE_VBOXMAINEXE_TOOL = GCC4MACHO
1417TEMPLATE_VBOXMAINEXE_LIBS =
1418 else
1419$(warning Warning: VBOX Build: Target $(BUILD_TARGET) is not officially supported!)
1420TEMPLATE_VBOXMAINEXE_LIBS =
1421 endif # !darwin
1422 endif # !os2
1423 endif # !l4
1424 endif # !linux
1425
1426endif # !win
1427
1428#
1429# Template for building the Main (+GUI) components
1430# This differ from VBOXMAINEXE only in PIC handling and similar DLL stuff.
1431#
1432TEMPLATE_VBOXMAIN = VBox MAIN
1433TEMPLATE_VBOXMAIN_EXTENDS = VBOXMAINEXE
1434ifeq ($(BUILD_TARGET_ARCH),amd64)
1435 ifneq ($(BUILD_TARGET),win)
1436 TEMPLATE_VBOXMAIN_DEFS = PIC $(TEMPLATE_VBOXMAINEXE_DEFS)
1437 TEMPLATE_VBOXMAIN_CFLAGS = -fPIC $(TEMPLATE_VBOXMAINEXE_CFLAGS)
1438 TEMPLATE_VBOXMAIN_CXXFLAGS = -fPIC $(TEMPLATE_VBOXMAINEXE_CXXFLAGS)
1439 TEMPLATE_VBOXMAIN_LDFLAGS = -fPIC $(TEMPLATE_VBOXMAINEXE_LDFLAGS)
1440 endif
1441endif
1442
1443#
1444# Template for building executables that is part of the VBox MAIN component.
1445# This is (pretty much) identical to VBOXMAIN except for PIC handling (which will be fixed later).
1446#
1447TEMPLATE_VBOXMAIN = VBox Main
1448TEMPLATE_VBOXMAIN_EXTENDS = VBOXMAINEXE
1449
1450
1451#
1452# Template for building executables that use the VBox MAIN component (COM stuff etc.)
1453#
1454TEMPLATE_VBOXMAINCLIENT = VBox MAIN Client
1455TEMPLATE_VBOXMAINCLIENT_EXTENDS = VBOXMAINEXE
1456TEMPLATE_VBOXMAINCLIENT_INCS = $(TEMPLATE_VBOXMAINEXE_INCS) \
1457 $(PATH_BIN)/sdk/include
1458TEMPLATE_VBOXMAINCLIENT_INCS.linux = $(TEMPLATE_VBOXMAINEXE_INCS.linux) \
1459 $(VBOX_XPCOM_INCS)
1460TEMPLATE_VBOXMAINCLIENT_LIBS = $(TEMPLATE_VBOXMAINEXE_LIBS) \
1461 $(LIB_RUNTIME)
1462ifeq ($(BUILD_TARGET),win)
1463 TEMPLATE_VBOXMAINCLIENT_LIBS.win = $(TEMPLATE_VBOXMAINEXE_LIBS.win) \
1464 $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB) \
1465 $(PATH_SDK_WINPSDK_LIB)/User32.Lib \
1466 $(PATH_SDK_WINPSDK_LIB)/Shell32.Lib \
1467 $(PATH_SDK_WINPSDK_LIB)/ShLwApi.Lib \
1468 $(PATH_SDK_WINPSDK_LIB)/Ole32.Lib \
1469 $(PATH_SDK_WINPSDK_LIB)/OleAut32.Lib \
1470 $(PATH_SDK_WINPSDK_LIB)/Uuid.Lib
1471else
1472 TEMPLATE_VBOXMAINCLIENT_LIBS.linux = $(TEMPLATE_VBOXMAINEXE_LIBS.linux) \
1473 $(PATH_LIB)/VBoxXPCOM$(VBOX_SUFF_LIB) \
1474 $(PATH_BIN)/VBoxXPCOM.so \
1475 $(PATH_LIB)/VBoxXPCOMGlue$(VBOX_SUFF_LIB)
1476
1477 TEMPLATE_VBOXMAINCLIENT_CXXFLAGS.linux = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.linux) \
1478 -DNDEBUG -DTRIMMED -Wall -fno-rtti -fno-exceptions \
1479 -Wno-non-virtual-dtor -Wno-long-long -fshort-wchar -pthread -pipe
1480endif
1481
1482
1483#
1484# Template for building Qt GUI executables.
1485#
1486TEMPLATE_VBOXQTGUIEXE = VBox Qt GUI Executable
1487TEMPLATE_VBOXQTGUIEXE_DEFS = IN_RING3 QT_NO_DEBUG QT_THREAD_SUPPORT $(ARCH_BITS_DEFS)
1488TEMPLATE_VBOXQTGUIEXE_INCS = \
1489 $(PATH_BIN)/sdk/include \
1490 $(VBOX_PATH_QT)/include
1491
1492ifeq ($(BUILD_TARGET),win)
1493 TEMPLATE_VBOXQTGUIEXE_TOOL = $(VBOX_VCC_TOOL)
1494 TEMPLATE_VBOXQTGUIEXE_DEFS += _WIN32_WINNT=0x0500 UNICODE QT_DLL _CRT_SECURE_NO_DEPRECATE
1495 ## @todo VCC70 flags?
1496 ifdef VBOX_USE_VCC80
1497 TEMPLATE_VBOXQTGUIEXE_CXXFLAGS = \
1498 -nologo -Zm200 -W3 -MD -EHsc -Zc:wchar_t-
1499 TEMPLATE_VBOXQTGUIEXE_CXXFLAGS.debug = -RTCsu
1500 else
1501 TEMPLATE_VBOXQTGUIEXE_CXXFLAGS = \
1502 -nologo -Zm200 -W3 -MD -GX
1503 TEMPLATE_VBOXQTGUIEXE_CXXFLAGS.debug = -GZ
1504 endif
1505 TEMPLATE_VBOXQTGUIEXE_INCS += \
1506 $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_INC)
1507 TEMPLATE_VBOXQTGUIEXE_LDFLAGS = \
1508 /NOD /NOLOGO /INCREMENTAL:NO /MAPINFO:EXPORTS /DEBUG \
1509 /DELAYLOAD:oleaut32.dll
1510 TEMPLATE_VBOXQTGUIEXE_SDKS = WINPSDK
1511 TEMPLATE_VBOXQTGUIEXE_LIBS = \
1512 $(LIB_QT) \
1513 $(LIB_QTMAIN) \
1514 $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB) \
1515 $(LIB_RUNTIME) \
1516 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcprt.lib \
1517 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt.lib \
1518 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/oldnames.lib \
1519 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib \
1520 $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_LIB)/atls.lib
1521
1522else # the gcc guys:
1523 TEMPLATE_VBOXQTGUIEXE_TOOL = $(VBOX_GCC_TOOL)
1524 TEMPLATE_VBOXQTGUIEXE_DEFS += _REENTRANT
1525 TEMPLATE_VBOXQTGUIEXE_INCS += \
1526 $(LIB_SDL_INC) \
1527 $(VBOX_XPCOM_INCS)
1528 TEMPLATE_VBOXQTGUIEXE_CXXFLAGS = \
1529 -pipe -Wall -W -frtti -fno-exceptions -Wno-non-virtual-dtor \
1530 -Wno-long-long -fshort-wchar -pthread -fno-strict-aliasing
1531 ## @todo no $(LIB_QTMAIN) here?
1532 TEMPLATE_VBOXQTGUIEXE_LIBS = \
1533 $(LIB_QT) \
1534 Xext \
1535 X11 \
1536 m \
1537 $(LIB_SDL) \
1538 $(LIB_PTHREAD) \
1539 $(PATH_LIB)/VBoxXPCOM$(VBOX_SUFF_LIB) \
1540 $(LIB_RUNTIME) \
1541 $(LIB_REM) \
1542 $(LIB_VMM) \
1543 $(PATH_BIN)/VBoxXPCOM.so \
1544 $(PATH_LIB)/VBoxXPCOMGlue$(VBOX_SUFF_LIB)
1545
1546 TEMPLATE_VBOXQTGUIEXE_LIBPATH = \
1547 $(VBOX_PATH_QT)/lib \
1548 /usr/X11R6/lib
1549
1550endif
1551
1552#
1553# Template for building Qt GUI components.
1554#
1555TEMPLATE_VBOXQTGUI = VBox Qt GUI Components
1556TEMPLATE_VBOXQTGUI_EXTENDS = VBOXQTGUIEXE
1557TEMPLATE_VBOXQTGUI_LIBS = $(filter-out $(QTMAIN) $(PATH_BIN)/VBoxXML.so,$(TEMPLATE_VBOXQTGUIEXE_LIBS))
1558ifeq ($(BUILD_TARGET_ARCH),amd64)
1559 ifneq ($(BUILD_TARGET),win)
1560 TEMPLATE_VBOXQTGUI_DEFS = PIC $(TEMPLATE_VBOXQTGUIEXE_DEFS)
1561 TEMPLATE_VBOXQTGUI_CFLAGS = -fPIC $(TEMPLATE_VBOXQTGUIEXE_CFLAGS)
1562 TEMPLATE_VBOXQTGUI_CXXFLAGS = -fPIC $(TEMPLATE_VBOXQTGUIEXE_CXXFLAGS)
1563 TEMPLATE_VBOXQTGUI_LDFLAGS = -fPIC $(TEMPLATE_VBOXQTGUIEXE_LDFLAGS)
1564 endif
1565endif
1566
1567
1568#
1569# Template for building build bldprogs.
1570#
1571TEMPLATE_VBOXBLDPROG = VBox Build Program
1572TEMPLATE_VBOXBLDPROG_DEFS = IN_RING3
1573ifeq ($(BUILD_PLATFORM),win)
1574 ifeq ($(BUILD_PLATFORM_ARCH),x86)
1575 ifdef VBOX_USE_VCC80
1576 TEMPLATE_VBOXBLDPROG_TOOL = VCC80X86
1577 else
1578 TEMPLATE_VBOXBLDPROG_TOOL = VCC70
1579 endif
1580 TEMPLATE_VBOXBLDPROG_SDKS = WIN32SDK
1581 else
1582 TEMPLATE_VBOXBLDPROG_TOOL = VCC80AMD64
1583 TEMPLATE_VBOXBLDPROG_SDKS = WIN64SDK
1584 endif
1585 ifneq ($(TEMPLATE_VBOXBLDPROG_TOOL),VCC70)
1586 TEMPLATE_VBOXBLDPROG_CXXFLAGS = -Zi -Zl -GR- -EHs-c- -GF- -MT -W3 -wd4996 -Zc:wchar_t-
1587 TEMPLATE_VBOXBLDPROG_CXXFLAGS.debug = -RTCsu
1588 TEMPLATE_VBOXBLDPROG_CXXFLAGS.release = -O2 -Oy- -GS-
1589 else
1590 TEMPLATE_VBOXBLDPROG_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -MT -W3
1591 TEMPLATE_VBOXBLDPROG_CXXFLAGS.debug = -GZ
1592 TEMPLATE_VBOXBLDPROG_CXXFLAGS.release = -Ogitb2 -Oy-
1593 endif
1594 TEMPLATE_VBOXBLDPROG_CXXFLAGS.profile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.release)
1595 TEMPLATE_VBOXBLDPROG_CXXFLAGS.kprofile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.release)
1596 TEMPLATE_VBOXBLDPROG_CFLAGS = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS)
1597 TEMPLATE_VBOXBLDPROG_CFLAGS.debug = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.debug)
1598 TEMPLATE_VBOXBLDPROG_CFLAGS.release = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.release)
1599 TEMPLATE_VBOXBLDPROG_CFLAGS.profile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.profile)
1600 TEMPLATE_VBOXBLDPROG_CFLAGS.kprofile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.kprofile)
1601 TEMPLATE_VBOXBLDPROG_LDFLAGS = \
1602 /NOD /INCREMENTAL:NO /MAPINFO:EXPORTS /LARGEADDRESSAWARE /DEBUG \
1603 /DISALLOWLIB:libcd.lib \
1604 /DISALLOWLIB:libcmtd.lib \
1605 /DISALLOWLIB:msvcrt.lib \
1606 /DISALLOWLIB:msvcrtd.lib \
1607 /DISALLOWLIB:msvcprt.lib \
1608 /DISALLOWLIB:msvcprtd.lib
1609 TEMPLATE_VBOXBLDPROG_LIBS = \
1610 $(PATH_TOOL_$(TEMPLATE_VBOXBLDPROG_TOOL)_LIB)/oldnames.lib \
1611 $(PATH_TOOL_$(TEMPLATE_VBOXBLDPROG_TOOL)_LIB)/libcmt.lib \
1612 $(PATH_TOOL_$(TEMPLATE_VBOXBLDPROG_TOOL)_LIB)/libcpmt.lib
1613
1614else
1615# (gcc of some kind )
1616TEMPLATE_VBOXBLDPROG_TOOL = GCC3
1617TEMPLATE_VBOXBLDPROG_CFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC_Wno-variadic-macros) -pipe -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations
1618TEMPLATE_VBOXBLDPROG_CFLAGS.debug = -fno-inline
1619TEMPLATE_VBOXBLDPROG_CFLAGS.release = -O2 -fno-omit-frame-pointer -fno-strict-aliasing
1620TEMPLATE_VBOXBLDPROG_CFLAGS.profile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.profile)
1621TEMPLATE_VBOXBLDPROG_CFLAGS.kprofile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.kprofile)
1622TEMPLATE_VBOXBLDPROG_CXXFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs -pipe
1623TEMPLATE_VBOXBLDPROG_CXXFLAGS.debug = -fno-inline
1624TEMPLATE_VBOXBLDPROG_CXXFLAGS.release = -O2 -fno-omit-frame-pointer -fno-strict-aliasing
1625TEMPLATE_VBOXBLDPROG_CXXFLAGS.profile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.release)
1626TEMPLATE_VBOXBLDPROG_CXXFLAGS.kprofile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.release)
1627 ifeq ($(BUILD_PLATFORM),linux)
1628TEMPLATE_VBOXBLDPROG_LIBS = pthread m $(LIB_UUID) rt dl
1629 else
1630 ifeq ($(BUILD_PLATFORM),os2)
1631TEMPLATE_VBOXBLDPROG_TOOL = GCC3OMF
1632TEMPLATE_VBOXBLDPROG_LIBS = socket iconv
1633 else
1634 ifeq ($(BUILD_PLATFORM),darwin)
1635TEMPLATE_VBOXBLDPROG_TOOL = GCC4MACHO
1636TEMPLATE_VBOXBLDPROG_LIBS =
1637 else
1638$(warning Warning: VBOX Build: Target $(BUILD_PLATFORM) is not officially supported!)
1639 endif # !darwin
1640 endif # !os2
1641 endif # !linux
1642endif # !win
1643
1644
1645
1646#
1647# Template for building R3 win32 guest additions.
1648#
1649TEMPLATE_VBOXW32GUESTR3 = VBox Win32 Guest Program
1650TEMPLATE_VBOXW32GUESTR3_INST = $(INST_ADDITIONS)
1651TEMPLATE_VBOXW32GUESTR3_BLD_TRG = win
1652TEMPLATE_VBOXW32GUESTR3_BLD_TRG_ARCH = x86
1653TEMPLATE_VBOXW32GUESTR3_BLD_TRG_CPU = i386
1654TEMPLATE_VBOXW32GUESTR3_DEFS = IN_GUEST IN_GUEST_R3 IN_RT_R3 IN_RING3 __WIN32__ __WIN__
1655TEMPLATE_VBOXW32GUESTR3_RCDEFS = \
1656 VBOX_VERSION_MAJOR=\"$(VBOX_VERSION_MAJOR)\" \
1657 VBOX_VERSION_MINOR=\"$(VBOX_VERSION_MINOR)\" \
1658 VBOX_VERSION_BUILD=\"$(VBOX_VERSION_BUILD)\" \
1659 VBOX_VERSION_MAJOR_NR=$(VBOX_VERSION_MAJOR) \
1660 VBOX_VERSION_MINOR_NR=$(VBOX_VERSION_MINOR) \
1661 VBOX_VERSION_BUILD_NR=$(VBOX_VERSION_BUILD)
1662TEMPLATE_VBOXW32GUESTR3_ASTOOL = YASM
1663TEMPLATE_VBOXW32GUESTR3_ASFLAGS = -f win -DASM_FORMAT_PE -D__YASM__ -w+orphan-labels
1664TEMPLATE_VBOXW32GUESTR3_DLLSUFF = .dll
1665TEMPLATE_VBOXW32GUESTR3_EXESUFF = .exe
1666TEMPLATE_VBOXW32GUESTR3_LIBSUFF = .lib
1667TEMPLATE_VBOXW32GUESTR3_ARLIBSUFF = .lib
1668TEMPLATE_VBOXW32GUESTR3_SDKS = WIN32SDK W2K3DDKX86
1669ifdef VBOX_USE_VCC80
1670 TEMPLATE_VBOXW32GUESTR3_TOOL = VCC80X86
1671 TEMPLATE_VBOXW32GUESTR3_CXXFLAGS = -Zi -Zl -GR- -EHs-c- -GF- -MT -U__LINUX__ -U__OS2__ -W3 -wd4996 -Zc:wchar_t-
1672 TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.debug = -RTCsu
1673 TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.release = -O2 -Oy- -GS-
1674else
1675 TEMPLATE_VBOXW32GUESTR3_TOOL = VCC70
1676 TEMPLATE_VBOXW32GUESTR3_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -MT -U__LINUX__ -U__OS2__ -W3
1677 TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.debug = -GZ
1678 TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.release = -Ogitb2 -Oy-
1679endif
1680TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.profile = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.release)
1681TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.kprofile = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.release)
1682TEMPLATE_VBOXW32GUESTR3_CFLAGS = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS)
1683TEMPLATE_VBOXW32GUESTR3_CFLAGS.debug = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.debug)
1684TEMPLATE_VBOXW32GUESTR3_CFLAGS.release = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.release)
1685TEMPLATE_VBOXW32GUESTR3_CFLAGS.profile = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.profile)
1686TEMPLATE_VBOXW32GUESTR3_CFLAGS.kprofile = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.kprofile)
1687TEMPLATE_VBOXW32GUESTR3_INCS = \
1688 $(PATH_BIN)/sdk/include
1689TEMPLATE_VBOXW32GUESTR3_LDFLAGS = \
1690 /NOD /INCREMENTAL:NO /MAPINFO:EXPORTS /LARGEADDRESSAWARE \
1691 /DISALLOWLIB:libc.lib \
1692 /DISALLOWLIB:libcd.lib \
1693 /DISALLOWLIB:msvcrt.lib \
1694 /DISALLOWLIB:libcmtd.lib \
1695 /DISALLOWLIB:msvcrtd.lib
1696ifdef VBOX_USE_VCC80
1697 TEMPLATE_VBOXW32GUESTR3_LIBS = \
1698 $(PATH_TOOL_VCC80X86_LIB)/oldnames.lib \
1699 $(PATH_TOOL_VCC80X86_LIB)/libcmt.lib \
1700 $(PATH_SDK_W2K3DDKX86_LIB)/ntdll.lib
1701else
1702 TEMPLATE_VBOXW32GUESTR3_LIBS = \
1703 $(PATH_TOOL_VCC70_LIB)/oldnames.lib \
1704 $(PATH_TOOL_VCC70_LIB)/libcmt.lib \
1705 $(PATH_SDK_W2K3DDKX86_LIB)/ntdll.lib
1706endif
1707
1708#
1709# R3 win32 guest libraries
1710#
1711TEMPLATE_VBOXW32GUESTR3LIB = VBox Win32 Guest User Libraries
1712TEMPLATE_VBOXW32GUESTR3LIB_EXTENDS = VBOXW32GUESTR3
1713TEMPLATE_VBOXW32GUESTR3LIB_INST = $(INST_ADDITIONS_LIB)
1714
1715
1716#
1717# Template for building R0 win32 guest tools.
1718#
1719TEMPLATE_VBOXW32GUESTR0 = VBox Win32 Guest Driver
1720TEMPLATE_VBOXW32GUESTR0_INST = $(INST_ADDITIONS)
1721TEMPLATE_VBOXW32GUESTR0_BLD_TRG = win
1722TEMPLATE_VBOXW32GUESTR0_BLD_TRG_ARCH = x86
1723TEMPLATE_VBOXW32GUESTR0_BLD_TRG_CPU = i386
1724TEMPLATE_VBOXW32GUESTR0_DEFS = IN_RING0 _X86_ IN_GUEST_R0 IN_RT_R0 __WIN32__ __WIN__ HC_ARCH_BITS=32 GC_ARCH_BITS=32
1725TEMPLATE_VBOXW32GUESTR0_RCDEFS = \
1726 VBOX_VERSION_MAJOR=\"$(VBOX_VERSION_MAJOR)\" \
1727 VBOX_VERSION_MINOR=\"$(VBOX_VERSION_MINOR)\" \
1728 VBOX_VERSION_BUILD=\"$(VBOX_VERSION_BUILD)\" \
1729 VBOX_VERSION_MAJOR_NR=$(VBOX_VERSION_MAJOR) \
1730 VBOX_VERSION_MINOR_NR=$(VBOX_VERSION_MINOR) \
1731 VBOX_VERSION_BUILD_NR=$(VBOX_VERSION_BUILD)
1732TEMPLATE_VBOXW32GUESTR0_ASTOOL = YASM
1733TEMPLATE_VBOXW32GUESTR0_ASFLAGS = -f win32 -DASM_FORMAT_PE -D__YASM__ -w+orphan-labels
1734TEMPLATE_VBOXW32GUESTR0_SYSSUFF = .sys
1735ifdef VBOX_USE_VCC80
1736 TEMPLATE_VBOXW32GUESTR0_TOOL = VCC80X86
1737 TEMPLATE_VBOXW32GUESTR0_CXXFLAGS = -Zi -Zl -GR- -GS- -EHs-c- -GF- -Gz -U__LINUX__ -U__OS2__ -W3 -wd4996 -Zc:wchar_t-
1738 TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.debug = -GR- -EHs-c- -Zl
1739 TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.release = -O2 -Oy-
1740else
1741 TEMPLATE_VBOXW32GUESTR0_TOOL = VCC70
1742 TEMPLATE_VBOXW32GUESTR0_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -Gz -U__LINUX__ -U__OS2__ -W3
1743 TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.debug = -GR- -GX- -Zl
1744 TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.release = -Ogitb2 -Oy-
1745endif
1746TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.profile = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.release)
1747TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.kprofile = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.release)
1748TEMPLATE_VBOXW32GUESTR0_CFLAGS = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS)
1749TEMPLATE_VBOXW32GUESTR0_CFLAGS.debug = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.debug)
1750TEMPLATE_VBOXW32GUESTR0_CFLAGS.release = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.release)
1751TEMPLATE_VBOXW32GUESTR0_CFLAGS.profile = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.profile)
1752TEMPLATE_VBOXW32GUESTR0_CFLAGS.kprofile = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.kprofile)
1753TEMPLATE_VBOXW32GUESTR0_LDFLAGS = \
1754 -Driver -Subsystem:NATIVE -Incremental:NO -Align:32 -MapInfo:Exports -NoD -Machine:X86 -Debug \
1755 /DISALLOWLIB:libcd.lib \
1756 /DISALLOWLIB:msvcrt.lib \
1757 /DISALLOWLIB:msvcrtd.lib \
1758 /DISALLOWLIB:libcmtd.lib
1759
1760#
1761# R0 win32 guest libraries
1762#
1763TEMPLATE_VBOXW32GUESTR0LIB = VBox Win32 Guest Driver
1764TEMPLATE_VBOXW32GUESTR0LIB_EXTENDS = VBOXW32GUESTR0
1765TEMPLATE_VBOXW32GUESTR0LIB_INST = $(INST_ADDITIONS_LIB)
1766
1767
1768#
1769# Windows rc workaround for crosscompiling.
1770# (Some (old) Wine versions fails loading msvcrt.dll from the VCC bin directory.)
1771#
1772ifneq ($(BUILD_PLATFORM),win)
1773 TOOL_VCC80X86_RC := $(EXEC_X86_WIN32) $(PATH_DEVTOOLS)/win.x86/bin/rc.exe
1774 TOOL_VCC80AMD64_RC := $(EXEC_X86_WIN32) $(PATH_DEVTOOLS)/win.x86/bin/rc.exe
1775 TOOL_VCC70_RC := $(EXEC_X86_WIN32) $(PATH_DEVTOOLS)/win.x86/bin/rc.exe
1776 WIN32_MC = $(EXEC_X86_WIN32) $(PATH_DEVTOOLS)/win.x86/bin/mc.exe
1777else
1778 WIN32_MC = $(EXEC_X86_WIN32) $(firstword $(wildcard \
1779 $(PATH_SDK_WINPSDK_BIN)/MC.Exe\
1780 $(PATH_SDK_WINPSDK)/Bin/MC.Exe\
1781 $(PATH_SDK_WIN32SDK_BIN)/MC.Exe\
1782 $(PATH_SDK_WIN64SDK_BIN)/MC.Exe\
1783 $(PATH_DEVTOOLS)/win.x86/bin/mc.exe\
1784 ) Sorry_Cannot_find_mc_in_the_PSDK)
1785endif
1786
1787
1788#
1789# Template for syntax checking the linux guest additions.
1790# Not properly realized yet.
1791#
1792
1793TEMPLATE_VBOXLNX32GUESTR0 = Template for *syntax checking* linux guest additions kernel modules
1794TEMPLATE_VBOXLNX32GUESTR0_TOOL = $(VBOX_GCC_TOOL)
1795TEMPLATE_VBOXLNX32GUESTR0_BLD_TRG = linux
1796TEMPLATE_VBOXLNX32GUESTR0_DEFS = __KERNEL__ MODULE IN_RING0 IN_RT_R0 IN_GUEST_R0
1797TEMPLATE_VBOXLNX32GUESTR0_INCS = \
1798 $(VBOX_LINUX_SRC)/include \
1799 $(VBOX_LINUX_SRC)/include/asm-i386/mach-default
1800TEMPLATE_VBOXLNX32GUESTR0_CFLAGS = -nostdinc -iwithprefix include \
1801 -O2 -Wall -Wstrict-prototypes -Wno-trigraphs $(VBOX_GCC_Wno-pointer-sign) \
1802 $(VBOX_GCC_fno-stack-protector) -fno-strict-aliasing -fno-common \
1803 -mpreferred-stack-boundary=2 -msoft-float
1804TEMPLATE_VBOXLNX32GUESTR0_CXXFLAGS = $(filter-out -Wstrict-prototypes -Wno-pointer-sign,$(TEMPLATE_VBOXLNX32GUESTR0_CFLAGS)) -fno-exceptions -fno-rtti
1805ifndef VBOX_LINUX_VERSION_2_4
1806# 2.6
1807TEMPLATE_VBOXLNX32GUESTR0_SYSSUFF = .ko
1808TEMPLATE_VBOXLNX32GUESTR0_LDFLAGS = -m elf_i386 -r
1809else
1810# 2.4
1811TEMPLATE_VBOXLNX32GUESTR0_SYSSUFF = .o
1812TEMPLATE_VBOXLNX32GUESTR0_LDFLAGS = -r -s
1813endif
1814
1815TEMPLATE_VBOXLNX32GUESTR3EXE = Template for building 32-bit linux guest additions programs.
1816TEMPLATE_VBOXLNX32GUESTR3EXE_INST = $(INST_ADDITIONS)
1817TEMPLATE_VBOXLNX32GUESTR3EXE_BLD_TRG = linux
1818TEMPLATE_VBOXLNX32GUESTR3EXE_BLD_TRG_ARCH = x86
1819TEMPLATE_VBOXLNX32GUESTR3EXE_BLD_TRG_CPU = i386
1820TEMPLATE_VBOXLNX32GUESTR3EXE_TOOL = $(VBOX_GCC32_TOOL)
1821TEMPLATE_VBOXLNX32GUESTR3EXE_ASTOOL = YASM
1822TEMPLATE_VBOXLNX32GUESTR3EXE_ASFLAGS = -f elf32 -DASM_FORMAT_ELF -D__YASM__ -w+orphan-labels
1823TEMPLATE_VBOXLNX32GUESTR3EXE_DEFS = IN_RING3 IN_GUEST_R3
1824TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs -pipe $(VBOX_GCC_fno-stack-protector)
1825TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.debug = -fno-inline
1826TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.release = -O2 -fno-omit-frame-pointer -fno-strict-aliasing
1827TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.profile = $(TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.release)
1828TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.kprofile = $(TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.release)
1829TEMPLATE_VBOXLNX32GUESTR3EXE_CFLAGS.release = $(TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.release)
1830TEMPLATE_VBOXLNX32GUESTR3EXE_CFLAGS.debug = $(TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.debug)
1831TEMPLATE_VBOXLNX32GUESTR3EXE_CFLAGS.profile = $(TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.profile)
1832TEMPLATE_VBOXLNX32GUESTR3EXE_CFLAGS.kprofile = $(TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.kprofile)
1833TEMPLATE_VBOXLNX32GUESTR3EXE_CFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs -pipe -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations $(VBOX_GCC_fno-stack-protector)
1834TEMPLATE_VBOXLNX32GUESTR3EXE_LDFLAGS = # -static
1835TEMPLATE_VBOXLNX32GUESTR3EXE_LIBS = # pthread m $(LIB_UUID) rt dl
1836
1837TEMPLATE_VBOXLNX32GUESTR3LIB = Template for building 32-bit linux guest additions programs.
1838TEMPLATE_VBOXLNX32GUESTR3LIB_EXTENDS = VBOXLNX32GUESTR3EXE
1839TEMPLATE_VBOXLNX32GUESTR3LIB_INST = $(INST_ADDITION_LIB)
1840
1841TEMPLATE_VBOXLNX32GUESTR3 = Template for building 32-bit linux guest additions libraries.
1842TEMPLATE_VBOXLNX32GUESTR3_EXTENDS = VBOXLNX32GUESTR3EXE
1843TEMPLATE_VBOXLNX32GUESTR3_LDFLAGS = -static
1844TEMPLATE_VBOXLNX32GUESTR3_LIBS = pthread m $(LIB_UUID) rt dl
1845
1846
1847
1848##
1849## efence
1850##
1851#TEMPLATE_VBOXR3_CFLAGS += -include efence.h
1852#TEMPLATE_VBOXR3_CXXFLAGS += -include efence.h
1853#TEMPLATE_VBOXMAIN_CFLAGS += -include efence.h
1854#TEMPLATE_VBOXMAIN_CXXFLAGS += -include efence.h
1855#TEMPLATE_VBOXR3_LIBS += efence
1856#TEMPLATE_VBOXMAIN_LIBS += efence
1857
1858
1859#
1860# Two targets to coordinate version number changes properly. Note that the
1861# only way to get a really consistent build is to run 'kmk' in the top-level
1862# directory. If you don't run it there, you get a consistent sub-tree only.
1863#
1864VBOX_VERSION_STAMP = $(PATH_OUT)/version-stamp-$(VBOX_VERSION_MAJOR)-$(VBOX_VERSION_MINOR)-$(VBOX_VERSION_BUILD)
1865VBOX_VERSION_HEADER = $(PATH_OUT)/version-generated.h
1866VBOX_VERSION_MK = $(PATH_OUT)/version-generated.mk
1867
1868$(VBOX_VERSION_STAMP): | $(PATH_ROOT)/Config.kmk
1869 $(MKDIR) -p $(@D)
1870 $(RM) -f $(filter-out $@,$(wildcard $(PATH_OUT)/version-stamp-*))
1871 $(ECHO_EXT) > $@
1872
1873$(VBOX_VERSION_HEADER): $(VBOX_VERSION_STAMP)
1874 $(MKDIR) -p $(@D)
1875 $(RM) -f $@ [email protected]
1876 $(APPEND) [email protected] "#ifndef __version_generated_h__"
1877 $(APPEND) [email protected] "#define __version_generated_h__"
1878 $(APPEND) [email protected] ""
1879 $(APPEND) [email protected] "#define VBOX_VERSION_MAJOR $(VBOX_VERSION_MAJOR)"
1880 $(APPEND) [email protected] "#define VBOX_VERSION_MINOR $(VBOX_VERSION_MINOR)"
1881 $(APPEND) [email protected] "#define VBOX_VERSION_BUILD $(VBOX_VERSION_BUILD)"
1882 $(APPEND) [email protected] '#define VBOX_VERSION_STRING "$(VBOX_VERSION)"'
1883 $(APPEND) [email protected] ""
1884 $(APPEND) [email protected] "#endif"
1885 $(MV) -f [email protected] $@
1886
1887#
1888# Used for external makefiles which cannot include Config.kmk
1889#
1890$(VBOX_VERSION_MK): $(VBOX_VERSION_STAMP)
1891 $(MKDIR) -p $(@D)
1892 $(RM) -f $@ [email protected]
1893 $(APPEND) [email protected] "VBOX_VERSION_MAJOR = $(VBOX_VERSION_MAJOR)"
1894 $(APPEND) [email protected] "VBOX_VERSION_MINOR = $(VBOX_VERSION_MINOR)"
1895 $(APPEND) [email protected] "VBOX_VERSION_BUILD = $(VBOX_VERSION_BUILD)"
1896 $(MV) -f [email protected] $@
1897
1898
1899# Force building of the version header file as the first thing anywhere in
1900# the tree. This eliminates the need for manual dependencies on it.
1901Makefile.kmk: | $(VBOX_VERSION_HEADER) $(VBOX_VERSION_MK)
1902Makefile: | $(VBOX_VERSION_HEADER) $(VBOX_VERSION_MK)
1903makefile: | $(VBOX_VERSION_HEADER) $(VBOX_VERSION_MK)
1904
1905
1906#
1907# Legacy.
1908#
1909ifneq ($(LOCALCFG),)
1910 include $(LOCALCFG)
1911endif
1912
1913
1914#
1915# Some extra goals.
1916#
1917.PHONY: up update st stat status
1918up update::
1919 svn$(HOSTSUFF_EXE) up
1920
1921st stat status:
1922 svn$(HOSTSUFF_EXE) status
1923
1924quick:
1925 $(MAKE) VBOX_QUICK=1
1926
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