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