1 | # $Id: Config.kmk 5601 2007-11-01 01:28:56Z 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-2007 innotek 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 |
|
---|
22 | #
|
---|
23 | # kBuild stuff
|
---|
24 | #
|
---|
25 |
|
---|
26 | # Enable automatic installation of what's built.
|
---|
27 | KBUILD_DO_AUTO_INSTALL := 1
|
---|
28 | # Add the GPLExport pass.
|
---|
29 | PASSES := $(filter-out PACKING,$(PASSES)) PACKING # temporary hack
|
---|
30 | PASSES += GPLEXPORT
|
---|
31 | # Modify the order of the INSTALLS and OTHERS passes.
|
---|
32 | DEFAULT_PASSES := BLDPROGS LIBRARIES DLLS BINARIES INSTALLS OTHERS
|
---|
33 |
|
---|
34 | ## PASS: gplexport
|
---|
35 | # This pass processes custom gplexport rules listed in
|
---|
36 | # the GPLEXPORTS variable.
|
---|
37 | PASS_GPLEXPORT := GPL and LGPL source export
|
---|
38 | PASS_GPLEXPORT_trgs :=
|
---|
39 | PASS_GPLEXPORT_vars := GPLEXPORTS
|
---|
40 | PASS_GPLEXPORT_pass := gplexport
|
---|
41 | #alias
|
---|
42 | gplexport: pass_gplexport
|
---|
43 |
|
---|
44 | # Install paths.
|
---|
45 | PATH_INS := $(PATH_OUT)
|
---|
46 | ifeq ($(BUILD_TARGET),darwin)
|
---|
47 | INST_DIST = dist/
|
---|
48 | INST_SDK = $(INST_DIST)sdk/
|
---|
49 | INST_SDK_SAMPLES = $(INST_SDK)samples
|
---|
50 |
|
---|
51 | # the bundles
|
---|
52 | INST_VIRTUALBOX = $(INST_DIST)VirtualBox.app/
|
---|
53 | INST_VBOXDRV = $(INST_DIST)VBoxDrv.kext/
|
---|
54 | INST_VBOXTAP = $(INST_DIST)VBoxTAP.kext/
|
---|
55 | INST_VBOXUSB = $(INST_DIST)VBoxUSB.kext/
|
---|
56 |
|
---|
57 | # put everything in the VirtualBox app bundle.
|
---|
58 | INST_BIN = $(INST_VIRTUALBOX)Contents/MacOS/
|
---|
59 | INST_DLL = $(INST_BIN)
|
---|
60 | INST_SYS = $(INST_BIN)
|
---|
61 | INST_TESTCASE = $(INST_BIN)testcase/
|
---|
62 | INST_ADDITIONS = $(INST_BIN)additions/
|
---|
63 |
|
---|
64 | # other paths
|
---|
65 | INST_TESTSUITE = testsuite/
|
---|
66 | INST_LIB = lib/
|
---|
67 | INST_ADDITIONS_LIB = $(PATH_LIB)/additions/
|
---|
68 |
|
---|
69 | else
|
---|
70 |
|
---|
71 | INST_BIN = bin/
|
---|
72 | INST_DIST = $(INST_BIN)
|
---|
73 | INST_DLL = $(INST_BIN)
|
---|
74 | INST_SDK = $(INST_BIN)sdk/
|
---|
75 | INST_SDK_SAMPLES = $(INST_SDK)samples
|
---|
76 | INST_DLL = $(INST_BIN)
|
---|
77 | INST_SYS = $(INST_BIN)
|
---|
78 | INST_TESTCASE = $(INST_BIN)testcase/
|
---|
79 | INST_ADDITIONS = $(INST_BIN)additions/
|
---|
80 |
|
---|
81 | INST_TESTSUITE = testsuite/
|
---|
82 | INST_LIB = lib/
|
---|
83 | INST_ADDITIONS_LIB = $(INST_LIB)additions/
|
---|
84 | endif
|
---|
85 |
|
---|
86 | PATH_BIN = $(patsubst %/,%,$(PATH_INS)/$(INST_BIN))
|
---|
87 | PATH_DLL = $(patsubst %/,%,$(PATH_INS)/$(INST_DLL))
|
---|
88 | PATH_SYS = $(patsubst %/,%,$(PATH_INS)/$(INST_SYS))
|
---|
89 | PATH_LIB = $(patsubst %/,%,$(PATH_INS)/$(INST_LIB))
|
---|
90 | PATH_DOC = $(PATH_OUT)/doc
|
---|
91 | VBOX_PATH_SDK = $(patsubst %/,%,$(PATH_INS)/$(INST_SDK))
|
---|
92 | VBOX_PATH_DIST = $(patsubst %/,%,$(PATH_INS)/$(INST_DIST))
|
---|
93 | VBOX_PATH_TESTSUITE = $(patsubst %/,%,$(PATH_INS)/$(INST_TESTSUITE))
|
---|
94 |
|
---|
95 |
|
---|
96 | # Delete targets on failure.
|
---|
97 | .DELETE_ON_ERROR:
|
---|
98 |
|
---|
99 | # Notify about important kBuild updates.
|
---|
100 | ifneq ($(call int-ge,$(KMK_REVISION),1191),1)
|
---|
101 | $(error You must update kBuild!)
|
---|
102 | endif
|
---|
103 |
|
---|
104 | #
|
---|
105 | # Define USERNAME early on.
|
---|
106 | #
|
---|
107 | ifndef USERNAME
|
---|
108 | ifdef USER
|
---|
109 | USERNAME = $(USER)
|
---|
110 | else
|
---|
111 | $(warning Warning: You must have USERNAME or USER in your environment.)
|
---|
112 | endif
|
---|
113 | endif
|
---|
114 |
|
---|
115 | #
|
---|
116 | # The VirtualBox version.
|
---|
117 | #
|
---|
118 |
|
---|
119 | # Major version.
|
---|
120 | VBOX_VERSION_MAJOR = 1
|
---|
121 | # Minor version.
|
---|
122 | VBOX_VERSION_MINOR = 5
|
---|
123 | # This is the current build number. It should be increased every time we publish a
|
---|
124 | # new build. The define is available in every source file. Only even build numbers
|
---|
125 | # will be published, odd numbers are set during development.
|
---|
126 | VBOX_VERSION_BUILD = 51
|
---|
127 | # Full version string (may include more than just x.y.z, but no spaces or other problematic chars).
|
---|
128 | VBOX_VERSION_STRING = $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)
|
---|
129 |
|
---|
130 |
|
---|
131 | #
|
---|
132 | # The VirtualBox Configuration Defaults.
|
---|
133 | #
|
---|
134 |
|
---|
135 | # Build linux / win32 additions.
|
---|
136 | ifeq ($(BUILD_TARGET),linux)
|
---|
137 | VBOX_WITH_LINUX_ADDITIONS = 1
|
---|
138 | VBOX_WITH_WIN32_ADDITIONS = 1
|
---|
139 | endif
|
---|
140 | ifeq ($(BUILD_TARGET),l4)
|
---|
141 | VBOX_WITH_LINUX_ADDITIONS = 1
|
---|
142 | VBOX_WITH_WIN32_ADDITIONS = 1
|
---|
143 | endif
|
---|
144 | ifeq ($(BUILD_TARGET),os2)
|
---|
145 | VBOX_WITH_OS2_ADDITIONS = 1
|
---|
146 | endif
|
---|
147 | ifeq ($(BUILD_TARGET),win)
|
---|
148 | VBOX_WITH_WIN32_ADDITIONS = 1
|
---|
149 | endif
|
---|
150 | ifdef VBOX_WITH_LINUX_ADDITIONS
|
---|
151 | ifeq ($(BUILD_TARGET).$(BUILD_PLATFORM_ARCH),linux.x86)
|
---|
152 | VBOX_WITH_LINUX_ADDITIONS_32BIT_R0 = 1
|
---|
153 | endif
|
---|
154 | endif
|
---|
155 | # Enable the building of shared folders in the windows additions.
|
---|
156 | VBOX_WITH_WIN32_ADDITIONS_SHAREDFOLDERS = 1
|
---|
157 | # Take the binaries of the OS/2 Additions
|
---|
158 | VBOX_WITH_OS2_ADDITIONS_BIN = 1
|
---|
159 |
|
---|
160 | # build the installer
|
---|
161 | VBOX_WITH_INSTALLER = 1
|
---|
162 | # enable VRDP server
|
---|
163 | VBOX_WITH_VRDP = 1
|
---|
164 | # enable the new VRDP server interface which does not use COM
|
---|
165 | VBOX_WITH_VRDP_NO_COM = 1
|
---|
166 | # build VRDP authentication modules
|
---|
167 | VBOX_WITH_VRDP_AUTHMOD = 1
|
---|
168 | # build enhanced version of rdesktop
|
---|
169 | VBOX_WITH_VRDP_RDESKTOP = 1
|
---|
170 | if1of ($(BUILD_TARGET).$(BUILD_TARGET_ARCH), win.x86 l4.x86 l4.amd64)
|
---|
171 | # build the support driver & library with IDT patching.
|
---|
172 | VBOX_WITH_IDT_PATCHING = 1
|
---|
173 | endif
|
---|
174 | # The kernel driver/module and related runtime libraries.
|
---|
175 | VBOX_WITH_VBOXDRV = 1
|
---|
176 | # build with secure label support
|
---|
177 | ifeq ($(filter win.amd64,$(BUILD_TARGET).$(BUILD_TARGET_ARCH)),) # too much work with freetype and all that.
|
---|
178 | VBOX_WITH_SECURELABEL = 1
|
---|
179 | endif
|
---|
180 |
|
---|
181 | # the main api
|
---|
182 | VBOX_WITH_MAIN = 1
|
---|
183 | # the SDL based GUI
|
---|
184 | VBOX_WITH_VBOXSDL = 1
|
---|
185 | # the basic frontend (w/o Main)
|
---|
186 | VBOX_WITH_VBOXBFE = 1
|
---|
187 | # the Qt GUI
|
---|
188 | VBOX_WITH_QTGUI = 1
|
---|
189 | ## the Direct Framebuffer GUI
|
---|
190 | #VBOX_WITH_VBOXFB = 1
|
---|
191 | # the gui debugger
|
---|
192 | ifneq ($(BUILD_TYPE),release)
|
---|
193 | VBOX_WITH_DEBUGGER_GUI = 1
|
---|
194 | endif
|
---|
195 | # the documentation
|
---|
196 | VBOX_WITH_DOCS = 1
|
---|
197 | # build the Host Guest Communication Manager component
|
---|
198 | VBOX_WITH_HGCM = 1
|
---|
199 | # Enable the USB feature.
|
---|
200 | VBOX_WITH_USB = 1
|
---|
201 | # Enable the new PDM USB management code (work in progress).
|
---|
202 | VBOX_WITH_PDMUSB = 1
|
---|
203 | # Enable the ISCSI feature.
|
---|
204 | VBOX_WITH_ISCSI = 1
|
---|
205 | # Enable ALSA support for Linux
|
---|
206 | VBOX_WITH_ALSA = 1
|
---|
207 | # Disable WINMM support for Windows (not implemented)
|
---|
208 | VBOX_WITH_WINMM =
|
---|
209 | # Enable the kchmviewer
|
---|
210 | VBOX_WITH_KCHMVIEWER = 1
|
---|
211 | # Build the testsuite.
|
---|
212 | VBOX_WITH_TESTSUITE = 1
|
---|
213 | # Build the testcases.
|
---|
214 | VBOX_WITH_TESTCASES = 1
|
---|
215 | # Set this to not use COM or XPCOM in places where it can be avoided.
|
---|
216 | #VBOX_WITHOUT_COM = 1
|
---|
217 | # Set this to skip installing the redistributable compiler runtime.
|
---|
218 | #VBOX_WITHOUT_COMPILER_REDIST = 1
|
---|
219 | # Enabled internal networking.
|
---|
220 | VBOX_WITH_INTERNAL_NETWORKING = 1
|
---|
221 | # Enables the ffmpeg module for recording test runs.
|
---|
222 | #VBOX_WITH_FFMPEG = 1
|
---|
223 | # Enable OpenGL service
|
---|
224 | VBOX_WITH_OGL = 1
|
---|
225 | # Enable shared folders
|
---|
226 | VBOX_WITH_SHARED_FOLDERS = 1
|
---|
227 | # Enable shared clipboard
|
---|
228 | VBOX_WITH_SHARED_CLIPBOARD = 1
|
---|
229 | # Enable the Intel PXE ROM (replaces Etherboot).
|
---|
230 | VBOX_WITH_INTEL_PXE = 1
|
---|
231 | # Strip binaries of release and profile builds
|
---|
232 | VBOX_DO_STRIP = $(if $(filter release profile,$(BUILD_TYPE)),1,)
|
---|
233 | # Strip R0/GC modules (current requirement for our loader)
|
---|
234 | VBOX_DO_STRIP_MODULES = 1
|
---|
235 | # Use kStuff for MACH-O and LX binary loading.
|
---|
236 | if1of ($(BUILD_TARGET),darwin os2)
|
---|
237 | IPRT_WITH_KSTUFF = 1
|
---|
238 | endif
|
---|
239 | # Enable Crossbow support for Solaris.
|
---|
240 | #VBOX_WITH_CROSSBOW = 1
|
---|
241 |
|
---|
242 |
|
---|
243 | #
|
---|
244 | # Skip stuff.
|
---|
245 | #
|
---|
246 |
|
---|
247 | # VBOX_QUICK can be used by core developers to speed to the build
|
---|
248 | ifdef VBOX_QUICK
|
---|
249 | # undefine variables by assigning blank.
|
---|
250 | VBOX_WITH_TESTSUITE=
|
---|
251 | VBOX_WITH_TESTCASES=
|
---|
252 | VBOX_WITH_MAIN =
|
---|
253 | VBOX_WITH_VBOXSDL =
|
---|
254 | VBOX_WITH_VBOXBFE =
|
---|
255 | VBOX_WITH_QTGUI =
|
---|
256 | VBOX_WITH_DEBUGGER_GUI =
|
---|
257 | VBOX_WITH_DOCS =
|
---|
258 | endif # VBOX_QUICK
|
---|
259 |
|
---|
260 | # l4 have to skip a few things.
|
---|
261 | ifeq ($(BUILD_TARGET),l4)
|
---|
262 | VBOX_WITH_VBOXDRV=
|
---|
263 | VBOX_WITH_VRDP=
|
---|
264 | VBOX_WITH_VBOXSDL=
|
---|
265 | VBOX_WITH_QTGUI=
|
---|
266 | VBOX_WITH_MAIN=
|
---|
267 | VBOX_WITH_DOCS=
|
---|
268 | VBOX_WITH_ISCSI=
|
---|
269 | VBOX_WITH_INTERNAL_NETWORKING=
|
---|
270 | endif
|
---|
271 |
|
---|
272 | # Darwin have to skip a few things at present.
|
---|
273 | ifeq ($(BUILD_TARGET),darwin)
|
---|
274 | # Internal networking requires testing and possibly proper ring-3/ring0 separation.
|
---|
275 | VBOX_WITH_INTERNAL_NETWORKING=
|
---|
276 | # Don't bother with SDL ttf for now.
|
---|
277 | VBOX_WITH_SECURELABEL=
|
---|
278 | # Later:
|
---|
279 | VBOX_WITH_VRDP_AUTHMOD=
|
---|
280 | VBOX_WITH_VRDP_RDESKTOP=
|
---|
281 | endif
|
---|
282 |
|
---|
283 | # Most stuff doesn't build yet on the new targets.
|
---|
284 | ifeq ($(BUILD_TARGET),os2)
|
---|
285 | VBOX_WITH_INSTALLER=
|
---|
286 | VBOX_WITH_SECURELABEL=
|
---|
287 | VBOX_WITH_VRDP_AUTHMOD=
|
---|
288 | VBOX_WITH_VRDP_RDESKTOP=
|
---|
289 | VBOX_WITH_TESTSUITE=
|
---|
290 | VBOX_WITH_USB=
|
---|
291 | VBOX_WITH_DOCS=
|
---|
292 | endif
|
---|
293 |
|
---|
294 | ifeq ($(BUILD_TARGET),solaris)
|
---|
295 | VBOX_WITH_INSTALLER=
|
---|
296 | VBOX_WITH_SECURELABEL=
|
---|
297 | VBOX_WITH_VRDP_AUTHMOD=
|
---|
298 | VBOX_WITH_VRDP_RDESKTOP=
|
---|
299 | VBOX_WITH_TESTSUITE=
|
---|
300 | VBOX_WITH_USB=
|
---|
301 | VBOX_WITH_DOCS=
|
---|
302 | endif
|
---|
303 |
|
---|
304 | ifeq ($(BUILD_TARGET),freebsd)
|
---|
305 | VBOX_WITH_INSTALLER=
|
---|
306 | VBOX_WITH_SECURELABEL=
|
---|
307 | VBOX_WITH_VRDP_AUTHMOD=
|
---|
308 | VBOX_WITH_VRDP_RDESKTOP=
|
---|
309 | VBOX_WITH_TESTSUITE=
|
---|
310 | VBOX_WITH_USB=
|
---|
311 | VBOX_WITH_DOCS=
|
---|
312 | endif
|
---|
313 |
|
---|
314 |
|
---|
315 | #
|
---|
316 | # Include automatic and local config file to override the above settings
|
---|
317 | # and to provide defaults for the settings below this point.
|
---|
318 | #
|
---|
319 | AUTOCFG := $(wildcard $(PATH_ROOT)/AutoConfig.kmk)
|
---|
320 | ifeq ($(AUTOCFG),)
|
---|
321 | # deprecated name. to be removed.
|
---|
322 | AUTOCFG := $(wildcard $(PATH_ROOT)/Config.kmkconf)
|
---|
323 | ifneq ($(AUTOCFG),)
|
---|
324 | $(warning Config.kmkconf has been renamed. Please re-run configure.)
|
---|
325 | endif
|
---|
326 | endif
|
---|
327 | ifneq ($(AUTOCFG),)
|
---|
328 | include $(AUTOCFG)
|
---|
329 | endif
|
---|
330 |
|
---|
331 | LOCALCFG := $(wildcard $(PATH_ROOT)/LocalConfig.kmk)
|
---|
332 | ifeq ($(LOCALCFG),)
|
---|
333 | # deprecated name. to be removed.
|
---|
334 | LOCALCFG := $(wildcard $(PATH_ROOT)/Config.kmklocal)
|
---|
335 | ifneq ($(LOCALCFG),)
|
---|
336 | $(warning Please rename your Config.kmklocal to LocalConfig.kmk.)
|
---|
337 | endif
|
---|
338 | endif
|
---|
339 | ifneq ($(LOCALCFG),)
|
---|
340 | include $(LOCALCFG)
|
---|
341 | endif
|
---|
342 |
|
---|
343 |
|
---|
344 | #
|
---|
345 | # Check the build type.
|
---|
346 | #
|
---|
347 | VBOX_BUILD_TYPES ?= release profile debug kprofile #todo: checked
|
---|
348 | ifneq ($(filter-out $(VBOX_BUILD_TYPES),$(BUILD_TYPE)),)
|
---|
349 | $(error Invalid BUILD_TYPE value '$(BUILD_TYPE)'. Choose one these: $(VBOX_BUILD_TYPES))
|
---|
350 | endif
|
---|
351 |
|
---|
352 |
|
---|
353 | #
|
---|
354 | # Disable components that are not open sourced.
|
---|
355 | #
|
---|
356 | ifdef VBOX_OSE
|
---|
357 | VBOX_WITH_VRDP=
|
---|
358 | VBOX_WITH_USB=
|
---|
359 | VBOX_WITH_ISCSI=
|
---|
360 | VBOX_WITH_DEBUGGER_GUI=
|
---|
361 | VBOX_WITH_WIN32_ADDITIONS_SHAREDFOLDERS=
|
---|
362 | VBOX_WITH_OS2_ADDITIONS_BIN=
|
---|
363 | VBOX_WITH_SECURELABEL=
|
---|
364 | VBOX_WITH_KCHMVIEWER=
|
---|
365 | VBOX_WITH_DOCS=
|
---|
366 | VBOX_WITH_TESTSUITE=
|
---|
367 | VBOX_WITH_INTEL_PXE=
|
---|
368 | ifeq ($(BUILD_TARGET),darwin)
|
---|
369 | # Qt/Mac v3.3.x requires patching to work for us.
|
---|
370 | VBOX_WITH_QTGUI=
|
---|
371 | endif
|
---|
372 | ifneq ($(BUILD_TARGET),linux)
|
---|
373 | # Only the Linux installer is public
|
---|
374 | VBOX_WITH_INSTALLER=
|
---|
375 | endif
|
---|
376 | endif
|
---|
377 |
|
---|
378 | #
|
---|
379 | # Disable components for headless
|
---|
380 | #
|
---|
381 | ifdef VBOX_HEADLESS
|
---|
382 | VBOX_WITH_QTGUI=
|
---|
383 | VBOX_WITH_VBOXSDL=
|
---|
384 | VBOX_WITH_VBOXBFE=
|
---|
385 | VBOX_WITH_OGL=
|
---|
386 | VBOX_WITH_KCHMVIEWER=
|
---|
387 | endif
|
---|
388 |
|
---|
389 | #
|
---|
390 | # Undefined VBOX_WITH_MAIN implies exclusion of a few more items.
|
---|
391 | #
|
---|
392 | ifndef VBOX_WITH_MAIN
|
---|
393 | VBOX_WITH_VRDP=
|
---|
394 | VBOX_WITH_VBOXSDL=
|
---|
395 | VBOX_WITH_QTGUI=
|
---|
396 | VBOX_WITH_DEBUGGER_GUI=
|
---|
397 | endif
|
---|
398 |
|
---|
399 | #
|
---|
400 | # Mark OSE builds clearly, helps figuring out limitations more easily.
|
---|
401 | #
|
---|
402 | ifdef VBOX_OSE
|
---|
403 | VBOX_VERSION_STRING = $(VBOX_VERSION_MAJOR).$(VBOX_VERSION_MINOR).$(VBOX_VERSION_BUILD)_OSE
|
---|
404 | endif
|
---|
405 |
|
---|
406 |
|
---|
407 | #
|
---|
408 | # Image and object format config.
|
---|
409 | #
|
---|
410 | ifeq ($(filter-out linux l4 freebsd netbsd openbsd solaris,$(BUILD_TARGET)),)
|
---|
411 | VBOX_LDR_FMT = elf
|
---|
412 | endif
|
---|
413 | ifeq ($(BUILD_TARGET),darwin)
|
---|
414 | VBOX_LDR_FMT = macho
|
---|
415 | endif
|
---|
416 | ifeq ($(BUILD_TARGET),os2)
|
---|
417 | VBOX_LDR_FMT = lx
|
---|
418 | VBOX_LDR_FMT32 = lx
|
---|
419 | VBOX_LDR_FMT64 = elf
|
---|
420 | DONT_USE_YASM = 1 # yasm doesn't implement omf yet.
|
---|
421 | endif
|
---|
422 | ifeq ($(BUILD_TARGET),win)
|
---|
423 | VBOX_LDR_FMT = pe
|
---|
424 | endif
|
---|
425 | VBOX_LDR_FMT32 ?= $(VBOX_LDR_FMT)
|
---|
426 | VBOX_LDR_FMT64 ?= $(VBOX_LDR_FMT)
|
---|
427 |
|
---|
428 | #
|
---|
429 | # Assembler setup.
|
---|
430 | #
|
---|
431 | # This is a bit complicated since we have to support two different assmblers
|
---|
432 | # (yasm/nasm) and possibly two different formats (32-bit/64-bit).
|
---|
433 | #
|
---|
434 | ifeq ($(VBOX_LDR_FMT),elf)
|
---|
435 | ifeq ($(BUILD_TARGET_ARCH),x86)
|
---|
436 | VBOX_ASFLAGS_FMT = -f elf32 -DASM_FORMAT_ELF
|
---|
437 | else
|
---|
438 | VBOX_ASFLAGS_FMT = -f elf64 -DASM_FORMAT_ELF
|
---|
439 | endif
|
---|
440 | VBOX_ASFLAGS_DBFINFO = -g dwarf2
|
---|
441 | endif
|
---|
442 | ifeq ($(VBOX_LDR_FMT),lx)
|
---|
443 | VBOX_ASFLAGS_FMT = -f obj -DASM_FORMAT_OMF
|
---|
444 | VBOX_ASFLAGS_DBFINFO = -g stabs
|
---|
445 | endif
|
---|
446 | ifeq ($(VBOX_LDR_FMT),macho)
|
---|
447 | VBOX_ASFLAGS_FMT = -f macho -DASM_FORMAT_MACHO
|
---|
448 | VBOX_ASFLAGS_DBFINFO = -g dwarf2
|
---|
449 | endif
|
---|
450 | ifeq ($(VBOX_LDR_FMT),pe)
|
---|
451 | ifeq ($(BUILD_TARGET_ARCH),x86)
|
---|
452 | VBOX_ASFLAGS_FMT = -f win32 -DASM_FORMAT_PE
|
---|
453 | else
|
---|
454 | VBOX_ASFLAGS_FMT = -f win64 -DASM_FORMAT_PE
|
---|
455 | endif
|
---|
456 | endif
|
---|
457 | ifndef VBOX_ASFLAGS_FMT
|
---|
458 | $(error VBOX_ASFLAGS_FMT is not defined. VBOX_LDR_FMT=$(VBOX_LDR_FMT))
|
---|
459 | endif
|
---|
460 |
|
---|
461 | ifeq ($(VBOX_LDR_FMT32),elf)
|
---|
462 | VBOX_ASFLAGS_FMT32 = -f elf32 -DASM_FORMAT_ELF
|
---|
463 | VBOX_ASFLAGS_DBFINFO32 = -g dwarf2
|
---|
464 | endif
|
---|
465 | ifeq ($(VBOX_LDR_FMT32),lx)
|
---|
466 | VBOX_ASFLAGS_FMT32 = -f obj -DASM_FORMAT_OMF
|
---|
467 | VBOX_ASFLAGS_DBFINFO32 = -g stabs
|
---|
468 | endif
|
---|
469 | ifeq ($(VBOX_LDR_FMT32),macho)
|
---|
470 | VBOX_ASFLAGS_FMT32 = -f macho -DASM_FORMAT_MACHO
|
---|
471 | VBOX_ASFLAGS_DBFINFO32 = -g dwarf2
|
---|
472 | endif
|
---|
473 | ifeq ($(VBOX_LDR_FMT32),pe)
|
---|
474 | VBOX_ASFLAGS_FMT32 = -f win32 -DASM_FORMAT_PE
|
---|
475 | endif
|
---|
476 | ifndef VBOX_ASFLAGS_FMT32
|
---|
477 | $(error VBOX_ASFLAGS_FMT32 is not defined. VBOX_LDR_FMT32=$(VBOX_LDR_FMT32))
|
---|
478 | endif
|
---|
479 |
|
---|
480 | ifeq ($(VBOX_LDR_FMT64),elf)
|
---|
481 | VBOX_ASFLAGS_FMT64 = -f elf64 -DASM_FORMAT_ELF
|
---|
482 | VBOX_ASFLAGS_DBFINFO64 = -g dwarf2
|
---|
483 | endif
|
---|
484 | ifeq ($(VBOX_LDR_FMT64),macho)
|
---|
485 | VBOX_ASFLAGS_FMT64 = -f macho64 -DASM_FORMAT_MACHO
|
---|
486 | VBOX_ASFLAGS_DBFINFO64 = -g dwarf2
|
---|
487 | endif
|
---|
488 | ifeq ($(VBOX_LDR_FMT64),pe)
|
---|
489 | VBOX_ASFLAGS_FMT64 = -f win64 -DASM_FORMAT_PE
|
---|
490 | endif
|
---|
491 | ifndef VBOX_ASFLAGS_FMT64
|
---|
492 | $(error VBOX_ASFLAGS_FMT64 is not defined. VBOX_LDR_FMT64=$(VBOX_LDR_FMT64))
|
---|
493 | endif
|
---|
494 |
|
---|
495 | ifndef DONT_USE_YASM
|
---|
496 | VBOX_ASTOOL = YASM
|
---|
497 | VBOX_LDR_FMT_2_YASM_DBGINFO.elf = -g dwarf2
|
---|
498 | VBOX_LDR_FMT_2_YASM_DBGINFO.lx = -g stabs
|
---|
499 | VBOX_LDR_FMT_2_YASM_DBGINFO.macho =
|
---|
500 | VBOX_LDR_FMT_2_YASM_DBGINFO.pe =
|
---|
501 | VBOX_ASFLAGS = $(VBOX_ASFLAGS_FMT) -D__YASM__ -Worphan-labels $(VBOX_LDR_FMT_2_YASM_DBGINFO.$(VBOX_LDR_FMT))
|
---|
502 | VBOX_ASFLAGS32 = $(VBOX_ASFLAGS_FMT32) -D__YASM__ -Worphan-labels $(VBOX_LDR_FMT_2_YASM_DBGINFO.$(VBOX_LDR_FMT32))
|
---|
503 | VBOX_ASFLAGS64 = $(VBOX_ASFLAGS_FMT64) -D__YASM__ -Worphan-labels $(VBOX_LDR_FMT_2_YASM_DBGINFO.$(VBOX_LDR_FMT64))
|
---|
504 | else
|
---|
505 | VBOX_ASTOOL = NASM
|
---|
506 | VBOX_ASFLAGS = $(subst elf32,elf,$(VBOX_ASFLAGS_FMT)) -D__NASM__ -w+orphan-labels -g
|
---|
507 | VBOX_ASFLAGS32 = $(subst elf32,elf,$(VBOX_ASFLAGS_FMT32)) -D__NASM__ -w+orphan-labels -g
|
---|
508 | VBOX_ASFLAGS64 = $(VBOX_ASFLAGS_FMT64) -D__NASM__ -w+orphan-labels -g
|
---|
509 | endif
|
---|
510 |
|
---|
511 | #
|
---|
512 | # Windows only has mingw handy. On *nix we have to deal with cross compiling
|
---|
513 | # 32-bit targets on 64-bit platforms, meaning we'll be using gcc32/g++32.
|
---|
514 | # In the latter case we'll also have to disable all the all the R0 driver related stuff.
|
---|
515 | #
|
---|
516 | ifndef VBOX_GCC_TOOL
|
---|
517 | ifeq ($(BUILD_TARGET),win)
|
---|
518 | VBOX_GCC_TOOL := MINGW32
|
---|
519 | TOOL_MINGW32_CFLAGS := $(UNDEFINED) # override -g
|
---|
520 | else ifeq ($(BUILD_TARGET),os2)
|
---|
521 | VBOX_GCC_TOOL := GXX3OMF
|
---|
522 | else ifeq ($(BUILD_TARGET),darwin)
|
---|
523 | VBOX_GCC_TOOL := GXX4MACHO
|
---|
524 | else ifeq ($(BUILD_TARGET),solaris)
|
---|
525 | VBOX_GCC_TOOL := GXX3PLAIN
|
---|
526 | VBOX_GCC32_TOOL := GXX3PLAIN
|
---|
527 | else
|
---|
528 | VBOX_GCC_TOOL := GXX3
|
---|
529 | ifeq ($(BUILD_TARGET_ARCH).$(BUILD_PLATFORM_ARCH),x86.amd64)
|
---|
530 | VBOX_GCC_TOOL := GXX32
|
---|
531 | VBOX_WITH_VBOXDRV=
|
---|
532 | VBOX_WITH_LINUX_ADDITIONS=
|
---|
533 | VBOX_WITH_WIN32_ADDITIONS=
|
---|
534 | else ifeq ($(BUILD_TARGET_ARCH).$(BUILD_PLATFORM_ARCH),amd64.x86)
|
---|
535 | VBOX_GCC_TOOL := GXX64
|
---|
536 | VBOX_WITH_VBOXDRV=
|
---|
537 | VBOX_WITH_LINUX_ADDITIONS=
|
---|
538 | VBOX_WITH_WIN32_ADDITIONS=
|
---|
539 | endif
|
---|
540 | endif
|
---|
541 | endif
|
---|
542 | ifndef VBOX_GCC32_TOOL
|
---|
543 | ifeq ($(BUILD_TARGET_ARCH),x86)
|
---|
544 | VBOX_GCC32_TOOL := $(VBOX_GCC_TOOL)
|
---|
545 | else ifeq ($(BUILD_TARGET),win)
|
---|
546 | VBOX_GCC32_TOOL := MINGW32
|
---|
547 | else
|
---|
548 | VBOX_GCC32_TOOL := GXX32
|
---|
549 | endif
|
---|
550 | endif
|
---|
551 |
|
---|
552 | #
|
---|
553 | # Decide which Visual C++ compiler version we're using by default.
|
---|
554 | #
|
---|
555 | ifndef VBOX_VCC_TOOL
|
---|
556 | ifeq ($(BUILD_TARGET).$(BUILD_TARGET_ARCH),win.amd64)
|
---|
557 | VBOX_USE_VCC80 ?= 1 # Enforce VCC80 when targetting AMD64.
|
---|
558 | endif
|
---|
559 | ifdef VBOX_USE_VCC80
|
---|
560 | ifeq ($(BUILD_TARGET_ARCH),x86)
|
---|
561 | VBOX_VCC_TOOL := VCC80X86
|
---|
562 | else
|
---|
563 | VBOX_VCC_TOOL := VCC80AMD64
|
---|
564 | endif
|
---|
565 | else
|
---|
566 | VBOX_VCC_TOOL := VCC70
|
---|
567 | endif
|
---|
568 | endif
|
---|
569 |
|
---|
570 | #
|
---|
571 | # The kBuild tools and SDKs are using PATH_DEVTOOLS, PATH_DEVTOOLS_BLD
|
---|
572 | # and PATH_DEVTOOLS_TRG to find things if we give them specific locations.
|
---|
573 | #
|
---|
574 | PATH_DEVTOOLS ?= $(PATH_ROOT)/tools
|
---|
575 | PATH_DEVTOOLS := $(abspath $(PATH_DEVTOOLS))
|
---|
576 | PATH_DEVTOOLS_BLD ?= $(PATH_DEVTOOLS)/$(BUILD_PLATFORM).$(BUILD_PLATFORM_ARCH)
|
---|
577 | PATH_DEVTOOLS_TRG ?= $(PATH_DEVTOOLS)/$(BUILD_TARGET).$(BUILD_TARGET_ARCH)
|
---|
578 |
|
---|
579 | ## @todo Remove the default tool crap here!
|
---|
580 | TOOL = $(VBOX_GCC_TOOL)
|
---|
581 | ifdef VBOX_USE_VCC80
|
---|
582 | TOOL.win.x86 = VCC80X86
|
---|
583 | TOOL.win.amd64 = VCC80AMD64
|
---|
584 | else
|
---|
585 | TOOL.win = VCC70
|
---|
586 | endif
|
---|
587 | ASTOOL = $(VBOX_ASTOOL)
|
---|
588 |
|
---|
589 | #
|
---|
590 | # L4-specific settings.
|
---|
591 | #
|
---|
592 | ifdef L4_DIR
|
---|
593 | ifeq ($(BUILD_TARGET),l4)
|
---|
594 | L4_API ?= l4v2
|
---|
595 | L4_ARCH ?= $(BUILD_TARGET_ARCH)
|
---|
596 | ifeq ($(L4_ARCH),x86)
|
---|
597 | L4_CPU ?= 586
|
---|
598 | L4LINUX26_INCDIR := $(L4LINUX26_DIR)/include \
|
---|
599 | $(L4LINUX26_DIR)/include/asm-l4/i386-arch
|
---|
600 | else ifeq ($(L4_ARCH),amd64)
|
---|
601 | L4_CPU ?= k8
|
---|
602 | L4LINUX26_INCDIR := $(L4LINUX26_DIR)/include
|
---|
603 | # no red zone for L4 because of IPC bindings
|
---|
604 | CFLAGS.l4 = -mno-red-zone
|
---|
605 | CXXFLAGS.l4 = -mno-red-zone
|
---|
606 | else
|
---|
607 | $(error L4_ARCH=$(L4_ARCH))
|
---|
608 | endif
|
---|
609 | L4_OBJ := $(L4_DIR)/build-$(L4_ARCH)-$(L4_CPU)-$(L4_API)
|
---|
610 | # support splitted Linux kernels (make O=<build directory>)
|
---|
611 | kernelsrc := $(shell $(SED_EXT) -ne 's+^KERNELSRC.*= *\(.*\)+\1+p' $(L4LINUX26_DIR)/Makefile)
|
---|
612 | ifneq ($(kernelsrc),)
|
---|
613 | kernelpath := $(realpath $(kernelsrc))
|
---|
614 | L4LINUX26_INCDIR += $(L4LINUX26_DIR)/include2 $(kernelpath)/include
|
---|
615 | endif
|
---|
616 | L4_INCDIR := \
|
---|
617 | $(L4_OBJ)/include/uclibc++ \
|
---|
618 | $(L4_OBJ)/include/$(L4_ARCH)/uclibc \
|
---|
619 | $(L4_OBJ)/include/uclibc \
|
---|
620 | $(L4LINUX26_INCDIR) \
|
---|
621 | $(L4_OBJ)/include/$(L4_ARCH)/$(L4_API) \
|
---|
622 | $(L4_OBJ)/include/$(L4_API) \
|
---|
623 | $(L4_OBJ)/include/$(L4_ARCH) \
|
---|
624 | $(L4_OBJ)/include \
|
---|
625 | $(L4_DIR)/tool/dice/include
|
---|
626 | L4_LIBDIR := \
|
---|
627 | $(L4_DIR)/build-$(L4_ARCH)-$(L4_CPU)-$(L4_API)/lib/$(L4_ARCH)_$(L4_CPU)/$(L4_API)
|
---|
628 | endif # BUILD_TARGET == l4
|
---|
629 | endif # L4_DIR
|
---|
630 |
|
---|
631 | # Produce debugging information that the Fiasco kernel debugger can read.
|
---|
632 | ifeq ($(BUILD_TARGET).$(BUILD_TYPE),l4.debug)
|
---|
633 | DEBUG_L4 = -gstabs+
|
---|
634 | endif
|
---|
635 |
|
---|
636 | #
|
---|
637 | # Setup the global defines and includes.
|
---|
638 | #
|
---|
639 | # Note! The __SOMETHING__ #defines are deprecated as they violate the C/C++ specs.
|
---|
640 | #
|
---|
641 | INCS += $(PATH_ROOT)/include $(PATH_OUT)
|
---|
642 | DEFS += VBOX
|
---|
643 | DEFS.debug := DEBUG DEBUG_$(subst $(subst _, ,_),_,$(USERNAME)) DEBUG_USERNAME=$(subst $(subst _, ,_),_,$(USERNAME))
|
---|
644 | DEFS.profile = VBOX_WITH_STATISTICS
|
---|
645 | DEFS.x86 = RT_ARCH_X86 __X86__
|
---|
646 | DEFS.amd64 = RT_ARCH_AMD64 __AMD64__
|
---|
647 | DEFS.darwin = RT_OS_DARWIN __DARWIN__
|
---|
648 | DEFS.darwin.x86 = VBOX_WITH_HYBIRD_32BIT_KERNEL
|
---|
649 | DEFS.freebsd = RT_OS_FREEBSD __FREEBSD__
|
---|
650 | DEFS.l4 = RT_OS_L4 __L4__ __L4ENV__ L4API_l4v2 ARCH_$(BUILD_TARGET_ARCH) __NO_CTYPE _FILE_OFFSET_BITS=64
|
---|
651 | ifeq ($(L4_API),l4v2onv4)
|
---|
652 | DEFS.l4 += L4API_l4v2onv4 STATIC_L4_INLINE
|
---|
653 | endif
|
---|
654 | DEFS.linux = RT_OS_LINUX __LINUX__ _FILE_OFFSET_BITS=64
|
---|
655 | DEFS.netbsd = RT_OS_NETBSD
|
---|
656 | DEFS.openbsd = RT_OS_OPENBSD
|
---|
657 | DEFS.os2 = RT_OS_OS2 __OS2__
|
---|
658 | DEFS.solaris = RT_OS_SOLARIS _FILE_OFFSET_BITS=64
|
---|
659 | DEFS.win = RT_OS_WINDOWS __WIN__
|
---|
660 | DEFS.win.x86 = __WIN32__
|
---|
661 | DEFS.win.amd64 = __WIN64__
|
---|
662 | # optional defines (use environment or make commandline)
|
---|
663 | ifdef VBOX_WITH_DEBUGGER
|
---|
664 | DEFS += VBOX_WITH_DEBUGGER
|
---|
665 | endif
|
---|
666 | ifdef VBOX_WITH_DEBUGGER_GUI
|
---|
667 | DEFS += VBOX_WITH_DEBUGGER_GUI
|
---|
668 | endif
|
---|
669 | ifdef VBOX_WITH_STATISTICS
|
---|
670 | DEFS += VBOX_WITH_STATISTICS
|
---|
671 | endif
|
---|
672 | ifdef VBOX_STRICT
|
---|
673 | DEFS += VBOX_STRICT
|
---|
674 | endif
|
---|
675 | ifdef LOG_ENABLED
|
---|
676 | DEFS += LOG_ENABLED
|
---|
677 | endif
|
---|
678 | ifdef VBOX_OSE
|
---|
679 | DEFS += VBOX_OSE
|
---|
680 | endif
|
---|
681 |
|
---|
682 | #
|
---|
683 | # Compiler optimization flags.
|
---|
684 | #
|
---|
685 | ifeq ($(BUILD_TYPE),debug)
|
---|
686 | VBOX_GCC_FP ?= -fno-omit-frame-pointer
|
---|
687 | VBOX_GCC_OPT ?= -O0
|
---|
688 | VBOX_VCC_FP ?= -Oy-
|
---|
689 | VBOX_VCC_OPT ?=
|
---|
690 | VBOX_GCC_GC_FP ?= -fno-omit-frame-pointer
|
---|
691 | VBOX_GCC_GC_OPT ?= -O0
|
---|
692 | VBOX_VCC_GC_FP ?= -Oy-
|
---|
693 | VBOX_VCC_GC_OPT ?=
|
---|
694 | else
|
---|
695 | # We should use -fomit-frame-pointer for GCC / -Oy for VCC.
|
---|
696 | # -funwind-tables provides support for backtraces in gdb then.
|
---|
697 | VBOX_GCC_FP ?= -fno-omit-frame-pointer
|
---|
698 | VBOX_GCC_OPT ?= -O2 $(VBOX_GCC_mtune-generic)
|
---|
699 | VBOX_VCC_FP ?= -Oy-
|
---|
700 | ifdef VBOX_USE_VCC80
|
---|
701 | VBOX_VCC_OPT ?= -O2 -GS-
|
---|
702 | else
|
---|
703 | VBOX_VCC_OPT ?= -Ogitb2
|
---|
704 | endif
|
---|
705 | VBOX_GCC_GC_FP ?= -fno-omit-frame-pointer
|
---|
706 | VBOX_GCC_GC_OPT ?= -O2 $(VBOX_GCC_mtune-generic)
|
---|
707 | VBOX_VCC_GC_FP ?= -Oy-
|
---|
708 | ifdef VBOX_USE_VCC80
|
---|
709 | VBOX_VCC_GC_OPT ?= -O2
|
---|
710 | else
|
---|
711 | VBOX_VCC_GC_OPT ?= -Ogitb2
|
---|
712 | endif
|
---|
713 | endif
|
---|
714 |
|
---|
715 | #
|
---|
716 | # ARCH_BITS_DEFS.
|
---|
717 | #
|
---|
718 | ifeq ($(BUILD_TARGET_ARCH),amd64)
|
---|
719 | ARCH_BITS_DEFS := HC_ARCH_BITS=64 GC_ARCH_BITS=32
|
---|
720 | else ifeq ($(BUILD_TARGET_ARCH),x86)
|
---|
721 | ARCH_BITS_DEFS := HC_ARCH_BITS=32 GC_ARCH_BITS=32
|
---|
722 | else
|
---|
723 | error BUILD_TARGET_ARCH=$(BUILD_TARGET_ARCH)
|
---|
724 | endif
|
---|
725 |
|
---|
726 | #
|
---|
727 | # Add the output dir(s) to the dynamic loader search path.
|
---|
728 | #
|
---|
729 | ifeq ($(filter-out linux l4 freebsd netbsd openbsd solaris,$(BUILD_TARGET)),)
|
---|
730 | export LD_LIBRARY_PATH:=$(PATH_BIN):$(PATH_LIB):$(LD_LIBRARY_PATH)
|
---|
731 | endif
|
---|
732 | ifeq ($(BUILD_TARGET),os2)
|
---|
733 | #fixme! export BEGINLIBPATH:=$(PATH_BIN);$(PATH_LIB);$(BEGINLIBPATH)
|
---|
734 | endif
|
---|
735 | ifeq ($(BUILD_TARGET),win)
|
---|
736 | export PATH:=$(PATH_BIN);$(PATH_LIB);$(PATH)
|
---|
737 | endif
|
---|
738 |
|
---|
739 | #
|
---|
740 | # Common libraries and tools.
|
---|
741 | #
|
---|
742 | ifeq ($(BUILD_TARGET),darwin)
|
---|
743 | LIB_RUNTIME = $(PATH_BIN)/VBoxRT.dylib
|
---|
744 | LIB_RUNTIME_EF = #$(PATH_LIB)/RuntimeEFCPP.a
|
---|
745 | LIB_KPROFILE = $(PATH_BIN)/kPrf2.dylib
|
---|
746 | LIB_VMM = $(PATH_BIN)/VBoxVMM.dylib
|
---|
747 | LIB_VMMGC = $(PATH_BIN)/VMMGC.gc
|
---|
748 | LIB_REM = $(PATH_LIB)/VBoxREMImp.dylib
|
---|
749 | LIB_XPCOM = $(PATH_BIN)/VBoxXPCOM.dylib
|
---|
750 | endif
|
---|
751 | ifeq ($(BUILD_TARGET),l4)
|
---|
752 | LIB_RUNTIME = $(PATH_BIN)/VBoxRT.s.so
|
---|
753 | LIB_RUNTIME_EF = #$(PATH_LIB)/RuntimeEFCPP.a
|
---|
754 | LIB_KPROFILE = $(PATH_BIN)/kPrf2.s.so
|
---|
755 | LIB_VMM = $(PATH_BIN)/VBoxVMM.s.so
|
---|
756 | LIB_VMMGC = $(PATH_BIN)/VMMGC.gc
|
---|
757 | LIB_REM = $(PATH_BIN)/VBoxREMImp.s.so
|
---|
758 | LIB_XPCOM = $(PATH_BIN)/VBoxXPCOM.s.so
|
---|
759 | endif
|
---|
760 | ifeq ($(filter-out linux freebsd netbsd openbsd solaris,$(BUILD_TARGET)),)
|
---|
761 | LIB_RUNTIME = $(PATH_BIN)/VBoxRT.so
|
---|
762 | LIB_RUNTIME_EF = $(PATH_LIB)/RuntimeEFCPP.a
|
---|
763 | LIB_KPROFILE = $(PATH_BIN)/kPrf2.so
|
---|
764 | LIB_VMM = $(PATH_BIN)/VBoxVMM.so
|
---|
765 | LIB_VMMGC = $(PATH_BIN)/VMMGC.gc
|
---|
766 | LIB_REM = $(PATH_BIN)/VBoxREMImp.so
|
---|
767 | LIB_XPCOM = $(PATH_BIN)/VBoxXPCOM.so
|
---|
768 | endif
|
---|
769 | ifeq ($(BUILD_TARGET),os2)
|
---|
770 | LIB_RUNTIME = $(PATH_BIN)/VBoxRT.dll
|
---|
771 | LIB_RUNTIME_EF = #$(PATH_LIB)/RuntimeEFCPP.a
|
---|
772 | LIB_KPROFILE = $(PATH_BIN)/kPrf2.dll
|
---|
773 | LIB_VMM = $(PATH_BIN)/VBoxVMM.dll
|
---|
774 | LIB_VMMGC = $(PATH_LIB)/VMMGCImp.lib
|
---|
775 | LIB_REM = $(PATH_LIB)/VBoxREMImp.lib
|
---|
776 | LIB_XPCOM = $(PATH_BIN)/VBoxXCOM.dll
|
---|
777 | OBJ_SYS0 = $(PATH_OBJ)/src/VBox/Runtime/RuntimeR0/os2/sys0.obj
|
---|
778 | endif
|
---|
779 | ifeq ($(BUILD_TARGET),win)
|
---|
780 | LIB_RUNTIME = $(PATH_LIB)/VBoxRT.lib
|
---|
781 | LIB_RUNTIME_EF = #$(PATH_LIB)/RuntimeEFCPP.lib
|
---|
782 | LIB_KPROFILE = $(PATH_LIB)/kPrf2.lib
|
---|
783 | LIB_VMM = $(PATH_LIB)/VBoxVMM.lib
|
---|
784 | LIB_VMMGC = $(PATH_OUT)/obj/src/VBox/VMM/VMMGC/VMMGC.lib
|
---|
785 | LIB_REM = $(PATH_LIB)/VBoxREMImp.lib
|
---|
786 | LIB_XPCOM = $(PATH_BIN)/VBoxXPCOM.dll
|
---|
787 | endif
|
---|
788 |
|
---|
789 | # The kprofile build automagically links with kProfile.
|
---|
790 | ifeq ($(BUILD_TYPE),kprofile)
|
---|
791 | LIB_RUNTIME += $(LIB_KPROFILE)
|
---|
792 | endif
|
---|
793 |
|
---|
794 | ## Enable C++ electric fence heap. (Warning: will easily run out of virtual memory / kernel stuff on Linux/Windows.)
|
---|
795 | #LIB_RUNTIME += $(LIB_RUNTIME_EF) $(LIB_RUNTIME)
|
---|
796 |
|
---|
797 | # Overridable libraries (unix).
|
---|
798 | LIB_PTHREAD ?= pthread
|
---|
799 |
|
---|
800 | # Xcursor (consider an SDK for this).
|
---|
801 | # (LIB_XCURSOR is legacy, remove in a month or two.)
|
---|
802 | ifndef VBOX_XCURSOR_LIBS
|
---|
803 | VBOX_XCURSOR_LIBS := $(LIB_XCURSOR)
|
---|
804 | endif
|
---|
805 | ifeq ($(VBOX_XCURSOR_LIBS),)
|
---|
806 | ifeq ($(BUILD_TARGET),solaris)
|
---|
807 | VBOX_XCURSOR_LIBS := $(lastword $(wildcard $(PATH_DEVTOOLS_TRG)/libXcursor/*/lib/libXcursor.a))
|
---|
808 | ifneq ($(VBOX_XCURSOR_LIBS),)
|
---|
809 | VBOX_XCURSOR_INCS := $(patsubst %/lib/libXcursor.a,%/include, $(VBOX_XCURSOR_LIBS))
|
---|
810 | VBOX_XCURSOR_LIBS += X11 Xrender Xfixes
|
---|
811 | endif
|
---|
812 | endif
|
---|
813 | ifeq ($(VBOX_XCURSOR_LIBS),)
|
---|
814 | VBOX_XCURSOR_LIBS := Xcursor
|
---|
815 | endif
|
---|
816 | endif
|
---|
817 |
|
---|
818 |
|
---|
819 | # Intel ASL compiler for ACPI
|
---|
820 | VBOX_IASLCMD ?= $(firstword $(wildcard $(PATH_DEVTOOLS_BLD)/bin/iasl$(HOSTSUFF_EXE)) iasl$(HOSTSUFF_EXE))
|
---|
821 |
|
---|
822 | # Bruce's C compile is a C-compiler for BIOS-related 8086 code
|
---|
823 | VBOX_BCC ?= $(PATH_DEVTOOLS_BLD)/bin/bcc$(HOSTSUFF_EXE) -B $(PATH_DEVTOOLS_BLD)/bin/
|
---|
824 |
|
---|
825 | # Assembler for BIOS-related 8086 code
|
---|
826 | VBOX_AS86 ?= $(PATH_DEVTOOLS_BLD)/bin/as86$(HOSTSUFF_EXE)
|
---|
827 |
|
---|
828 | # libxslt XSLT processor. (see PATH_TOOL_YASM for explanation why it's temporarily located in bin.)
|
---|
829 | ifeq ($(BUILD_PLATFORM),win)
|
---|
830 | # VBOX_XSLTPROC ?= $(PATH_DEVTOOLS)/win.x86/libxslt/10114/xsltproc.exe
|
---|
831 | VBOX_XSLTPROC ?= $(PATH_DEVTOOLS)/win.x86/bin/xsltproc.exe
|
---|
832 | else ifeq ($(BUILD_PLATFORM),os2)
|
---|
833 | VBOX_XSLTPROC ?= BEGINLIBPATH="$(PATH_DEVTOOLS_BLD)/bin;$$BEGINLIBPATH" $(PATH_DEVTOOLS_BLD)/bin/xsltproc.exe
|
---|
834 | else
|
---|
835 | VBOX_XSLTPROC ?= xsltproc$(HOSTSUFF_EXE)
|
---|
836 | endif
|
---|
837 |
|
---|
838 | # bin2c (convert binary files into C arrays)
|
---|
839 | VBOX_BIN2C ?= $(PATH_OBJ)/src/bldprogs/bin2c/bin2c$(HOSTSUFF_EXE)
|
---|
840 |
|
---|
841 | # mkisofs
|
---|
842 | ifeq ($(BUILD_PLATFORM),win)
|
---|
843 | VBOX_MKISOFS ?= $(PATH_DEVTOOLS_BLD)/bin/mkisofs.exe
|
---|
844 | else
|
---|
845 | VBOX_MKISOFS ?= mkisofs
|
---|
846 | endif
|
---|
847 |
|
---|
848 | # Makeself for the linux installers.
|
---|
849 | VBOX_MAKESELF ?= $(PATH_DEVTOOLS)/common/makeself/v2.1.4_1/makeself.sh
|
---|
850 |
|
---|
851 | # Microsoft HTML Help Workshop.
|
---|
852 | VBOX_PATH_HTML_HELP_WORKSHOP ?= $(PATH_DEVTOOLS)/win.x86/HTML_Help_Workshop/v1.3/
|
---|
853 |
|
---|
854 | # Path to the null soft installer.
|
---|
855 | VBOX_PATH_NSIS ?= $(PATH_DEVTOOLS)/win.x86/nsis/v2.22
|
---|
856 |
|
---|
857 | # Windows install tools...
|
---|
858 | VBOX_PATH_WIX ?= $(PATH_DEVTOOLS)/win.x86/wix/v2.0.4611.0
|
---|
859 | VBOX_PATH_DIFX ?= $(PATH_DEVTOOLS)/win.$(BUILD_TARGET_ARCH)/DIFx/v2.1
|
---|
860 |
|
---|
861 | # We need to export YASM for OSE, but since it was converted to .zip we need to
|
---|
862 | # allow for the location used by the zip to be properly cleaned up first.
|
---|
863 | ifeq ($(filter-out win.x86 linux.x86 solaris.x86, $(BUILD_PLATFORM).$(BUILD_PLATFORM_ARCH)),)
|
---|
864 | PATH_TOOL_YASM ?= $(PATH_DEVTOOLS_BLD)/bin
|
---|
865 | endif
|
---|
866 |
|
---|
867 | # XPCOM setup for all but win32.
|
---|
868 | ifneq ($(BUILD_TARGET),win)
|
---|
869 | VBOX_WITH_XPCOM = 1
|
---|
870 | VBOX_XPIDL ?= $(VBOX_PATH_SDK)/bin/xpidl$(HOSTSUFF_EXE)
|
---|
871 | VBOX_PATH_XPCOM_IDL ?= $(VBOX_PATH_SDK)/idl
|
---|
872 | VBOX_XPCOM_INCS ?= \
|
---|
873 | $(VBOX_PATH_SDK)/include \
|
---|
874 | $(VBOX_PATH_SDK)/include/xpcom \
|
---|
875 | $(VBOX_PATH_SDK)/include/xpcom/nsprpub \
|
---|
876 | $(VBOX_PATH_SDK)/include/xpcom/string \
|
---|
877 | $(VBOX_PATH_SDK)/include/xpcom/xpcom \
|
---|
878 | $(VBOX_PATH_SDK)/include/xpcom/ipcd
|
---|
879 | ifneq ($(BUILD_TARGET),os2)
|
---|
880 | # libIDL-config (for xpcom18a4)
|
---|
881 | ifeq ($(origin VBOX_LIBIDL_CONFIG),undefined)
|
---|
882 | export VBOX_LIBIDL_CONFIG := $(firstword $(shell which libIDL-config-2 libIDL-config 2> /dev/null))
|
---|
883 | endif
|
---|
884 | endif
|
---|
885 | endif
|
---|
886 |
|
---|
887 | ifeq ($(BUILD_TARGET),os2)
|
---|
888 | # search DLLs in the EXE directory first
|
---|
889 | VBOX_XPIDL := BEGINLIBPATH="$(dir $(VBOX_XPIDL));$$BEGINLIBPATH" $(VBOX_XPIDL)
|
---|
890 | endif
|
---|
891 | #$(error $(VBOX_XPIDL))
|
---|
892 |
|
---|
893 | # The X11 LIBPATH. (The amd64 hack is for RHEL4.)
|
---|
894 | ifeq ($(BUILD_TARGET_ARCH),amd64)
|
---|
895 | VBOX_LIBPATH_X11 ?= /usr/X11R6/lib64 /usr/X11R6/lib
|
---|
896 | else
|
---|
897 | VBOX_LIBPATH_X11 ?= /usr/X11R6/lib
|
---|
898 | endif
|
---|
899 |
|
---|
900 | # 32bit X11 LIBPATH for building 32bit guest additions
|
---|
901 | VBOX_LIBPATH32_X11 ?= /usr/X11R6/lib32 /usr/X11R6/lib
|
---|
902 |
|
---|
903 | #
|
---|
904 | # Mac OS X SDK paths.
|
---|
905 | #
|
---|
906 | VBOX_PATH_MACOSX_SDK ?= /Developer/SDKs/MacOSX10.4u.sdk
|
---|
907 | VBOX_PATH_MACOSX_SDK_INCS ?= $(VBOX_PATH_MACOSX_SDK)/Developer/Headers
|
---|
908 |
|
---|
909 |
|
---|
910 | #
|
---|
911 | # GCC stuff properties.
|
---|
912 | # Most of this is resolved on first kmk invocation and cached in PATH_OUT.
|
---|
913 | #
|
---|
914 | # Note! That a harmless warning is printed if the file doesn't exist.
|
---|
915 | # Note! Changes in GCC are not detected automatically (yet).
|
---|
916 | #
|
---|
917 | include $(PATH_KBUILD)/tools/$(VBOX_GCC_TOOL).kmk
|
---|
918 | ifneq ($(VBOX_GCC_TOOL),$(VBOX_GCC32_TOOL))
|
---|
919 | include $(PATH_KBUILD)/tools/$(VBOX_GCC32_TOOL).kmk
|
---|
920 | endif
|
---|
921 |
|
---|
922 | VBOX_GCC_CHECK_CC = $(shell \
|
---|
923 | if $(TOOL_$(VBOX_GCC_TOOL)_CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; \
|
---|
924 | then echo "$(1)"; \
|
---|
925 | else echo "$(2)"; fi; )
|
---|
926 |
|
---|
927 | VBOX_GCC_CHECK_CXX = $(shell \
|
---|
928 | if $(TOOL_$(VBOX_GCC_TOOL)_CXX) $(1) -S -o /dev/null -xc++ /dev/null > /dev/null 2>&1; \
|
---|
929 | then echo "$(1)"; \
|
---|
930 | else echo "$(2)"; fi; )
|
---|
931 |
|
---|
932 | VBOX_GCC32_CHECK_CXX = $(shell \
|
---|
933 | if $(TOOL_$(VBOX_GCC32_TOOL)_CXX) $(1) -S -o /dev/null -xc++ /dev/null > /dev/null 2>&1; \
|
---|
934 | then echo "$(1)"; \
|
---|
935 | else echo "$(2)"; fi; )
|
---|
936 |
|
---|
937 | # This is kind of bad, the returned string needs to be re-evaluated before use.
|
---|
938 | # The reason for this hack is that the windows kmk_ash cannot deal with $((1+1)).
|
---|
939 | VBOX_GCC_VERSION = $(shell \
|
---|
940 | $(1) -dumpversion | $(SED_EXT) 's|\([0-9]\)\.\([0-9]\)\.\([0-9]\)|$$(int-add $$(int-mul 10000, \1), $$(int-mul 100, \2), \3)|' )
|
---|
941 |
|
---|
942 | # No $(QUIET) here as it's interesting to see what goes into the file.
|
---|
943 | $(PATH_OUT)/GCCConfig.kmk: $(PATH_ROOT)/Config.kmk $(LOCALCFG) $(AUTOCFG)
|
---|
944 | $(call MSG_GENERATE,,$@,)
|
---|
945 | $(QUIET)$(RM) -f "$@"
|
---|
946 | $(QUIET)$(MKDIR) -p $(@D)
|
---|
947 |
|
---|
948 | @# HC compiler switch detection.
|
---|
949 | $(APPEND) "$@" "VBOX_GCC_VERSION_CC ?= $(call VBOX_GCC_VERSION,$(TOOL_$(VBOX_GCC_TOOL)_CC))"
|
---|
950 | $(APPEND) "$@" "VBOX_GCC_VERSION_CXX ?= $(call VBOX_GCC_VERSION,$(TOOL_$(VBOX_GCC_TOOL)_CXX))"
|
---|
951 | $(APPEND) "$@" "VBOX_GCC_LIBGCC ?= $(shell $(TOOL_$(VBOX_GCC_TOOL)_CC) -print-libgcc-file-name)"
|
---|
952 | $(APPEND) "$@" "VBOX_GCC_Wno-pointer-sign ?= $(call VBOX_GCC_CHECK_CC,-Wno-pointer-sign,)"
|
---|
953 | $(APPEND) "$@" "VBOX_GCC_Wno-variadic-macros ?= $(call VBOX_GCC_CHECK_CXX,-Wno-variadic-macros,)"
|
---|
954 | $(APPEND) "$@" "VBOX_GCC_Wno-invalid-offsetof ?= $(call VBOX_GCC_CHECK_CXX,-Wno-invalid-offsetof,)"
|
---|
955 | $(APPEND) "$@" "VBOX_GCC_Wno-extra ?= $(call VBOX_GCC_CHECK_CXX,-Wno-extra)"
|
---|
956 | $(APPEND) "$@" "VBOX_GCC_fno-stack-protector ?= $(call VBOX_GCC_CHECK_CC,-fno-stack-protector,)"
|
---|
957 | @# Produce code optimized for the most common IA32/AMD64/EM64T processors. Introduced with gcc version 4.2.
|
---|
958 | $(APPEND) "$@" "VBOX_GCC_mtune-generic ?= $(call VBOX_GCC_CHECK_CC,-mtune=generic,)"
|
---|
959 | ifneq ($(BUILD_TARGET),l4)
|
---|
960 | @# Set default attribute for ELF and MACH-O symbols to ``hidden'' to reduce the number
|
---|
961 | @# of relocation entries and PLT indirections in shared libraries. Don't allow for gcc version < 4.
|
---|
962 | $(APPEND) "$@" "ifneq ($$(VBOX_GCC_VERSION_CC),)"
|
---|
963 | $(APPEND) "$@" " ifneq ($$(int-ge $$(VBOX_GCC_VERSION_CC),40000),)"
|
---|
964 | $(APPEND) "$@" " VBOX_GCC_fvisibility-hidden ?= $(call VBOX_GCC_CHECK_CC,-fvisibility=hidden -DVBOX_HAVE_VISIBILITY_HIDDEN,)"
|
---|
965 | $(APPEND) "$@" " endif"
|
---|
966 | $(APPEND) "$@" "endif"
|
---|
967 | endif
|
---|
968 | ifneq ($(BUILD_TARGET),l4)
|
---|
969 | @# Set default attribute for inline functions to ``hidden'' to reduce the number
|
---|
970 | @# of relocation entries and PLT indirections in shared libraries. Don't allow for gcc version < 4.
|
---|
971 | $(APPEND) "$@" "ifneq ($$(VBOX_GCC_VERSION_CXX),)"
|
---|
972 | $(APPEND) "$@" " ifneq ($$(int-ge $$(VBOX_GCC_VERSION_CXX),40000),)"
|
---|
973 | $(APPEND) "$@" " VBOX_GCC_fvisibility-inlines-hidden ?= $(call VBOX_GCC_CHECK_CXX,-fvisibility-inlines-hidden,)"
|
---|
974 | $(APPEND) "$@" " endif"
|
---|
975 | $(APPEND) "$@" "endif"
|
---|
976 | endif
|
---|
977 | @# Find the compiler includes for IPRT no-crt.
|
---|
978 | @# Note that `$(dir $(gcc -print-libgcc-file-name))/include does not work for a 64-bit cross build on a 32-bit build host.
|
---|
979 | $(APPEND) "$@" "VBOX_PATH_GCC_INCS ?= $(shell LC_ALL=C $(TOOL_$(VBOX_GCC_TOOL)_CC) -print-search-dirs|$(SED_EXT) -ne 's+^install: \(.*[^/][^/]*\)/+\1+p')/include"
|
---|
980 |
|
---|
981 | @# 32-bit (GC) compiler switch detection.
|
---|
982 | $(APPEND) "$@" "VBOX_GCC32_VERSION_CC ?= $(call VBOX_GCC_VERSION,$(TOOL_$(VBOX_GCC32_TOOL)_CC))"
|
---|
983 | $(APPEND) "$@" "VBOX_GCC32_VERSION_CXX ?= $(call VBOX_GCC_VERSION,$(TOOL_$(VBOX_GCC32_TOOL)_CXX))"
|
---|
984 | $(APPEND) "$@" "VBOX_GCC32_LIBGCC ?= $(shell $(TOOL_$(VBOX_GCC32_TOOL)_CC) -print-libgcc-file-name)"
|
---|
985 | $(APPEND) "$@" "VBOX_GCC32_Wno-variadic-macros ?= $(call VBOX_GCC32_CHECK_CXX,-Wno-variadic-macros,)"
|
---|
986 |
|
---|
987 | include $(PATH_OUT)/GCCConfig.kmk
|
---|
988 |
|
---|
989 |
|
---|
990 | #
|
---|
991 | # Coding Signing.
|
---|
992 | #
|
---|
993 | ifdef VBOX_SIGNING_MODE
|
---|
994 | ifeq ($(BUILD_PLATFORM),win)
|
---|
995 | # VBOX_PATH_SELFSIGN points to the Vista WDK bin/SelfSign directory.
|
---|
996 | ifndef VBOX_PATH_SELFSIGN
|
---|
997 | VBOX_PATH_SELFSIGN := $(lastword $(sort $(wildcard $(PATH_DEVTOOLS)/win.x86/selfsign/*)))
|
---|
998 | ifeq ($(VBOX_PATH_SELFSIGN),)
|
---|
999 | VBOX_PATH_SELFSIGN := $(PATH_DEVTOOLS)/win.x86/selfsign/r1
|
---|
1000 | endif
|
---|
1001 | endif
|
---|
1002 | VBOX_SIGNTOOL ?= $(VBOX_PATH_SELFSIGN)/SignTool.exe
|
---|
1003 | VBOX_INF2CAT ?= $(VBOX_PATH_SELFSIGN)/Inf2Cat.exe
|
---|
1004 |
|
---|
1005 | # There are two signing modes; 'self' and 'release'.
|
---|
1006 | ifeq ($(strip $(VBOX_SIGNING_MODE)),self)
|
---|
1007 | ## @todo
|
---|
1008 | else ifeq ($(strip $(VBOX_SIGNING_MODE)),release)
|
---|
1009 | VBOX_CROSS_CERTIFICATE_FILE ?= $(VBOX_PATH_SELFSIGN)/MSCV-GlobalSign.cer
|
---|
1010 | VBOX_CROSS_CERTIFICATE_FILE_ARGS ?= /ac "$(VBOX_CROSS_CERTIFICATE_FILE)"
|
---|
1011 | VBOX_CERTIFICATE_SUBJECT_NAME ?= InnoTek Systemberatung GmbH
|
---|
1012 | VBOX_CERTIFICATE_SUBJECT_NAME_ARGS ?= /n "$(VBOX_CERTIFICATE_SUBJECT_NAME)"
|
---|
1013 | VBOX_CERTIFICATE_STORE ?= my
|
---|
1014 | VBOX_CERTIFICATE_STORE_ARGS ?= /s "$(VBOX_CERTIFICATE_STORE)"
|
---|
1015 | VBOX_TSA_URL ?= http://timestamp.verisign.com/scripts/timestamp.dll
|
---|
1016 | VBOX_TSA_URL_ARGS ?= /t "$(VBOX_TSA_URL)"
|
---|
1017 | ## Commands for signing a driver image after link.
|
---|
1018 | VBOX_SIGN_DRIVER_CMDS ?= $(if $(eq $(tool_do),LINK_LIBRARY),,$(call VBOX_SIGN_FILE_FN,$(out)))
|
---|
1019 | ## Commands for signing an executable or a dll image after link.
|
---|
1020 | VBOX_SIGN_IMAGE_CMDS ?= $(if $(eq $(tool_do),LINK_LIBRARY),,$(call VBOX_SIGN_FILE_FN,$(out)))
|
---|
1021 | ## Sign a file.
|
---|
1022 | # @param 1 The file to sign.
|
---|
1023 | VBOX_SIGN_FILE_FN ?= $(VBOX_SIGNTOOL) sign \
|
---|
1024 | $(VBOX_CROSS_CERTIFICATE_FILE_ARGS) \
|
---|
1025 | $(VBOX_CERTIFICATE_STORE_ARGS) \
|
---|
1026 | $(VBOX_CERTIFICATE_SUBJECT_NAME_ARGS) \
|
---|
1027 | $(VBOX_TSA_URL_ARGS) \
|
---|
1028 | $(1)
|
---|
1029 | ## Create a security catalog file.
|
---|
1030 | # @param 1 The directory containing the stuff to sign.
|
---|
1031 | # @param 2 The expected .cat name. (Inf2Cat lowercases it)
|
---|
1032 | # @param 3 The list of OSes, separated by ';'.
|
---|
1033 | VBOX_MAKE_CAT_HLP_FN ?= \
|
---|
1034 | $(RM) -f $(2)\
|
---|
1035 | $(NL)$(TAB)$(VBOX_INF2CAT) /driver:$(strip $(1)) /os:$(strip $(subst ;,$(COMMA),$(3))) /verbose \
|
---|
1036 | $(NL)$(TAB)$(MV) $(2) $(2) \
|
---|
1037 | $(NL)$(TAB)$(call VBOX_SIGN_FILE_FN,$(2))
|
---|
1038 | VBOX_MAKE_CAT64_FN ?= $(call VBOX_MAKE_CAT_HLP_FN,$(1),$(2),XP_X64;Server2003_X64;Vista_X64)
|
---|
1039 | VBOX_MAKE_CAT32_FN ?= $(call VBOX_MAKE_CAT_HLP_FN,$(1),$(2),2000;XP_X86;Server2003_X86;Vista_X86)
|
---|
1040 | ifeq ($(BUILD_TARGET_ARCH),x86)
|
---|
1041 | VBOX_MAKE_CAT_FN ?= $(call VBOX_MAKE_CAT32_FN,$(1),$(2))
|
---|
1042 | else
|
---|
1043 | VBOX_MAKE_CAT_FN ?= $(call VBOX_MAKE_CAT64_FN,$(1),$(2))
|
---|
1044 | endif
|
---|
1045 |
|
---|
1046 | # Enable signing of the additions.
|
---|
1047 | VBOX_SIGN_ADDITIONS ?= 1
|
---|
1048 |
|
---|
1049 | else
|
---|
1050 | $(error Unknown VBOX_SIGNING_MODE: $(VBOX_SIGNING_MODE))
|
---|
1051 | endif
|
---|
1052 | else
|
---|
1053 | VBOX_SIGNING_MODE :=
|
---|
1054 | endif
|
---|
1055 | endif
|
---|
1056 |
|
---|
1057 | #
|
---|
1058 | # Windows .inf editing.
|
---|
1059 | #
|
---|
1060 | ifeq ($(BUILD_TARGET_ARCH),x86)
|
---|
1061 | VBOX_EDIT_INF_FN = $(call VBOX_EDIT_INF32_FN,$(1),$(2))
|
---|
1062 | else
|
---|
1063 | VBOX_EDIT_INF_FN = $(call VBOX_EDIT_INF64_FN,$(1),$(2))
|
---|
1064 | endif
|
---|
1065 | ## Edit an inf file an x86 target.
|
---|
1066 | # @param 1 The inf file to edit.
|
---|
1067 | # @param 2 The output file.
|
---|
1068 | VBOX_EDIT_INF32_FN = $(SED) $(if $(VBOX_SIGNING_MODE),-e 's/^;cat *//', -e '/^;cat /d') -e 's/^;x86 *//' -e '/^;amd64 /d' $(1) > $(2)
|
---|
1069 | ## Edit an inf file an x86 target.
|
---|
1070 | # @param 1 The inf file to edit.
|
---|
1071 | # @param 2 The output file.
|
---|
1072 | VBOX_EDIT_INF64_FN = $(SED) $(if $(VBOX_SIGNING_MODE),-e 's/^;cat *//', -e '/^;cat /d') -e 's/^;amd64 *//' -e '/^;x86 /d' $(1) > $(2)
|
---|
1073 |
|
---|
1074 | #
|
---|
1075 | # Default prefixes and suffixes.
|
---|
1076 | #
|
---|
1077 | VBOX_PREF_LIB =
|
---|
1078 | ifeq ($(filter-out win os2,$(BUILD_TARGET)),)
|
---|
1079 | VBOX_SUFF_LIB = .lib
|
---|
1080 | else
|
---|
1081 | VBOX_SUFF_LIB = .a
|
---|
1082 | endif
|
---|
1083 | VBOX_SUFF_DLL = $(SUFF_DLL)
|
---|
1084 | ifeq ($(BUILD_TARGET),os2) # GXX3OMF produces out .o at the moment.
|
---|
1085 | VBOX_SUFF_OBJ = .o
|
---|
1086 | else
|
---|
1087 | VBOX_SUFF_OBJ = $(SUFF_OBJ)
|
---|
1088 | endif
|
---|
1089 | VBOXW32GUEST_SUFF_LIB = .lib
|
---|
1090 | VBOXLNX32GUEST_SUFF_LIB = .a
|
---|
1091 |
|
---|
1092 | #
|
---|
1093 | # SDKs for external libraries.
|
---|
1094 | #
|
---|
1095 | SDK_VBOX_XERCES = .
|
---|
1096 | SDK_VBOX_XERCES_INCS ?= $(PATH_ROOT)/src/libs/xerces-2.6.0/src
|
---|
1097 | SDK_VBOX_XERCES_LIBS ?= $(PATH_LIB)/VBox-xerces$(VBOX_SUFF_LIB)
|
---|
1098 |
|
---|
1099 | SDK_VBOX_XALAN = .
|
---|
1100 | SDK_VBOX_XALAN_INCS ?= $(PATH_ROOT)/src/libs/xalan-1.10.0
|
---|
1101 | SDK_VBOX_XALAN_LIBS ?= $(PATH_LIB)/VBox-xalan$(VBOX_SUFF_LIB)
|
---|
1102 |
|
---|
1103 | SDK_VBOX_LIBPNG = .
|
---|
1104 | SDK_VBOX_LIBPNG_INCS ?= $(PATH_ROOT)/src/libs/libpng-1.2.8
|
---|
1105 | SDK_VBOX_LIBPNG_LIBS ?= $(PATH_LIB)/VBox-libpng$(VBOX_SUFF_LIB)
|
---|
1106 |
|
---|
1107 | SDK_VBOX_ZLIB = .
|
---|
1108 | ifeq ($(filter-out win os2,$(BUILD_TARGET)),)
|
---|
1109 | SDK_VBOX_ZLIB_INCS ?= $(PATH_ROOT)/src/libs/zlib-1.2.1
|
---|
1110 | SDK_VBOX_ZLIB_LIBS ?= $(PATH_LIB)/VBox-zlib$(VBOX_SUFF_LIB)
|
---|
1111 | else
|
---|
1112 | SDK_VBOX_ZLIB_INCS ?=
|
---|
1113 | SDK_VBOX_ZLIB_LIBS ?= z
|
---|
1114 | endif
|
---|
1115 |
|
---|
1116 | SDK_VBOX_OPENSSL = .
|
---|
1117 | SDK_VBOX_OPENSSL_INCS?= $(PATH_ROOT)/src/libs/openssl-0.9.7e/include
|
---|
1118 | SDK_VBOX_OPENSSL_LIBS?= $(PATH_LIB)/VBox-libcrypto$(VBOX_SUFF_LIB)
|
---|
1119 |
|
---|
1120 | SDK_VBOX_FFMPEG = .
|
---|
1121 | ifeq ($(filter-out win os2 darwin,$(BUILD_TARGET)),)
|
---|
1122 | SDK_VBOX_FFMPEG_INCS ?= \
|
---|
1123 | $(PATH_ROOT)/src/libs/ffmpeg-20060710/libavutil \
|
---|
1124 | $(PATH_ROOT)/src/libs/ffmpeg-20060710/libavcodec \
|
---|
1125 | $(PATH_ROOT)/src/libs/ffmpeg-20060710/libavformat
|
---|
1126 | ifeq ($(BUILD_TARGET),win)
|
---|
1127 | ## @todo Michael! Where is $(PATH_LIB)/VBoxFFmpegImp$(VBOX_SUFF_LIB) supposed to come from?
|
---|
1128 | #SDK_VBOX_FFMPEG_LIBS ?= $(PATH_LIB)/VBoxFFmpeg.a
|
---|
1129 | SDK_VBOX_FFMPEG_LIBS ?= $(PATH_LIB)/VBoxFFmpegImp.lib
|
---|
1130 | else
|
---|
1131 | SDK_VBOX_FFMPEG_LIBS ?= $(PATH_BIN)/VBoxFFmpeg$(SUFF_DLL)
|
---|
1132 | endif
|
---|
1133 | else
|
---|
1134 | SDK_VBOX_FFMPEG_INCS ?= /usr/include/ffmpeg /usr/include/libpng
|
---|
1135 | SDK_VBOX_FFMPEG_LIBS ?= avutil avcodec avformat
|
---|
1136 | endif
|
---|
1137 |
|
---|
1138 | #
|
---|
1139 | # Special SDK for the problematic NTDLL.LIB.
|
---|
1140 | #
|
---|
1141 | SDK_VBOX_NTDLL = Requires W2K3DDK
|
---|
1142 | SDK_VBOX_NTDLL_LIBS ?= $(PATH_SDK_W2K3DDK_LIB)/ntdll.lib
|
---|
1143 |
|
---|
1144 |
|
---|
1145 | #
|
---|
1146 | # Qt build tools and libraries.
|
---|
1147 | # For *NIX we require it to be present on the system.
|
---|
1148 | #
|
---|
1149 | ## @todo convert this into SDK and integrate the Qt stuff into kBuild.
|
---|
1150 | ifeq ($(BUILD_TARGET),win)
|
---|
1151 | ifeq ($(BUILD_TARGET_ARCH),x86)
|
---|
1152 | VBOX_PATH_QT ?= $(PATH_DEVTOOLS_TRG)/qt/v3.3.3
|
---|
1153 | LIB_QT ?= $(VBOX_PATH_QT)/lib/dynamic/qt-mt333.lib
|
---|
1154 | LIB_QTMAIN ?= $(VBOX_PATH_QT)/lib/dynamic/qtmain.lib
|
---|
1155 | else
|
---|
1156 | VBOX_PATH_QT ?= $(PATH_DEVTOOLS_TRG)/qt/v3.3.8
|
---|
1157 | LIB_QT ?= $(VBOX_PATH_QT)/lib/qt-mt338.lib
|
---|
1158 | LIB_QTMAIN ?= $(VBOX_PATH_QT)/lib/qtmain.lib
|
---|
1159 | endif
|
---|
1160 | ifndef QTDIR
|
---|
1161 | QTDIR := $(sort $(wildcard $(PATH_DEVTOOLS_BLD)/v*))
|
---|
1162 | QTDIR := $(call lastword,$(QTDIR))
|
---|
1163 | endif
|
---|
1164 | else ifeq ($(BUILD_TARGET),os2)
|
---|
1165 | QTDIR ?= $(PATH_DEVTOOLS_TRG)/qt/v3.3.1
|
---|
1166 | VBOX_PATH_QT ?= $(QTDIR)
|
---|
1167 | LIB_QT ?= $(lastword $(sort $(wildcard $(VBOX_PATH_QT)/lib/*qt*.lib)))
|
---|
1168 | QTDIR := $(VBOX_PATH_QT)
|
---|
1169 | else ifeq ($(BUILD_TARGET),darwin)
|
---|
1170 | ifndef VBOX_PATH_QT
|
---|
1171 | VBOX_PATH_QT := $(lastword $(sort $(wildcard $(PATH_DEVTOOLS_TRG)/qt/v3.*)))
|
---|
1172 | VBOX_PATH_QT ?= $(PATH_DEVTOOLS_TRG)/qt/v3.3.8-r1
|
---|
1173 | endif
|
---|
1174 | VBOX_MUST_INSTALL_LIB_QT ?= 1
|
---|
1175 | LIB_QT ?= $(VBOX_PATH_QT)/lib/libqt-mt.3.dylib
|
---|
1176 | LIB_QTMAIN ?= $(NO_SUCH_VARIABLE)
|
---|
1177 | ifndef QTDIR
|
---|
1178 | QTDIR := $(sort $(wildcard $(PATH_DEVTOOLS_BLD)/v*))
|
---|
1179 | QTDIR := $(call lastword,$(QTDIR))
|
---|
1180 | endif
|
---|
1181 | else
|
---|
1182 | ifndef QTDIR
|
---|
1183 | ifndef VBOX_PATH_QT
|
---|
1184 | # If QTDIR and VBOX_WITH_QTGUI aren't defined, we'll first
|
---|
1185 | # look in the tools tree and then on the system. If in the
|
---|
1186 | # tools, we'll have to install it.
|
---|
1187 | # Results are exported to avoid having to do this for every make file.
|
---|
1188 | VBOX_PATH_QT := $(lastword $(sort $(wildcard $(PATH_DEVTOOLS_TRG)/qt/v3.*)))
|
---|
1189 | ifneq ($(VBOX_PATH_QT),)
|
---|
1190 | export VBOX_PATH_QT
|
---|
1191 | export VBOX_MUST_INSTALL_LIB_QT := 1
|
---|
1192 | export LIB_QT := $(VBOX_PATH_QT)/lib/libqt-mt.so.3
|
---|
1193 | export LD_LIBRARY_PATH := $(VBOX_PATH_QT)/lib:$(LD_LIBRARY_PATH)
|
---|
1194 | else
|
---|
1195 | QTDIR := $(wildcard /usr/share/qt3)
|
---|
1196 | ifeq ($(QTDIR),)
|
---|
1197 | QTDIR := $(patsubst %/bin/moc,%,$(firstword $(wildcard /usr/bin/moc /usr/local/bin/moc /usr/X11R6/bin/moc)))
|
---|
1198 | endif
|
---|
1199 | ifneq ($(QTDIR),)
|
---|
1200 | export QTDIR
|
---|
1201 | endif
|
---|
1202 | endif
|
---|
1203 | else
|
---|
1204 | QTDIR := $(VBOX_PATH_QT)
|
---|
1205 | export QTDIR
|
---|
1206 | endif
|
---|
1207 | endif
|
---|
1208 | endif
|
---|
1209 | ifndef VBOX_PATH_QT
|
---|
1210 | VBOX_PATH_QT ?= $(QTDIR)
|
---|
1211 | LIB_QT ?= qt-mt
|
---|
1212 | endif
|
---|
1213 | ifeq ($(BUILD_PLATFORM),$(BUILD_TARGET))
|
---|
1214 | VBOX_PATH_QT_HOST ?= $(VBOX_PATH_QT)
|
---|
1215 | else
|
---|
1216 | VBOX_PATH_QT_HOST ?= $(QTDIR)
|
---|
1217 | endif
|
---|
1218 | VBOX_UIC ?= $(VBOX_PATH_QT_HOST)/bin/uic$(HOSTSUFF_EXE)
|
---|
1219 | VBOX_MOC ?= $(VBOX_PATH_QT_HOST)/bin/moc$(HOSTSUFF_EXE)
|
---|
1220 | VBOX_LUPDATE ?= $(VBOX_PATH_QT_HOST)/bin/lupdate$(HOSTSUFF_EXE)
|
---|
1221 | VBOX_LRELEASE ?= $(VBOX_PATH_QT_HOST)/bin/lrelease$(HOSTSUFF_EXE)
|
---|
1222 |
|
---|
1223 | ifeq ($(BUILD_TARGET),os2)
|
---|
1224 | # search DLLs in the EXE directory first
|
---|
1225 | VBOX_UIC := BEGINLIBPATH="$(dir $(VBOX_UIC));$$BEGINLIBPATH" $(VBOX_UIC)
|
---|
1226 | VBOX_MOC := BEGINLIBPATH="$(dir $(VBOX_MOC));$$BEGINLIBPATH" $(VBOX_MOC)
|
---|
1227 | VBOX_LUPDATE := BEGINLIBPATH="$(dir $(VBOX_LUPDATE));$$BEGINLIBPATH" $(VBOX_LUPDATE)
|
---|
1228 | VBOX_LRELEASE := BEGINLIBPATH="$(dir $(VBOX_LRELEASE));$$BEGINLIBPATH" $(VBOX_LRELEASE)
|
---|
1229 | endif
|
---|
1230 |
|
---|
1231 | #
|
---|
1232 | # The linux kernel headers(/sources).
|
---|
1233 | #
|
---|
1234 | ifneq ($(filter linux,$(BUILD_TARGET)),)
|
---|
1235 | ifeq ($(origin VBOX_LINUX_SRC),undefined)
|
---|
1236 | ifneq ($(wildcard /lib/modules/$(shell uname -r)/build/include/linux/autoconf.h),)
|
---|
1237 | export VBOX_LINUX_SRC := /lib/modules/$(shell uname -r)/build
|
---|
1238 | else
|
---|
1239 | export VBOX_LINUX_SRC := /usr/src/linux
|
---|
1240 | endif
|
---|
1241 | endif
|
---|
1242 | ifeq ($(origin VBOX_LINUX_INCS),undefined)
|
---|
1243 | export VBOX_LINUX_INCS := $(VBOX_LINUX_SRC)/include
|
---|
1244 | # support splitted Linux kernels (make O=<build directory>)
|
---|
1245 | kernelsrc := $(shell $(SED_EXT) -ne 's+^KERNELSRC.*= *\(.*\)+\1+p' $(VBOX_LINUX_SRC)/Makefile)
|
---|
1246 | ifneq ($(kernelsrc),)
|
---|
1247 | kernelpath := $(realpath $(VBOX_LINUX_SRC)/$(kernelsrc))
|
---|
1248 | VBOX_LINUX_INCS += $(VBOX_LINUX_SRC)/include2 $(kernelpath)/include
|
---|
1249 | else
|
---|
1250 | kernelpath := $(VBOX_LINUX_SRC)
|
---|
1251 | endif
|
---|
1252 | ifeq ($(BUILD_TARGET_ARCH),x86)
|
---|
1253 | VBOX_LINUX_INCS += $(kernelpath)/include/asm-i386/mach-default
|
---|
1254 | endif
|
---|
1255 | endif
|
---|
1256 | endif
|
---|
1257 |
|
---|
1258 |
|
---|
1259 | #
|
---|
1260 | # Template for building GC things.
|
---|
1261 | #
|
---|
1262 | TEMPLATE_VBOXGC = VBox GC
|
---|
1263 | TEMPLATE_VBOXGC_ASTOOL = $(VBOX_ASTOOL)
|
---|
1264 | TEMPLATE_VBOXGC_ASFLAGS = $(VBOX_ASFLAGS32)
|
---|
1265 | TEMPLATE_VBOXGC_DEFS = IN_GC $(ARCH_BITS_DEFS)
|
---|
1266 | TEMPLATE_VBOXGC_SYSSUFF = .gc
|
---|
1267 | TEMPLATE_VBOXGC_BLD_TRG_ARCH = x86
|
---|
1268 |
|
---|
1269 | ifeq ($(VBOX_LDR_FMT32),pe)
|
---|
1270 | ifdef VBOX_USE_VCC80
|
---|
1271 | TEMPLATE_VBOXGC_TOOL = VCC80X86
|
---|
1272 | 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)
|
---|
1273 | else
|
---|
1274 | TEMPLATE_VBOXGC_TOOL = VCC70
|
---|
1275 | TEMPLATE_VBOXGC_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -W3 -wd4244 $(VBOX_VCC_GC_OPT) $(VBOX_VCC_GC_FP)
|
---|
1276 | endif
|
---|
1277 | TEMPLATE_VBOXGC_CFLAGS = $(TEMPLATE_VBOXGC_CXXFLAGS)
|
---|
1278 | TEMPLATE_VBOXGC_LDFLAGS = -Driver -Subsystem:NATIVE -Incremental:NO -Align:32 -MapInfo:Lines -MapInfo:Exports -NoD
|
---|
1279 | ifdef VBOX_USE_VCC80
|
---|
1280 | include $(PATH_KBUILD)/sdks/W2K3DDKX86.kmk
|
---|
1281 | TEMPLATE_VBOXGC_LIBS = \
|
---|
1282 | $(PATH_SDK_W2K3DDKX86_LIB)/int64.lib
|
---|
1283 | else
|
---|
1284 | TEMPLATE_VBOXGC_LIBS = \
|
---|
1285 | $(PATH_TOOL_VCC70_LIB)/libcmt.lib # for 64-bit int
|
---|
1286 | endif
|
---|
1287 | endif
|
---|
1288 |
|
---|
1289 | ifeq ($(VBOX_LDR_FMT32),elf)
|
---|
1290 | TEMPLATE_VBOXGC_TOOL = $(VBOX_GCC32_TOOL)
|
---|
1291 | 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) $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden)
|
---|
1292 | 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) $(VBOX_GCC_fvisibility-hidden)
|
---|
1293 | ifeq ($(BUILD_TARGET),solaris)
|
---|
1294 | TEMPLATE_VBOXGC_LDFLAGS = -r
|
---|
1295 | else
|
---|
1296 | TEMPLATE_VBOXGC_LDFLAGS = -nostdlib -Bsymbolic
|
---|
1297 | # temporarily, must fix the loader.
|
---|
1298 | TEMPLATE_VBOXGC_LDFLAGS += $(if $(VBOX_DO_STRIP_MODULES),-S,)
|
---|
1299 | TEMPLATE_VBOXGC_LDFLAGS.release = $(if $(VBOX_DO_STRIP_MODULES),-S,)
|
---|
1300 | endif
|
---|
1301 | ifneq ($(filter-out solaris freebsd,$(BUILD_TARGET)),)
|
---|
1302 | TEMPLATE_VBOXGC_LIBS = \
|
---|
1303 | $(VBOX_GCC32_LIBGCC) # instricts
|
---|
1304 | endif
|
---|
1305 | endif
|
---|
1306 |
|
---|
1307 | ifeq ($(VBOX_LDR_FMT32),macho)
|
---|
1308 | TEMPLATE_VBOXGC_TOOL = GXX4MACHO
|
---|
1309 | TEMPLATE_VBOXGC_CXXFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC32_Wno-variadic-macros) -pipe -fno-common -msoft-float -static -fno-exceptions -fno-rtti $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -fno-strict-aliasing
|
---|
1310 | TEMPLATE_VBOXGC_CFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC32_Wno-variadic-macros) -pipe -fno-common -msoft-float -static -Wno-trigraphs -Wmissing-prototypes -Wstrict-prototypes $(VBOX_GCC_GC_OPT) $(VBOX_GCC_GC_FP) -fno-strict-aliasing
|
---|
1311 | TEMPLATE_VBOXGC_LDFLAGS = -nostdlib
|
---|
1312 | #TEMPLATE_VBOXGC_LDFLAGS.release = -Wl,-S ???
|
---|
1313 | endif
|
---|
1314 |
|
---|
1315 | ifeq ($(VBOX_LDR_FMT32),lx)
|
---|
1316 | TEMPLATE_VBOXGC_TOOL = GXX3OMF
|
---|
1317 | 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
|
---|
1318 | 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
|
---|
1319 | TEMPLATE_VBOXGC_LDFLAGS = -Zdll -nostdlib
|
---|
1320 | TEMPLATE_VBOXGC_LIBS = \
|
---|
1321 | $(VBOX_GCC32_LIBGCC) \
|
---|
1322 | $(OBJ_SYS0) \
|
---|
1323 | end
|
---|
1324 | endif
|
---|
1325 |
|
---|
1326 |
|
---|
1327 | #
|
---|
1328 | # Template for building a GC ring-3 testcase (tstVMStructGC, tstDevStructGC).
|
---|
1329 | #
|
---|
1330 | TEMPLATE_VBOXGCEXE = VBox GC as ring-3 testcase
|
---|
1331 | TEMPLATE_VBOXGCEXE_EXTENDS = VBOXGC
|
---|
1332 |
|
---|
1333 | ifeq ($(VBOX_LDR_FMT32),pe)
|
---|
1334 | TEMPLATE_VBOXGCEXE_LDFLAGS = -Incremental:NO -MapInfo:Exports -NoD -Debug
|
---|
1335 | TEMPLATE_VBOXGCEXE_SDKS = WIN32SDK
|
---|
1336 | ifdef VBOX_USE_VCC80
|
---|
1337 | TEMPLATE_VBOXGCEXE_LIBS = \
|
---|
1338 | $(PATH_TOOL_VCC80X86_LIB)/libcmt.lib \
|
---|
1339 | $(PATH_TOOL_VCC80X86_LIB)/oldnames.lib
|
---|
1340 | else
|
---|
1341 | TEMPLATE_VBOXGCEXE_LIBS = \
|
---|
1342 | $(PATH_TOOL_VCC70_LIB)/libcmt.lib \
|
---|
1343 | $(PATH_TOOL_VCC70_LIB)/oldnames.lib
|
---|
1344 | endif
|
---|
1345 | endif
|
---|
1346 |
|
---|
1347 | ifeq ($(VBOX_LDR_FMT32),elf)
|
---|
1348 | TEMPLATE_VBOXGCEXE_LDFLAGS = -g
|
---|
1349 | TEMPLATE_VBOXGCEXE_LDFLAGS.release = -g
|
---|
1350 | endif
|
---|
1351 |
|
---|
1352 | ifeq ($(VBOX_LDR_FMT32),macho)
|
---|
1353 | TEMPLATE_VBOXGCEXE_CFLAGS = $(filter-out -static,$(TEMPLATE_VBOXGC_CFLAGS))
|
---|
1354 | TEMPLATE_VBOXGCEXE_CXXFLAGS = $(filter-out -static,$(TEMPLATE_VBOXGC_CXXFLAGS))
|
---|
1355 | TEMPLATE_VBOXGCEXE_LDFLAGS = -g
|
---|
1356 | endif
|
---|
1357 |
|
---|
1358 | ifeq ($(VBOX_LDR_FMT32),lx)
|
---|
1359 | TEMPLATE_VBOXGCEXE_LDFLAGS = -g
|
---|
1360 | TEMPLATE_VBOXGCEXE_LIBS = $(NO_SUCH_VARIABLE)
|
---|
1361 | endif
|
---|
1362 |
|
---|
1363 |
|
---|
1364 | #
|
---|
1365 | # Template for building R0 things.
|
---|
1366 | #
|
---|
1367 | TEMPLATE_VBOXR0 = VBox Ring 0
|
---|
1368 | TEMPLATE_VBOXR0_ASTOOL = $(VBOX_ASTOOL)
|
---|
1369 | TEMPLATE_VBOXR0_ASFLAGS = $(VBOX_ASFLAGS)
|
---|
1370 | TEMPLATE_VBOXR0_DEFS = IN_RING0 $(ARCH_BITS_DEFS)
|
---|
1371 |
|
---|
1372 | ifeq ($(VBOX_LDR_FMT),pe)
|
---|
1373 | TEMPLATE_VBOXR0_TOOL = $(VBOX_VCC_TOOL)
|
---|
1374 | ifdef VBOX_USE_VCC80
|
---|
1375 | TEMPLATE_VBOXR0_CXXFLAGS = -Zi -Zl -GR- -GS- -EHs-c- -GF- -W3 -wd4244 -wd4996 -Zc:wchar_t- $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
|
---|
1376 | else
|
---|
1377 | TEMPLATE_VBOXR0_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -W3 -wd4244 $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
|
---|
1378 | endif
|
---|
1379 | TEMPLATE_VBOXR0_CFLAGS = $(TEMPLATE_VBOXR0_CXXFLAGS)
|
---|
1380 | TEMPLATE_VBOXR0_LDFLAGS = -Driver -Subsystem:NATIVE -Incremental:NO -Align:32 -MapInfo:Exports -NoD
|
---|
1381 | ifdef VBOX_USE_VCC80
|
---|
1382 | TEMPLATE_VBOXR0_LIBS.x86 = \
|
---|
1383 | $(PATH_SDK_W2K3DDKX86_LIB)/int64.lib
|
---|
1384 | else
|
---|
1385 | TEMPLATE_VBOXR0_LIBS.x86 = \
|
---|
1386 | $(PATH_TOOL_VCC70_LIB)/libcmt.lib # for 64-bit int
|
---|
1387 | endif
|
---|
1388 | endif # pe
|
---|
1389 |
|
---|
1390 | ifeq ($(VBOX_LDR_FMT),elf)
|
---|
1391 | TEMPLATE_VBOXR0_TOOL = $(VBOX_GCC_TOOL)
|
---|
1392 | 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) $(VBOX_GCC_fvisibility-hidden)
|
---|
1393 | 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) $(VBOX_GCC_fvisibility-inlines-hidden) $(VBOX_GCC_fvisibility-hidden)
|
---|
1394 | TEMPLATE_VBOXR0_CFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-asynchronous-unwind-tables -ffreestanding
|
---|
1395 | TEMPLATE_VBOXR0_CXXFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -fno-asynchronous-unwind-tables
|
---|
1396 | ifeq ($(BUILD_TARGET),solaris)
|
---|
1397 | TEMPLATE_VBOXR0_LDFLAGS = -r
|
---|
1398 | else
|
---|
1399 | TEMPLATE_VBOXR0_LDFLAGS = -nostdlib -Bsymbolic
|
---|
1400 | # temporarily, must fix the loader.
|
---|
1401 | TEMPLATE_VBOXR0_LDFLAGS += $(if $(VBOX_DO_STRIP_MODULES),-S,)
|
---|
1402 | TEMPLATE_VBOXR0_LDFLAGS.release = $(if $(VBOX_DO_STRIP_MODULES),-S,)
|
---|
1403 | endif
|
---|
1404 |
|
---|
1405 | ifneq ($(filter-out solaris freebsd,$(BUILD_TARGET)),)
|
---|
1406 | TEMPLATE_VBOXR0_LIBS = \
|
---|
1407 | $(VBOX_GCC_LIBGCC) # instricts
|
---|
1408 | endif
|
---|
1409 | endif
|
---|
1410 |
|
---|
1411 | ifeq ($(VBOX_LDR_FMT),macho)
|
---|
1412 | TEMPLATE_VBOXR0_TOOL = GXX4MACHO
|
---|
1413 | TEMPLATE_VBOXR0_CXXFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC_Wno-variadic-macros) -pipe -fno-common -msoft-float -static -fno-rtti -fno-exceptions $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing
|
---|
1414 | TEMPLATE_VBOXR0_CFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC_Wno-variadic-macros) -pipe -fno-common -msoft-float -static -Wmissing-prototypes -Wstrict-prototypes $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing
|
---|
1415 | TEMPLATE_VBOXR0_LDFLAGS = -nostdlib
|
---|
1416 | #TEMPLATE_VBOXR0_LDFLAGS.release = -Wl,-S ???
|
---|
1417 | endif
|
---|
1418 |
|
---|
1419 | ifeq ($(VBOX_LDR_FMT),lx)
|
---|
1420 | TEMPLATE_VBOXR0_TOOL = GXX3OMF
|
---|
1421 | 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
|
---|
1422 | 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
|
---|
1423 | TEMPLATE_VBOXR0_LDFLAGS = -Zdll -nostdlib
|
---|
1424 | TEMPLATE_VBOXR0_LIBS = \
|
---|
1425 | $(VBOX_GCC_LIBGCC) \
|
---|
1426 | $(OBJ_SYS0) \
|
---|
1427 | end
|
---|
1428 | endif
|
---|
1429 |
|
---|
1430 |
|
---|
1431 | #
|
---|
1432 | # Template for building SUPDRV R0 things.
|
---|
1433 | #
|
---|
1434 | TEMPLATE_VBOXR0DRV = VBox SUPDRV Ring 0
|
---|
1435 | TEMPLATE_VBOXR0DRV_ASTOOL = $(VBOX_ASTOOL)
|
---|
1436 | TEMPLATE_VBOXR0DRV_ASFLAGS = $(VBOX_ASFLAGS)
|
---|
1437 | TEMPLATE_VBOXR0DRV_DEFS = IN_RING0 IN_RT_R0 $(ARCH_BITS_DEFS)
|
---|
1438 |
|
---|
1439 | ifeq ($(BUILD_TARGET),win)
|
---|
1440 | TEMPLATE_VBOXR0DRV_TOOL = $(VBOX_VCC_TOOL)
|
---|
1441 | TEMPLATE_VBOXR0DRV_RCDEFS = \
|
---|
1442 | VBOX_VERSION_MAJOR=\"$(VBOX_VERSION_MAJOR)\" \
|
---|
1443 | VBOX_VERSION_MINOR=\"$(VBOX_VERSION_MINOR)\" \
|
---|
1444 | VBOX_VERSION_BUILD=\"$(VBOX_VERSION_BUILD)\" \
|
---|
1445 | VBOX_VERSION_MAJOR_NR=$(VBOX_VERSION_MAJOR) \
|
---|
1446 | VBOX_VERSION_MINOR_NR=$(VBOX_VERSION_MINOR) \
|
---|
1447 | VBOX_VERSION_BUILD_NR=$(VBOX_VERSION_BUILD)
|
---|
1448 | TEMPLATE_VBOXR0DRV_DEFS.x86 = _X86_
|
---|
1449 | TEMPLATE_VBOXR0DRV_DEFS.amd64 = _AMD64_
|
---|
1450 | ifdef VBOX_USE_VCC80
|
---|
1451 | TEMPLATE_VBOXR0DRV_CXXFLAGS = -Zi -Zl -GR- -GS- -EHs-c- -GF- -Gz -W3 -wd4996 -Zc:wchar_t- $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
|
---|
1452 | else
|
---|
1453 | TEMPLATE_VBOXR0DRV_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -Gz -W3 $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
|
---|
1454 | endif
|
---|
1455 | TEMPLATE_VBOXR0DRV_CFLAGS = $(TEMPLATE_VBOXR0DRV_CXXFLAGS)
|
---|
1456 | TEMPLATE_VBOXR0DRV_LDFLAGS = -Driver -Subsystem:NATIVE -Incremental:NO -Align:32 -MapInfo:Exports -NoD -Debug
|
---|
1457 | TEMPLATE_VBOXR0DRV_POST_CMDS = $(VBOX_SIGN_DRIVER_CMDS)
|
---|
1458 | endif
|
---|
1459 |
|
---|
1460 | ifeq ($(BUILD_TARGET),linux)
|
---|
1461 | TEMPLATE_VBOXR0DRV_TOOL = $(VBOX_GCC_TOOL)
|
---|
1462 | TEMPLATE_VBOXR0DRV_DEFS = __KERNEL__ MODULE IN_RING0 IN_RT_R0
|
---|
1463 | TEMPLATE_VBOXR0DRV_INCS = $(VBOX_LINUX_INCS)
|
---|
1464 | TEMPLATE_VBOXR0DRV_CFLAGS = -nostdinc -iwithprefix include \
|
---|
1465 | -Wall -Wstrict-prototypes -Wno-trigraphs $(VBOX_GCC_Wno-pointer-sign) \
|
---|
1466 | $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing -fno-common
|
---|
1467 | TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -mpreferred-stack-boundary=2 -msoft-float
|
---|
1468 | TEMPLATE_VBOXR0DRV_CFLAGS.amd64 = -m64 -mno-red-zone -mcmodel=kernel -mno-sse -mno-mmx -mno-sse2 -mno-3dnow \
|
---|
1469 | -fno-reorder-blocks -ffreestanding -fno-asynchronous-unwind-tables -funit-at-a-time \
|
---|
1470 | -Wno-sign-compare -Wdeclaration-after-statement
|
---|
1471 | TEMPLATE_VBOXR0DRV_CXXFLAGS = $(filter-out -Wstrict-prototypes -Wno-pointer-sign -ffreestanding -Wdeclaration-after-statement,$(TEMPLATE_VBOXR0DRV_CFLAGS) $(TEMPLATE_VBOXR0DRV_CFLAGS.$(BUILD_TARGET_ARCH))) -fno-exceptions -fno-rtti
|
---|
1472 | ifndef VBOX_LINUX_VERSION_2_4
|
---|
1473 | # 2.6
|
---|
1474 | TEMPLATE_VBOXR0DRV_SYSSUFF = .ko
|
---|
1475 | TEMPLATE_VBOXR0DRV_LDFLAGS.x86 = -m elf_i386 -r
|
---|
1476 | TEMPLATE_VBOXR0DRV_LDFLAGS.amd64 = -m elf_x86_64 -r
|
---|
1477 | else
|
---|
1478 | # 2.4
|
---|
1479 | TEMPLATE_VBOXR0DRV_SYSSUFF = .o
|
---|
1480 | TEMPLATE_VBOXR0DRV_LDFLAGS = -r -s
|
---|
1481 | endif
|
---|
1482 | endif
|
---|
1483 |
|
---|
1484 | ifeq ($(BUILD_TARGET),os2)
|
---|
1485 | TEMPLATE_VBOXR0DRV_TOOL = GXX3OMF
|
---|
1486 | 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 -fno-rtti -fno-exceptions
|
---|
1487 | 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
|
---|
1488 | TEMPLATE_VBOXR0DRV_LIBS = $(VBOX_GCC_LIBGCC)
|
---|
1489 | # wlink thinks physdevice doesn't need fixups and should have a stack - stupid!
|
---|
1490 | TEMPLATE_VBOXR0DRV_LDFLAGS = -Zlinker Option -Zlinker internalrelocs, -Zlinker togglerelocs
|
---|
1491 | endif
|
---|
1492 |
|
---|
1493 | ifeq ($(BUILD_TARGET),darwin)
|
---|
1494 | TEMPLATE_VBOXR0DRV_TOOL = GXX4MACHO
|
---|
1495 | TEMPLATE_VBOXR0DRV_DEFS += KERNEL KERNEL_PRIVATE DRIVER_PRIVATE APPLE NeXT
|
---|
1496 | TEMPLATE_VBOXR0DRV_INCS += \
|
---|
1497 | /System/Library/Frameworks/Kernel.framework/PrivateHeaders \
|
---|
1498 | /Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks/Kernel.framework/Headers
|
---|
1499 | TEMPLATE_VBOXR0DRV_CXXFLAGS = \
|
---|
1500 | -g -Wall -Wno-long-long -Wno-trigraphs -pipe -fno-common -nostdinc -fno-builtin -finline \
|
---|
1501 | -fno-keep-inline-functions -force_cpusubtype_ALL -fno-exceptions -msoft-float -static \
|
---|
1502 | -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk \
|
---|
1503 | -fapple-kext -fno-rtti -fcheck-new
|
---|
1504 | TEMPLATE_VBOXR0DRV_CXXFLAGS.release = $(VBOX_GCC_OPT) $(VBOX_GCC_FP) -fno-strict-aliasing -fasm-blocks
|
---|
1505 | TEMPLATE_VBOXR0DRV_CXXFLAGS.profile = $(TEMPLATE_VBOXR0DRV_CXXFLAGS.release)
|
---|
1506 | TEMPLATE_VBOXR0DRV_CXXFLAGS.kprofile = $(TEMPLATE_VBOXR0DRV_CXXFLAGS.release)
|
---|
1507 | TEMPLATE_VBOXR0DRV_CFLAGS = \
|
---|
1508 | -g -Wall -Wno-long-long -Wno-trigraphs -pipe -fno-common -nostdinc -fno-builtin -finline \
|
---|
1509 | -fno-keep-inline-functions -force_cpusubtype_ALL -fno-exceptions -msoft-float -static \
|
---|
1510 | -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk \
|
---|
1511 | -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations
|
---|
1512 | TEMPLATE_VBOXR0DRV_CFLAGS.release = $(TEMPLATE_VBOXR0DRV_CXXFLAGS.release)
|
---|
1513 | TEMPLATE_VBOXR0DRV_CFLAGS.profile = $(TEMPLATE_VBOXR0DRV_CXXFLAGS.profile)
|
---|
1514 | TEMPLATE_VBOXR0DRV_CFLAGS.kprofile = $(TEMPLATE_VBOXR0DRV_CXXFLAGS.kprofile)
|
---|
1515 | TEMPLATE_VBOXR0DRV_LDFLAGS = -static -nostdlib -r -Wl,-Y,1455 \
|
---|
1516 | -mmacosx-version-min=10.4 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
|
---|
1517 | TEMPLATE_VBOXR0DRV_LIBS = kmodc++ kmod cc_kext cpp_kext $(VBOX_GCC_LIBGCC)
|
---|
1518 | endif
|
---|
1519 |
|
---|
1520 | ifeq ($(BUILD_TARGET),solaris)
|
---|
1521 | ## The Solaris /usr/include.
|
---|
1522 | VBOX_SOLARIS_SYS_INCS ?= /usr/include
|
---|
1523 |
|
---|
1524 | TEMPLATE_VBOXR0DRV_TOOL = $(VBOX_GCC_TOOL)
|
---|
1525 | TEMPLATE_VBOXR0DRV_DEFS = _KERNEL _STRICT_STDC IN_RING0 IN_RT_R0
|
---|
1526 | TEMPLATE_VBOXR0DRV_SYSSUFF = .o
|
---|
1527 | TEMPLATE_VBOXR0DRV_LDFLAGS = -r
|
---|
1528 | TEMPLATE_VBOXR0DRV_LDFLAGS.amd64 = -64
|
---|
1529 | # Exclude -Wall because of solaris headers' pragma ident warnings that gcc refuses to supress.
|
---|
1530 | TEMPLATE_VBOXR0DRV_CFLAGS = -Wno-trigraphs -Wpointer-arith -Winline $(VBOX_GCC_Wno-pointer-sign) \
|
---|
1531 | -Wmissing-prototypes -Wstrict-prototypes -Wnested-externs \
|
---|
1532 | -O2 -ffreestanding -nodefaultlibs -fno-strict-aliasing -fno-common -std=c99
|
---|
1533 | TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -m32 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow
|
---|
1534 | TEMPLATE_VBOXR0DRV_CFLAGS.amd64 = -m64 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-red-zone -mcmodel=kernel \
|
---|
1535 | -fno-reorder-blocks -fno-asynchronous-unwind-tables -funit-at-a-time
|
---|
1536 | TEMPLATE_VBOXR0DRV_CXXFLAGS = -Wno-trigraphs -Wpointer-arith -Winline $(VBOX_GCC_Wno-pointer-sign) \
|
---|
1537 | -O2 -nodefaultlibs -fno-strict-aliasing -fno-common
|
---|
1538 | TEMPLATE_VBOXR0DRV_CXXFLAGS.x86 = $(TEMPLATE_VBOXR0DRV_CFLAGS.x86)
|
---|
1539 | TEMPLATE_VBOXR0DRV_CXXFLAGS.amd64 = $(TEMPLATE_VBOXR0DRV_CFLAGS.amd64)
|
---|
1540 | endif # Solaris
|
---|
1541 |
|
---|
1542 | ifeq ($(BUILD_TARGET),freebsd)
|
---|
1543 | # x86 FreeBSD:
|
---|
1544 | # cc -O2 -fno-strict-aliasing -pipe -Werror -D_KERNEL -DKLD_MODULE \
|
---|
1545 | # -nostdinc -I- -I. -I@ -I@/contrib/altq -I@/../include -I/usr/include \
|
---|
1546 | # -finline-limit=8000 -fno-common -mno-align-long-strings -mpreferred-stack-boundary=2 \
|
---|
1547 | # -mno-mmx -mno-3dnow -mno-sse -mno-sse2 -ffreestanding -Wall -Wredundant-decls -Wnested-externs \
|
---|
1548 | # -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Winline -Wcast-qual -fformat-extensions \
|
---|
1549 | # -std=c99 -c ../my.c
|
---|
1550 | # ld -d -warn-common -r -d -o my.kld my.o
|
---|
1551 | # :> export_syms
|
---|
1552 | # awk -f /usr/src/sys/modules/my/../../conf/kmod_syms.awk my.kld export_syms | xargs -J% objcopy % my.kld
|
---|
1553 | # ld -Bsharable -d warn-commnon -o my.ko my.kld
|
---|
1554 | #
|
---|
1555 | # Note: @ -> /usr/src/sys and machine -> /usr/src/sys/i386/include
|
---|
1556 |
|
---|
1557 | ## The location of the FreeBSD kernel source.
|
---|
1558 | VBOX_FREEBSD_SRC ?= /usr/src/sys
|
---|
1559 | ## The FreeBSD /usr/include.
|
---|
1560 | VBOX_FREEBSD_SYS_INCS ?= /usr/include
|
---|
1561 |
|
---|
1562 | TEMPLATE_VBOXR0DRV_TOOL = $(VBOX_GCC_TOOL)
|
---|
1563 | TEMPLATE_VBOXR0DRV_LDTOOL = FREEBSDKMODLD
|
---|
1564 | TEMPLATE_VBOXR0DRV_DEFS = _KERNEL KLD_MODULE IN_RING0 IN_RT_R0
|
---|
1565 | TEMPLATE_VBOXR0DRV_INCS = \
|
---|
1566 | $(VBOX_FREEBSD_SRC) \
|
---|
1567 | $(VBOX_FREEBSD_SRC)/contrib/altq \
|
---|
1568 | $(VBOX_FREEBSD_SRC)/../include \
|
---|
1569 | $(VBOX_FREEBSD_SYS_INCS)
|
---|
1570 | # omitting: -Wcast-qual, -Wredundant-decls
|
---|
1571 | TEMPLATE_VBOXR0DRV_CFLAGS = \
|
---|
1572 | -Wall -Wno-trigraphs -Wpointer-arith -Winline $(VBOX_GCC_Wno-pointer-sign) \
|
---|
1573 | -Wstrict-prototypes -Wmissing-prototypes -Wstrict-prototypes -Wnested-externs \
|
---|
1574 | -O2 -fformat-extensions -ffreestanding -fno-strict-aliasing -fno-common -finline-limit=8000 \
|
---|
1575 | $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_OPT) $(VBOX_GCC_FP) \
|
---|
1576 | -nostdinc -std=c99
|
---|
1577 | TEMPLATE_VBOXR0DRV_CFLAGS.x86 = -m32 -mno-align-long-strings -mpreferred-stack-boundary=2 -mno-mmx -mno-3dnow -mno-sse -mno-sse2
|
---|
1578 | TEMPLATE_VBOXR0DRV_CFLAGS.amd64 = -m64 "Port me to amd64 FreeBSD"
|
---|
1579 | TEMPLATE_VBOXR0DRV_CXXFLAGS = -fno-exceptions -fno-rtti \
|
---|
1580 | -Wall -Wno-trigraphs -Wpointer-arith -Winline $(VBOX_GCC_Wno-pointer-sign) \
|
---|
1581 | -O2 -fno-format-extensions -fno-strict-aliasing -fno-common -finline-limit=8000 \
|
---|
1582 | $(VBOX_GCC_fno-stack-protector) $(VBOX_GCC_OPT) $(VBOX_GCC_FP) \
|
---|
1583 | -nostdinc
|
---|
1584 | TEMPLATE_VBOXR0DRV_SYSSUFF = .ko
|
---|
1585 | TEMPLATE_VBOXR0DRV_LDFLAGS = -d --warn-common
|
---|
1586 | TEMPLATE_VBOXR0DRV_LDFLAGS.x86 = -m elf_i386_fbsd
|
---|
1587 | TEMPLATE_VBOXR0DRV_LDFLAGS.amd64 = -m elf_x86_64 "Port me to amd64 FreeBSD"
|
---|
1588 |
|
---|
1589 | TOOL_FREEBSDKMODLD = FreeBSD kernel module linker.
|
---|
1590 | # See kBuild/tools/GCC3.kmk for docs.
|
---|
1591 | TOOL_FREEBSDKMODLD_LINK_SYSMOD_OUTPUT = $(outbase).kld
|
---|
1592 | TOOL_FREEBSDKMODLD_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).map
|
---|
1593 | TOOL_FREEBSDKMODLD_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
|
---|
1594 | TOOL_FREEBSDKMODLD_LINK_SYSMOD_DEPORD =
|
---|
1595 | define TOOL_FREEBSDKMODLD_LINK_SYSMOD_CMDS
|
---|
1596 | @# Link intermediate .kld (a relocatable object).
|
---|
1597 | ld $(flags) -r -o $(outbase).kld $(objs) \
|
---|
1598 | $(foreach p,$(libpath), -L$(p))\
|
---|
1599 | $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib)))
|
---|
1600 | @# Strip non-exported symbols private and localize the exported ones.
|
---|
1601 | awk -f $(VBOX_FREEBSD_SRC)/conf/kmod_syms.awk $(outbase).kld $(if $(othersrc), $(othersrc),/dev/null) \
|
---|
1602 | | xargs -J% objcopy % $(outbase).kld
|
---|
1603 | @# Link the final .ko (a shared object).
|
---|
1604 | ld $(flags) -Bshareable -o $(out) $(outbase).kld
|
---|
1605 | endef
|
---|
1606 |
|
---|
1607 | endif # FreeBSD
|
---|
1608 |
|
---|
1609 | ifdef VBOX_WITH_VBOXDRV
|
---|
1610 | ifndef TEMPLATE_VBOXR0DRV_TOOL
|
---|
1611 | $(warning Warning: VBox Build: Target $(BUILD_PLATFORM) is not officially supported!)
|
---|
1612 | endif
|
---|
1613 | endif
|
---|
1614 |
|
---|
1615 |
|
---|
1616 |
|
---|
1617 | #
|
---|
1618 | # Template for building R3 executables and static libraries which are linked into executables.
|
---|
1619 | #
|
---|
1620 | TEMPLATE_VBOXR3EXE = VBox Ring 3 Exe
|
---|
1621 | TEMPLATE_VBOXR3EXE_ASTOOL = $(VBOX_ASTOOL)
|
---|
1622 | TEMPLATE_VBOXR3EXE_ASFLAGS = $(VBOX_ASFLAGS)
|
---|
1623 | TEMPLATE_VBOXR3EXE_DEFS = IN_RING3 $(ARCH_BITS_DEFS)
|
---|
1624 | TEMPLATE_VBOXR3EXE_LIBS.kprofile = $(LIB_KPROFILE)
|
---|
1625 | ifeq ($(BUILD_TARGET),win)
|
---|
1626 | TEMPLATE_VBOXR3EXE_TOOL = $(VBOX_VCC_TOOL)
|
---|
1627 | TEMPLATE_VBOXR3EXE_RCDEFS = \
|
---|
1628 | VBOX_VERSION_MAJOR=\"$(VBOX_VERSION_MAJOR)\" \
|
---|
1629 | VBOX_VERSION_MINOR=\"$(VBOX_VERSION_MINOR)\" \
|
---|
1630 | VBOX_VERSION_BUILD=\"$(VBOX_VERSION_BUILD)\" \
|
---|
1631 | VBOX_VERSION_MAJOR_NR=$(VBOX_VERSION_MAJOR) \
|
---|
1632 | VBOX_VERSION_MINOR_NR=$(VBOX_VERSION_MINOR) \
|
---|
1633 | VBOX_VERSION_BUILD_NR=$(VBOX_VERSION_BUILD)
|
---|
1634 | TEMPLATE_VBOXR3EXE_SDKS = WINPSDK
|
---|
1635 | ifdef VBOX_USE_VCC80
|
---|
1636 | TEMPLATE_VBOXR3EXE_CXXFLAGS = -Zi -Zl -GR- -EHs-c- -GF- -MD -W3 -wd4065 -wd4244 -wd4996 -Zc:wchar_t- $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
|
---|
1637 | TEMPLATE_VBOXR3EXE_CXXFLAGS.debug = -RTCsu
|
---|
1638 | else
|
---|
1639 | TEMPLATE_VBOXR3EXE_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -MD -W3 -wd4065 -wd4244 $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
|
---|
1640 | TEMPLATE_VBOXR3EXE_CXXFLAGS.debug = -GZ
|
---|
1641 | endif
|
---|
1642 | TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile = -Gh -GH
|
---|
1643 | TEMPLATE_VBOXR3EXE_CFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS)
|
---|
1644 | TEMPLATE_VBOXR3EXE_CFLAGS.debug = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.debug)
|
---|
1645 | TEMPLATE_VBOXR3EXE_CFLAGS.kprofile = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile)
|
---|
1646 | TEMPLATE_VBOXR3EXE_LDFLAGS = \
|
---|
1647 | /NOD /INCREMENTAL:NO /MAPINFO:EXPORTS /LARGEADDRESSAWARE /DEBUG \
|
---|
1648 | /DISALLOWLIB:libc.lib \
|
---|
1649 | /DISALLOWLIB:libcd.lib \
|
---|
1650 | /DISALLOWLIB:libcmt.lib \
|
---|
1651 | /DISALLOWLIB:libcmtd.lib \
|
---|
1652 | /DISALLOWLIB:msvcrtd.lib
|
---|
1653 | TEMPLATE_VBOXR3EXE_LIBS = \
|
---|
1654 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt.lib \
|
---|
1655 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcprt.lib \
|
---|
1656 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/oldnames.lib
|
---|
1657 | TEMPLATE_VBOXR3EXE_POST_CMDS = $(VBOX_SIGN_IMAGE_CMDS)
|
---|
1658 |
|
---|
1659 | else # the gcc guys
|
---|
1660 | TEMPLATE_VBOXR3EXE_TOOL = $(VBOX_GCC_TOOL)
|
---|
1661 | 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 $(VBOX_GCC_fvisibility-inlines-hidden) $(VBOX_GCC_fvisibility-hidden)
|
---|
1662 | TEMPLATE_VBOXR3EXE_CXXFLAGS.x86 = -m32
|
---|
1663 | TEMPLATE_VBOXR3EXE_CXXFLAGS.amd64 = -m64
|
---|
1664 | # L4 currently can't handle exception handling.
|
---|
1665 | TEMPLATE_VBOXR3EXE_CXXFLAGS.l4 = -fno-exceptions -nostdinc \
|
---|
1666 | $(addprefix -I,$(VBOX_PATH_GCC_INCS) $(L4_INCDIR) $(FILE_TOOL_GPP3_INCDIR)) \
|
---|
1667 | $(DEBUG_L4)
|
---|
1668 | TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile = -finstrument-functions
|
---|
1669 | 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 $(VBOX_GCC_fvisibility-hidden)
|
---|
1670 | TEMPLATE_VBOXR3EXE_CFLAGS.x86 = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.x86)
|
---|
1671 | TEMPLATE_VBOXR3EXE_CFLAGS.amd64 = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.amd64)
|
---|
1672 | TEMPLATE_VBOXR3EXE_CFLAGS.debug = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.debug)
|
---|
1673 | TEMPLATE_VBOXR3EXE_CFLAGS.kprofile = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile)
|
---|
1674 | TEMPLATE_VBOXR3EXE_CFLAGS.darwin = -fno-common
|
---|
1675 | TEMPLATE_VBOXR3EXE_CFLAGS.l4 = -nostdinc \
|
---|
1676 | $(addprefix -I,$(VBOX_PATH_GCC_INCS) $(L4_INCDIR)) $(DEBUG_L4)
|
---|
1677 | TEMPLATE_VBOXR3EXE_DEFS.l4 = L4_THREAD_SAFE
|
---|
1678 | TEMPLATE_VBOXR3EXE_LDFLAGS.x86 = -m32
|
---|
1679 | TEMPLATE_VBOXR3EXE_LDFLAGS.amd64 = -m64
|
---|
1680 | TEMPLATE_VBOXR3EXE_LDFLAGS.l4 = \
|
---|
1681 | $(L4_LIBDIR)/../crt0.o \
|
---|
1682 | -T$(L4_LIBDIR)/../main_dyn.ld -nostdlib \
|
---|
1683 | -Wl,--export-dynamic,--dynamic-linker=libld-l4.s.so \
|
---|
1684 | -Wl,--rpath-link,$(L4_LIBDIR)
|
---|
1685 | TEMPLATE_VBOXR3EXE_LDFLAGS.linux = -Wl,-z,noexecstack
|
---|
1686 | ifeq ($(BUILD_TARGET),linux)
|
---|
1687 | TEMPLATE_VBOXR3EXE_LIBS = pthread m rt dl
|
---|
1688 | else ifeq ($(BUILD_TARGET),l4)
|
---|
1689 | TEMPLATE_VBOXR3EXE_LIBS = \
|
---|
1690 | $(L4_LIBDIR)/libvboxserver.s.so \
|
---|
1691 | $(L4_LIBDIR)/libuc++.0.s.so \
|
---|
1692 | supc++ gcc_eh gcc \
|
---|
1693 | $(L4_LIBDIR)/libdl.s.so \
|
---|
1694 | $(L4_LIBDIR)/libuc.0.s.so
|
---|
1695 | else ifeq ($(BUILD_TARGET),os2)
|
---|
1696 | TEMPLATE_VBOXR3EXE_TOOL = GXX3OMF
|
---|
1697 | TEMPLATE_VBOXR3EXE_LIBS = socket iconv
|
---|
1698 | else ifeq ($(BUILD_TARGET),darwin)
|
---|
1699 | TEMPLATE_VBOXR3EXE_TOOL = GXX4MACHO
|
---|
1700 | TEMPLATE_VBOXR3EXE_LIBS =
|
---|
1701 | TEMPLATE_VBOXR3EXE_LDFLAGS = -read_only_relocs suppress
|
---|
1702 | TEMPLATE_VBOXR3EXE_INCS += $(VBOX_PATH_MACOSX_SDK_INCS)
|
---|
1703 | else ifeq ($(filter-out freebsd netbsd openbsd,$(BUILD_TARGET)),)
|
---|
1704 | TEMPLATE_VBOXR3EXE_TOOL = GXX3
|
---|
1705 | TEMPLATE_VBOXR3EXE_LIBS = pthread
|
---|
1706 | TEMPLATE_VBOXR3EXE_INCS += \
|
---|
1707 | /usr/include \
|
---|
1708 | /usr/X11R6/include \
|
---|
1709 | /usr/local/include
|
---|
1710 | else ifeq ($(BUILD_TARGET),solaris)
|
---|
1711 | TEMPLATE_VBOXR3EXE_TOOL = GXX3PLAIN
|
---|
1712 | TEMPLATE_VBOXR3EXE_DEFS += LIBICONV_PLUG _REENTRANT # Avoid the GNU libiconv, for now at least.
|
---|
1713 | TEMPLATE_VBOXR3EXE_LIBS = rt socket
|
---|
1714 | else
|
---|
1715 | $(warning Warning: VBOX Build: Target $(BUILD_TARGET) is not officially supported!)
|
---|
1716 | TEMPLATE_VBOXR3EXE_CXXFLAGS.profile = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.release)
|
---|
1717 | TEMPLATE_VBOXR3EXE_CXXFLAGS.kprofile = $(TEMPLATE_VBOXR3EXE_CXXFLAGS.krelease)
|
---|
1718 | endif
|
---|
1719 | endif
|
---|
1720 |
|
---|
1721 | #
|
---|
1722 | # Template for building R3 shared objects / DLLs.
|
---|
1723 | # This is mostly identical to the VBOXR3EXE template. (Avoid PIC if possible!)
|
---|
1724 | #
|
---|
1725 | TEMPLATE_VBOXR3 = VBox Ring 3 SO/DLLs
|
---|
1726 | TEMPLATE_VBOXR3_EXTENDS = VBOXR3EXE
|
---|
1727 | TEMPLATE_VBOXR3_LDFLAGS.l4 = $(L4_LIBDIR)/../crt0.s.o -T$(L4_LIBDIR)/../main_rel.ld -nostdlib
|
---|
1728 | TEMPLATE_VBOXR3_DEFS.l4 = $(TEMPLATE_VBOXR3EXE_DEFS.l4) __PIC__
|
---|
1729 | TEMPLATE_VBOXR3_DEFS.darwin = $(TEMPLATE_VBOXR3EXE_DEFS.darwin) PIC
|
---|
1730 | ifeq ($(filter-out solaris.x86 %.amd64,$(BUILD_TARGET).$(BUILD_TARGET_ARCH)),)
|
---|
1731 | ifneq ($(BUILD_TARGET),win)
|
---|
1732 | TEMPLATE_VBOXR3_DEFS = $(TEMPLATE_VBOXR3EXE_DEFS) PIC
|
---|
1733 | TEMPLATE_VBOXR3_CFLAGS = $(TEMPLATE_VBOXR3EXE_CFLAGS) -fPIC
|
---|
1734 | TEMPLATE_VBOXR3_CXXFLAGS = $(TEMPLATE_VBOXR3EXE_CXXFLAGS) -fPIC
|
---|
1735 | TEMPLATE_VBOXR3_LDFLAGS = $(TEMPLATE_VBOXR3EXE_LDFLAGS) -fPIC
|
---|
1736 | endif
|
---|
1737 | endif
|
---|
1738 |
|
---|
1739 | #
|
---|
1740 | # Ring-3 testcase.
|
---|
1741 | # This is the VBOXR3EXE template only with a different install dir.
|
---|
1742 | #
|
---|
1743 | TEMPLATE_VBOXR3TSTEXE = VBox Ring 3 Testcase Exe
|
---|
1744 | TEMPLATE_VBOXR3TSTEXE_EXTENDS = VBOXR3EXE
|
---|
1745 | TEMPLATE_VBOXR3TSTEXE_INST = $(INST_TESTCASE)
|
---|
1746 | TEMPLATE_VBOXR3TSTEXE_LIBS = $(LIB_RUNTIME) $(TEMPLATE_VBOXR3EXE_LIBS)
|
---|
1747 | ifeq ($(BUILD_TARGET),win)
|
---|
1748 | ifdef VBOX_SIGNING_MODE
|
---|
1749 | TEMPLATE_VBOXR3TSTEXE_POST_CMDS =
|
---|
1750 | endif
|
---|
1751 | endif
|
---|
1752 |
|
---|
1753 | #
|
---|
1754 | # Template for building bad C/C++ style R3 executables (no -pedantic).
|
---|
1755 | #
|
---|
1756 | TEMPLATE_VBOXR3NPEXE = VBox Ring 3 Non-pedantic
|
---|
1757 | TEMPLATE_VBOXR3NPEXE_EXTENDS = VBOXR3EXE
|
---|
1758 | ifneq ($(BUILD_TARGET),win)
|
---|
1759 | # (only gcc)
|
---|
1760 | TEMPLATE_VBOXR3NPEXE_TOOL = $(VBOX_GCC_TOOL)
|
---|
1761 | TEMPLATE_VBOXR3NPEXE_CXXFLAGS = $(filter-out -pedantic,$(TEMPLATE_VBOXR3EXE_CXXFLAGS))
|
---|
1762 | TEMPLATE_VBOXR3NPEXE_CFLAGS = $(filter-out -pedantic -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations,$(TEMPLATE_VBOXR3EXE_CFLAGS))
|
---|
1763 | endif
|
---|
1764 |
|
---|
1765 | #
|
---|
1766 | # Template for building bad C/C++ style R3 shared libraries / Dlls (no -pedantic).
|
---|
1767 | # This is mostly identical to the VBOXR3NPEXE template.
|
---|
1768 | #
|
---|
1769 | TEMPLATE_VBOXR3NP= VBox Ring 3 Non-pedantic
|
---|
1770 | TEMPLATE_VBOXR3NP_EXTENDS = VBOXR3NPEXE
|
---|
1771 | TEMPLATE_VBOXR3NP_LDFLAGS.l4 = \
|
---|
1772 | $(L4_LIBDIR)/../crt0.s.o \
|
---|
1773 | -T$(L4_LIBDIR)/../main_rel.ld \
|
---|
1774 | -nostdlib
|
---|
1775 | TEMPLATE_VBOXR3NP_DEFS.l4 = $(TEMPLATE_VBOXR3NPEXE_DEFS.l4) __PIC__
|
---|
1776 | ifeq ($(filter-out solaris.x86 %.amd64,$(BUILD_TARGET).$(BUILD_TARGET_ARCH)),)
|
---|
1777 | ifneq ($(BUILD_TARGET),win)
|
---|
1778 | TEMPLATE_VBOXR3NP_DEFS = $(TEMPLATE_VBOXR3NPEXE_DEFS) PIC
|
---|
1779 | TEMPLATE_VBOXR3NP_CFLAGS = $(TEMPLATE_VBOXR3NPEXE_CFLAGS) -fPIC
|
---|
1780 | TEMPLATE_VBOXR3NP_CXXFLAGS = $(TEMPLATE_VBOXR3NPEXE_CXXFLAGS) -fPIC
|
---|
1781 | TEMPLATE_VBOXR3NP_LDFLAGS = $(TEMPLATE_VBOXR3NPEXE_LDFLAGS) -fPIC
|
---|
1782 | endif
|
---|
1783 | endif
|
---|
1784 |
|
---|
1785 |
|
---|
1786 | #
|
---|
1787 | # Template for building libraries, shared libraries / modules
|
---|
1788 | # which only depends on IPRT for crt.
|
---|
1789 | #
|
---|
1790 | TEMPLATE_VBOXNOCRTGCC = VBox no-crt GCC libraries and modules, yasm/nasm.
|
---|
1791 | TEMPLATE_VBOXNOCRTGCC_DEFS = IN_RING3 IPRT_NO_CRT $(ARCH_BITS_DEFS)
|
---|
1792 | TEMPLATE_VBOXNOCRTGCC_ASDEFS = ASM_CALL64_GCC
|
---|
1793 | TEMPLATE_VBOXNOCRTGCC_CFLAGS = -nostdinc -fno-strict-aliasing -fno-math-errno -Wall
|
---|
1794 | TEMPLATE_VBOXNOCRTGCC_CFLAGS.x86 = -m32
|
---|
1795 | TEMPLATE_VBOXNOCRTGCC_CFLAGS.amd64 = -m64 -mcmodel=medium -fno-common
|
---|
1796 | TEMPLATE_VBOXNOCRTGCC_CFLAGS.release = -O2 -fno-strict-aliasing
|
---|
1797 | TEMPLATE_VBOXNOCRTGCC_CFLAGS.profile = $(TEMPLATE_VBOXNOCRTGCC_CFLAGS.release)
|
---|
1798 | TEMPLATE_VBOXNOCRTGCC_CFLAGS.kprofile = $(TEMPLATE_VBOXNOCRTGCC_CFLAGS.release)
|
---|
1799 | TEMPLATE_VBOXNOCRTGCC_CFLAGS.darwin = -mdynamic-no-pic
|
---|
1800 | TEMPLATE_VBOXNOCRTGCC_CXXFLAGS = $(TEMPLATE_VBOXNOCRTGCC_CFLAGS)
|
---|
1801 | TEMPLATE_VBOXNOCRTGCC_CXXFLAGS.$(BUILD_TARGET) = $(TEMPLATE_VBOXNOCRTGCC_CFLAGS.$(BUILD_TARGET))
|
---|
1802 | TEMPLATE_VBOXNOCRTGCC_CXXFLAGS.$(BUILD_TARGET_ARCH) = $(TEMPLATE_VBOXNOCRTGCC_CFLAGS.$(BUILD_TARGET_ARCH))
|
---|
1803 | TEMPLATE_VBOXNOCRTGCC_INCS = $(PATH_ROOT)/include/iprt/nocrt
|
---|
1804 |
|
---|
1805 | ifeq ($(BUILD_TARGET).$(BUILD_TARGET_ARCH),win.amd64)
|
---|
1806 | # cross compile to 64-bit ELF (linux).
|
---|
1807 | TEMPLATE_VBOXNOCRTGCC_TOOL = XGCCAMD64LINUX
|
---|
1808 | TEMPLATE_VBOXNOCRTGCC_ASTOOL = YASM
|
---|
1809 | TEMPLATE_VBOXNOCRTGCC_ASFLAGS = -f elf64 -DASM_FORMAT_ELF -D__YASM__ -w+orphan-labels -g dwarf2
|
---|
1810 | TEMPLATE_VBOXNOCRTGCC_LIBS = $(PATH_DEVTOOLS)/win.x86/x86_64-unknown-linux-gnu/20060701-r2/lib/gcc/x86_64-unknown-linux-gnu/3.4.6/libgcc.a
|
---|
1811 | TEMPLATE_VBOXNOCRTGCC_LDFLAGS = -nostdlib
|
---|
1812 |
|
---|
1813 | else ifeq ($(BUILD_TARGET).$(BUILD_TARGET_ARCH),win.x86)
|
---|
1814 | # Use the default GCC (MinGW) with the Microsoft linker.
|
---|
1815 | # (Drop all '-g' options as we're unable to strip the debug info.)
|
---|
1816 | TEMPLATE_VBOXNOCRTGCC_TOOL = $(VBOX_GCC_TOOL)
|
---|
1817 | TEMPLATE_VBOXNOCRTGCC_ASTOOL = $(VBOX_ASTOOL)
|
---|
1818 | TEMPLATE_VBOXNOCRTGCC_ASFLAGS = $(VBOX_ASFLAGS)
|
---|
1819 | TEMPLATE_VBOXNOCRTGCC_LDTOOL = $(VBOX_VCC_TOOL)
|
---|
1820 | TEMPLATE_VBOXNOCRTGCC_LDFLAGS = -Incremental:NO -MapInfo:Exports -NoD
|
---|
1821 | TEMPLATE_VBOXNOCRTGCC_LIBS = $(VBOX_GCC_LIBGCC)
|
---|
1822 | TEMPLATE_VBOXNOCRTGCC_CFLAGS := $(filter-out -g,$(TEMPLATE_VBOXNOCRTGCC_CFLAGS)) -s
|
---|
1823 |
|
---|
1824 | else
|
---|
1825 | # Use the default GCC.
|
---|
1826 | # The use of --exclude-libs ALL is to avoid confusing the linux ld.so.
|
---|
1827 | TEMPLATE_VBOXNOCRTGCC_TOOL = $(VBOX_GCC_TOOL)
|
---|
1828 | TEMPLATE_VBOXNOCRTGCC_ASTOOL = $(VBOX_ASTOOL)
|
---|
1829 | TEMPLATE_VBOXNOCRTGCC_ASFLAGS = $(VBOX_ASFLAGS)
|
---|
1830 | TEMPLATE_VBOXNOCRTGCC_CFLAGS += $(VBOX_GCC_fno-stack-protector)
|
---|
1831 | TEMPLATE_VBOXNOCRTGCC_CXXFLAGS += $(VBOX_GCC_fno-stack-protector)
|
---|
1832 | ifeq ($(BUILD_TARGET_ARCH),amd64)
|
---|
1833 | # in 64-bit mode we'll build a sys-module (VBoxREM2).
|
---|
1834 | if1of ($(BUILD_TARGET),darwin solaris)
|
---|
1835 | TEMPLATE_VBOXNOCRTGCC_LDFLAGS.solaris= -64 -r
|
---|
1836 | else
|
---|
1837 | TEMPLATE_VBOXNOCRTGCC_LDFLAGS = -nostdlib
|
---|
1838 | endif
|
---|
1839 | else # x86:
|
---|
1840 | TEMPLATE_VBOXNOCRTGCC_LDFLAGS = -nostdlib
|
---|
1841 | ifneq ($(filter-out os2 darwin solaris,$(BUILD_TARGET)),)
|
---|
1842 | TEMPLATE_VBOXNOCRTGCC_LDFLAGS += -Wl,--no-undefined
|
---|
1843 | endif
|
---|
1844 | endif # x86
|
---|
1845 | TEMPLATE_VBOXNOCRTGCC_LIBS = # FIXME - has unwind mess.
|
---|
1846 | endif
|
---|
1847 |
|
---|
1848 |
|
---|
1849 | #
|
---|
1850 | # Same as VBOXNOCRTGCC only it uses GAS as the assembler instead of yasm/nasm.
|
---|
1851 | #
|
---|
1852 | TEMPLATE_VBOXNOCRTGAS = VBox no-crt GCC libraries and modules, gas.
|
---|
1853 | TEMPLATE_VBOXNOCRTGAS_EXTENDS = VBOXNOCRTGCC
|
---|
1854 | TEMPLATE_VBOXNOCRTGAS_ASTOOL = $(TEMPLATE_VBOXNOCRTGCC_TOOL)
|
---|
1855 | ifeq ($(BUILD_TARGET).$(BUILD_TARGET_ARCH),win.x86)
|
---|
1856 | TEMPLATE_VBOXNOCRTGAS_ASFLAGS = -s
|
---|
1857 | else
|
---|
1858 | TEMPLATE_VBOXNOCRTGAS_ASFLAGS = -g
|
---|
1859 | endif
|
---|
1860 | TEMPLATE_VBOXNOCRTGAS_ASFLAGS.x86 = -m32
|
---|
1861 | TEMPLATE_VBOXNOCRTGAS_ASFLAGS.amd64 = -m64
|
---|
1862 |
|
---|
1863 |
|
---|
1864 | #
|
---|
1865 | # Template for building executables that are part of the VBox Main component
|
---|
1866 | # (COM/XPCOM interface to VirtualBox).
|
---|
1867 | #
|
---|
1868 |
|
---|
1869 | TEMPLATE_VBOXMAINEXE = VBox Main Executable
|
---|
1870 | TEMPLATE_VBOXMAINEXE_ASTOOL = $(VBOX_ASTOOL)
|
---|
1871 | TEMPLATE_VBOXMAINEXE_ASFLAGS = $(VBOX_ASFLAGS)
|
---|
1872 | TEMPLATE_VBOXMAINEXE_DEFS = IN_RING3 UNICODE NDEBUG=1
|
---|
1873 | TEMPLATE_VBOXMAINEXE_DEFS.win = _UNICODE
|
---|
1874 | TEMPLATE_VBOXMAINEXE_RCDEFS = $(TEMPLATE_VBOXR3EXE_RCDEFS)
|
---|
1875 | TEMPLATE_VBOXMAINEXE_LIBS.kprofile = $(LIB_KPROFILE)
|
---|
1876 | TEMPLATE_VBOXMAINEXE_INCS = \
|
---|
1877 | $(VBOX_PATH_SDK)/include
|
---|
1878 |
|
---|
1879 | ifeq ($(BUILD_TARGET),win)
|
---|
1880 | TEMPLATE_VBOXMAINEXE_SDKS = WINPSDK W2K3DDK
|
---|
1881 | ifdef VBOX_USE_VCC80
|
---|
1882 | TEMPLATE_VBOXMAINEXE_TOOL = $(VBOX_VCC_TOOL)
|
---|
1883 | TEMPLATE_VBOXMAINEXE_CXXFLAGS = -Zi -Zl -GR -GF- -MD -EHsc -W3 -wd4065 -wd4996 -Zc:wchar_t- $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
|
---|
1884 | TEMPLATE_VBOXMAINEXE_CXXFLAGS.debug = -RTCsu
|
---|
1885 | else
|
---|
1886 | TEMPLATE_VBOXMAINEXE_TOOL = VCC70
|
---|
1887 | TEMPLATE_VBOXMAINEXE_CXXFLAGS = -Zi -Zl -GR -GX- -GF- -MD -EHsc -W3 -wd4065 $(VBOX_VCC_OPT) $(VBOX_VCC_FP)
|
---|
1888 | TEMPLATE_VBOXMAINEXE_CXXFLAGS.debug = -GZ
|
---|
1889 | endif
|
---|
1890 | TEMPLATE_VBOXMAINEXE_CXXFLAGS.kprofile = -Gh -GH
|
---|
1891 | TEMPLATE_VBOXMAINEXE_CFLAGS = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS)
|
---|
1892 | TEMPLATE_VBOXMAINEXE_CFLAGS.debug = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.debug)
|
---|
1893 | TEMPLATE_VBOXMAINEXE_CFLAGS.kprofile = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.kprofile)
|
---|
1894 | TEMPLATE_VBOXMAINEXE_INCS += \
|
---|
1895 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_INC)
|
---|
1896 | TEMPLATE_VBOXMAINEXE_LDFLAGS = \
|
---|
1897 | /NOD /INCREMENTAL:NO /MAPINFO:EXPORTS /LARGEADDRESSAWARE /DEBUG\
|
---|
1898 | /DISALLOWLIB:libc.lib \
|
---|
1899 | /DISALLOWLIB:libcd.lib \
|
---|
1900 | /DISALLOWLIB:msvcrt.lib \
|
---|
1901 | /DISALLOWLIB:msvcrtd.lib \
|
---|
1902 | /DISALLOWLIB:libcmtd.lib \
|
---|
1903 | /DISALLOWLIB:libcmt.lib
|
---|
1904 | TEMPLATE_VBOXMAINEXE_LIBS = \
|
---|
1905 | $(LIB_RUNTIME) \
|
---|
1906 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt.lib \
|
---|
1907 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcprt.lib \
|
---|
1908 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/oldnames.lib \
|
---|
1909 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_LIB)/atls.lib
|
---|
1910 | TEMPLATE_VBOXMAINEXE_POST_CMDS = $(VBOX_SIGN_IMAGE_CMDS)
|
---|
1911 |
|
---|
1912 | else # the GCC guys:
|
---|
1913 |
|
---|
1914 | TEMPLATE_VBOXMAINEXE_TOOL = $(VBOX_GCC_TOOL)
|
---|
1915 | 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 $(VBOX_GCC_fvisibility-inlines-hidden) $(VBOX_GCC_fvisibility-hidden)
|
---|
1916 | TEMPLATE_VBOXMAINEXE_CXXFLAGS.x86 = -m32
|
---|
1917 | TEMPLATE_VBOXMAINEXE_CXXFLAGS.amd64 = -m64
|
---|
1918 | TEMPLATE_VBOXMAINEXE_CXXFLAGS.kprofile = -finstrument-functions
|
---|
1919 | 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 $(VBOX_GCC_fvisibility-hidden)
|
---|
1920 | TEMPLATE_VBOXMAINEXE_CFLAGS.x86 = -m32
|
---|
1921 | TEMPLATE_VBOXMAINEXE_CFLAGS.amd64 = -m64
|
---|
1922 | TEMPLATE_VBOXMAINEXE_CFLAGS.kprofile = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.kprofile)
|
---|
1923 | TEMPLATE_VBOXMAINEXE_LDFLAGS.x86 = -m32
|
---|
1924 | TEMPLATE_VBOXMAINEXE_LDFLAGS.amd64 = -m64
|
---|
1925 | ifeq ($(BUILD_TARGET),linux)
|
---|
1926 | TEMPLATE_VBOXMAINEXE_LIBS = pthread m rt $(LIB_RUNTIME)
|
---|
1927 | else ifeq ($(BUILD_TARGET),l4)
|
---|
1928 | TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME)
|
---|
1929 | # no libs as yet in l4 target - must be added later
|
---|
1930 | else ifeq ($(BUILD_TARGET),os2)
|
---|
1931 | TEMPLATE_VBOXMAINEXE_TOOL = GXX3OMF
|
---|
1932 | TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME)
|
---|
1933 | else ifeq ($(BUILD_TARGET),darwin)
|
---|
1934 | TEMPLATE_VBOXMAINEXE_TOOL = GXX4MACHO
|
---|
1935 | TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME)
|
---|
1936 | TEMPLATE_VBOXMAINEXE_LDFLAGS.darwin = -bind_at_load -framework Carbon
|
---|
1937 | else ifeq ($(filter-out freebsd netbsd openbsd,$(BUILD_TARGET)),)
|
---|
1938 | TEMPLATE_VBOXMAINEXE_TOOL = GXX3
|
---|
1939 | TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME)
|
---|
1940 | TEMPLATE_VBOXMAINEXE_INCS += $(VBOX_PATH_MACOSX_SDK_INCS)
|
---|
1941 | else ifeq ($(BUILD_TARGET),solaris)
|
---|
1942 | TEMPLATE_VBOXMAINEXE_TOOL = GXX3PLAIN
|
---|
1943 | TEMPLATE_VBOXMAINEXE_DEFS += _REENTRANT
|
---|
1944 | TEMPLATE_VBOXMAINEXE_LIBS = $(LIB_RUNTIME) rt
|
---|
1945 | else
|
---|
1946 | $(warning Warning: VBOX Build: Target $(BUILD_TARGET) is not officially supported!)
|
---|
1947 | TEMPLATE_VBOXMAINEXE_LIBS =
|
---|
1948 | endif
|
---|
1949 |
|
---|
1950 | endif # !win
|
---|
1951 |
|
---|
1952 | # Add COM/XPCOM stuff
|
---|
1953 | TEMPLATE_VBOXMAINEXE_LIBS += \
|
---|
1954 | $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB)
|
---|
1955 | ifdef VBOX_WITH_XPCOM
|
---|
1956 | ## @todo may be worth creating the VBOX_XPCOM SDK def
|
---|
1957 | TEMPLATE_VBOXMAINEXE_DEFS += VBOX_WITH_XPCOM
|
---|
1958 | TEMPLATE_VBOXMAINEXE_INCS += \
|
---|
1959 | $(VBOX_XPCOM_INCS)
|
---|
1960 | TEMPLATE_VBOXMAINEXE_LIBS += \
|
---|
1961 | $(LIB_XPCOM)
|
---|
1962 | endif
|
---|
1963 |
|
---|
1964 | #
|
---|
1965 | # Template for building the Main DLL modules (such as in-process COM/XPCOM
|
---|
1966 | # components for Main).
|
---|
1967 | #
|
---|
1968 | # This differs from VBOXMAINEXE only in PIC handling and similar DLL stuff.
|
---|
1969 | #
|
---|
1970 |
|
---|
1971 | TEMPLATE_VBOXMAINDLL = VBox Main Component (shared library)
|
---|
1972 | TEMPLATE_VBOXMAINDLL_EXTENDS = VBOXMAINEXE
|
---|
1973 | ifeq ($(filter-out solaris.x86 %.amd64,$(BUILD_TARGET).$(BUILD_TARGET_ARCH)),)
|
---|
1974 | ifneq ($(BUILD_TARGET),win)
|
---|
1975 | TEMPLATE_VBOXMAINDLL_DEFS = PIC $(TEMPLATE_VBOXMAINEXE_DEFS)
|
---|
1976 | TEMPLATE_VBOXMAINDLL_CFLAGS = -fPIC $(TEMPLATE_VBOXMAINEXE_CFLAGS)
|
---|
1977 | TEMPLATE_VBOXMAINDLL_CXXFLAGS = -fPIC $(TEMPLATE_VBOXMAINEXE_CXXFLAGS)
|
---|
1978 | TEMPLATE_VBOXMAINDLL_LDFLAGS = -fPIC $(TEMPLATE_VBOXMAINEXE_LDFLAGS)
|
---|
1979 | endif
|
---|
1980 | endif
|
---|
1981 | TEMPLATE_VBOXMAINDLL_LDFLAGS.darwin = $(filter-out -bind_at_load,$(TEMPLATE_VBOXMAINEXE_LDFLAGS.darwin))
|
---|
1982 |
|
---|
1983 | #
|
---|
1984 | # Template for building the Main static libraries.
|
---|
1985 | #
|
---|
1986 | # This differs from VBOXMAINDLL only that it zeroes out the _LIBS definition.
|
---|
1987 | #
|
---|
1988 |
|
---|
1989 | TEMPLATE_VBOXMAINLIB = VBox Main Component (static library)
|
---|
1990 | TEMPLATE_VBOXMAINLIB_EXTENDS = VBOXMAINDLL
|
---|
1991 | TEMPLATE_VBOXMAINLIB_LIBS =
|
---|
1992 |
|
---|
1993 | #
|
---|
1994 | # Template for building executables that use the VBox Main component.
|
---|
1995 | #
|
---|
1996 |
|
---|
1997 | TEMPLATE_VBOXMAINCLIENTEXE = VBox Main Client (executable)
|
---|
1998 | TEMPLATE_VBOXMAINCLIENTEXE_EXTENDS = VBOXMAINEXE
|
---|
1999 | ifeq ($(BUILD_TARGET),win)
|
---|
2000 | TEMPLATE_VBOXMAINCLIENTEXE_LIBS.win = $(TEMPLATE_VBOXMAINEXE_LIBS.win) \
|
---|
2001 | $(PATH_SDK_WINPSDK_LIB)/User32.Lib \
|
---|
2002 | $(PATH_SDK_WINPSDK_LIB)/Shell32.Lib \
|
---|
2003 | $(PATH_SDK_WINPSDK_LIB)/ShLwApi.Lib \
|
---|
2004 | $(PATH_SDK_WINPSDK_LIB)/Ole32.Lib \
|
---|
2005 | $(PATH_SDK_WINPSDK_LIB)/OleAut32.Lib \
|
---|
2006 | $(PATH_SDK_WINPSDK_LIB)/Uuid.Lib
|
---|
2007 | else
|
---|
2008 | TEMPLATE_VBOXMAINCLIENTEXE_DEFS = $(TEMPLATE_VBOXMAINEXE_DEFS) \
|
---|
2009 | NDEBUG TRIMMED
|
---|
2010 | ## @todo remove
|
---|
2011 | ## Wonder why we compile main with defaults for these two and then drops it
|
---|
2012 | ## in the client executables...
|
---|
2013 | #TEMPLATE_VBOXMAINCLIENTEXE_CXXFLAGS = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS) \
|
---|
2014 | # -fno-rtti -fno-exceptions
|
---|
2015 | TEMPLATE_VBOXMAINCLIENTEXE_CXXFLAGS.linux = $(TEMPLATE_VBOXMAINEXE_CXXFLAGS.linux) \
|
---|
2016 | -pthread
|
---|
2017 | TEMPLATE_VBOXMAINCLIENTEXE_LDFLAGS.darwin = $(TEMPLATE_VBOXMAINEXE_LDFLAGS.darwin) \
|
---|
2018 | -bind_at_load -framework Carbon
|
---|
2019 | endif
|
---|
2020 |
|
---|
2021 | #
|
---|
2022 | # Template for building shared libraries / DLLs that use the VBox Main component.
|
---|
2023 | #
|
---|
2024 | # This differs from VBOXMAINCLIENTEXE only in PIC handling and similar DLL stuff.
|
---|
2025 | #
|
---|
2026 |
|
---|
2027 | TEMPLATE_VBOXMAINCLIENTDLL = VBox MAIN Client (shared library)
|
---|
2028 | TEMPLATE_VBOXMAINCLIENTDLL_EXTENDS = VBOXMAINCLIENTEXE
|
---|
2029 | ifeq ($(filter-out solaris.x86 %.amd64,$(BUILD_TARGET).$(BUILD_TARGET_ARCH)),)
|
---|
2030 | ifneq ($(BUILD_TARGET),win)
|
---|
2031 | TEMPLATE_VBOXMAINCLIENTDLL_DEFS = PIC $(TEMPLATE_VBOXMAINCLIENTEXE_DEFS)
|
---|
2032 | TEMPLATE_VBOXMAINCLIENTDLL_CFLAGS = -fPIC $(TEMPLATE_VBOXMAINCLIENTEXE_CFLAGS)
|
---|
2033 | TEMPLATE_VBOXMAINCLIENTDLL_CXXFLAGS = -fPIC $(TEMPLATE_VBOXMAINCLIENTEXE_CXXFLAGS)
|
---|
2034 | TEMPLATE_VBOXMAINCLIENTDLL_LDFLAGS = -fPIC $(TEMPLATE_VBOXMAINCLIENTEXE_LDFLAGS)
|
---|
2035 | endif
|
---|
2036 | endif
|
---|
2037 | TEMPLATE_VBOXMAINCLIENTDLL_LDFLAGS.darwin = $(filter-out -bind_at_load,$(TEMPLATE_VBOXMAINCLIENTEXE_LDFLAGS.darwin))
|
---|
2038 |
|
---|
2039 |
|
---|
2040 | #
|
---|
2041 | # Template for building Qt GUI executables.
|
---|
2042 | #
|
---|
2043 |
|
---|
2044 | TEMPLATE_VBOXQTGUIEXE = VBox Qt GUI Executable
|
---|
2045 | TEMPLATE_VBOXQTGUIEXE_DEFS = IN_RING3 QT_NO_DEBUG QT_THREAD_SUPPORT $(ARCH_BITS_DEFS)
|
---|
2046 | TEMPLATE_VBOXQTGUIEXE_INCS = \
|
---|
2047 | $(VBOX_PATH_SDK)/include \
|
---|
2048 | $(VBOX_PATH_QT)/include
|
---|
2049 |
|
---|
2050 | ifeq ($(BUILD_TARGET),win)
|
---|
2051 | TEMPLATE_VBOXQTGUIEXE_TOOL = $(VBOX_VCC_TOOL)
|
---|
2052 | TEMPLATE_VBOXQTGUIEXE_DEFS += \
|
---|
2053 | _WIN32_WINNT=0x0500 UNICODE _UNICODE \
|
---|
2054 | QT_DLL _CRT_SECURE_NO_DEPRECATE
|
---|
2055 | ## @todo VCC70 flags?
|
---|
2056 | ifdef VBOX_USE_VCC80
|
---|
2057 | TEMPLATE_VBOXQTGUIEXE_CXXFLAGS = \
|
---|
2058 | -nologo -Zm200 -W3 -MD -Zi -EHsc -Zc:wchar_t-
|
---|
2059 | TEMPLATE_VBOXQTGUIEXE_CXXFLAGS.debug = -RTCsu
|
---|
2060 | else
|
---|
2061 | TEMPLATE_VBOXQTGUIEXE_CXXFLAGS = \
|
---|
2062 | -nologo -Zm200 -W3 -MD -Zi -GX
|
---|
2063 | TEMPLATE_VBOXQTGUIEXE_CXXFLAGS.debug = -GZ
|
---|
2064 | endif
|
---|
2065 | TEMPLATE_VBOXQTGUIEXE_INCS += \
|
---|
2066 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_INC)
|
---|
2067 | TEMPLATE_VBOXQTGUIEXE_LDFLAGS = \
|
---|
2068 | /NOD /NOLOGO /INCREMENTAL:NO /MAPINFO:EXPORTS /DEBUG \
|
---|
2069 | /DELAYLOAD:oleaut32.dll
|
---|
2070 | TEMPLATE_VBOXQTGUIEXE_SDKS = WINPSDK
|
---|
2071 | TEMPLATE_VBOXQTGUIEXE_LIBS = \
|
---|
2072 | $(LIB_QT) \
|
---|
2073 | $(LIB_QTMAIN) \
|
---|
2074 | $(LIB_RUNTIME) \
|
---|
2075 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcprt.lib \
|
---|
2076 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/msvcrt.lib \
|
---|
2077 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/oldnames.lib \
|
---|
2078 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib \
|
---|
2079 | $(PATH_TOOL_$(VBOX_VCC_TOOL)_ATLMFC_LIB)/atls.lib
|
---|
2080 | TEMPLATE_VBOXQTGUIEXE_POST_CMDS = $(VBOX_SIGN_IMAGE_CMDS)
|
---|
2081 |
|
---|
2082 | else # the gcc guys:
|
---|
2083 | TEMPLATE_VBOXQTGUIEXE_TOOL = $(VBOX_GCC_TOOL)
|
---|
2084 | TEMPLATE_VBOXQTGUIEXE_DEFS.linux = _REENTRANT
|
---|
2085 | TEMPLATE_VBOXQTGUIEXE_DEFS.solaris = _REENTRANT
|
---|
2086 |
|
---|
2087 | TEMPLATE_VBOXQTGUIEXE_INCS += \
|
---|
2088 | $(LIB_SDL_INC)
|
---|
2089 | TEMPLATE_VBOXQTGUIEXE_CXXFLAGS = \
|
---|
2090 | -pipe -Wall -W -frtti -fno-exceptions -Wno-non-virtual-dtor \
|
---|
2091 | -Wno-long-long -fshort-wchar -fno-strict-aliasing \
|
---|
2092 | $(VBOX_GCC_fvisibility-hidden) $(VBOX_GCC_fvisibility-inlines-hidden)
|
---|
2093 | TEMPLATE_VBOXQTGUIEXE_CXXFLAGS.x86 = -m32
|
---|
2094 | TEMPLATE_VBOXQTGUIEXE_CXXFLAGS.amd64 = -m64
|
---|
2095 | TEMPLATE_VBOXQTGUIEXE_CXXFLAGS.linux = -pthread
|
---|
2096 | TEMPLATE_VBOXQTGUIEXE_LDFLAGS.x86 = -m32
|
---|
2097 | TEMPLATE_VBOXQTGUIEXE_LDFLAGS.amd64 = -m64
|
---|
2098 | ## @todo no $(LIB_QTMAIN) here?
|
---|
2099 | TEMPLATE_VBOXQTGUIEXE_LIBS = \
|
---|
2100 | $(LIB_QT) \
|
---|
2101 | $(LIB_SDL) \
|
---|
2102 | $(LIB_RUNTIME) \
|
---|
2103 | $(LIB_REM) \
|
---|
2104 | $(LIB_VMM)
|
---|
2105 |
|
---|
2106 | ifeq ($(BUILD_TARGET_ARCH),amd64)
|
---|
2107 | TEMPLATE_VBOXQTGUIEXE_LIBPATH = \
|
---|
2108 | $(VBOX_PATH_QT)/lib64 $(VBOX_PATH_QT)/lib
|
---|
2109 | else
|
---|
2110 | TEMPLATE_VBOXQTGUIEXE_LIBPATH = \
|
---|
2111 | $(VBOX_PATH_QT)/lib
|
---|
2112 | endif
|
---|
2113 |
|
---|
2114 | ifeq ($(BUILD_TARGET),darwin)
|
---|
2115 | TEMPLATE_VBOXQTGUIEXE_INCS += $(VBOX_PATH_MACOSX_SDK_INCS)
|
---|
2116 | TEMPLATE_VBOXQTGUIEXE_LDFLAGS += -framework Carbon -framework QuickTime -bind_at_load
|
---|
2117 | TEMPLATE_VBOXQTGUIEXE_LIBS +=
|
---|
2118 | TEMPLATE_VBOXQTGUIEXE_LIBPATH +=
|
---|
2119 | else ifeq ($(BUILD_TARGET),os2)
|
---|
2120 | TEMPLATE_VBOXQTGUIEXE_LIBS +=
|
---|
2121 | TEMPLATE_VBOXQTGUIEXE_LIBPATH +=
|
---|
2122 | else
|
---|
2123 | TEMPLATE_VBOXQTGUIEXE_INCS += \
|
---|
2124 | $(VBOX_XCURSOR_INCS)
|
---|
2125 | TEMPLATE_VBOXQTGUIEXE_LIBS += \
|
---|
2126 | $(VBOX_XCURSOR_LIBS) \
|
---|
2127 | Xext \
|
---|
2128 | X11 \
|
---|
2129 | m \
|
---|
2130 | $(LIB_PTHREAD)
|
---|
2131 | TEMPLATE_VBOXQTGUIEXE_LIBPATH += \
|
---|
2132 | $(VBOX_LIBPATH_X11)
|
---|
2133 | ifeq ($(BUILD_TARGET),freebsd)
|
---|
2134 | TEMPLATE_VBOXQTGUIEXE_INCS += \
|
---|
2135 | /usr/include \
|
---|
2136 | /usr/X11R6/include \
|
---|
2137 | /usr/local/include
|
---|
2138 | endif
|
---|
2139 | ifeq ($(BUILD_TARGET),solaris)
|
---|
2140 | TEMPLATE_VBOXQTGUIEXE_LIBS += \
|
---|
2141 | rt socket nsl
|
---|
2142 | endif
|
---|
2143 | endif
|
---|
2144 |
|
---|
2145 | endif
|
---|
2146 |
|
---|
2147 | # Add COM/XPCOM stuff
|
---|
2148 | TEMPLATE_VBOXQTGUIEXE_LIBS += \
|
---|
2149 | $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB)
|
---|
2150 | ifdef VBOX_WITH_XPCOM
|
---|
2151 | ## @todo may be worth creating the VBOX_XPCOM SDK def
|
---|
2152 | TEMPLATE_VBOXQTGUIEXE_DEFS += VBOX_WITH_XPCOM
|
---|
2153 | TEMPLATE_VBOXQTGUIEXE_INCS += \
|
---|
2154 | $(VBOX_XPCOM_INCS)
|
---|
2155 | TEMPLATE_VBOXQTGUIEXE_LIBS += \
|
---|
2156 | $(LIB_XPCOM)
|
---|
2157 | endif
|
---|
2158 |
|
---|
2159 | #
|
---|
2160 | # Template for building Qt GUI components.
|
---|
2161 | #
|
---|
2162 | TEMPLATE_VBOXQTGUI = VBox Qt GUI Components
|
---|
2163 | TEMPLATE_VBOXQTGUI_EXTENDS = VBOXQTGUIEXE
|
---|
2164 | TEMPLATE_VBOXQTGUI_LIBS = $(filter-out $(QTMAIN) $(PATH_BIN)/VBoxXML$(VBOX_SUFF_DLL),$(TEMPLATE_VBOXQTGUIEXE_LIBS))
|
---|
2165 | ifeq ($(BUILD_TARGET),darwin)
|
---|
2166 | TEMPLATE_VBOXQTGUI_LDFLAGS = $(filter-out -framework Carbon -framework QuickTime -bind_at_load,$(TEMPLATE_VBOXQTGUIEXE_LDFLAGS))
|
---|
2167 | endif
|
---|
2168 | ifeq ($(filter-out solaris.x86 %.amd64,$(BUILD_TARGET).$(BUILD_TARGET_ARCH)),)
|
---|
2169 | ifneq ($(BUILD_TARGET),win)
|
---|
2170 | TEMPLATE_VBOXQTGUI_DEFS = PIC $(TEMPLATE_VBOXQTGUIEXE_DEFS)
|
---|
2171 | TEMPLATE_VBOXQTGUI_CFLAGS = -fPIC $(TEMPLATE_VBOXQTGUIEXE_CFLAGS)
|
---|
2172 | TEMPLATE_VBOXQTGUI_CXXFLAGS = -fPIC $(TEMPLATE_VBOXQTGUIEXE_CXXFLAGS)
|
---|
2173 | TEMPLATE_VBOXQTGUI_LDFLAGS = -fPIC $(TEMPLATE_VBOXQTGUIEXE_LDFLAGS)
|
---|
2174 | endif
|
---|
2175 | endif
|
---|
2176 |
|
---|
2177 |
|
---|
2178 | #
|
---|
2179 | # Template for building build bldprogs.
|
---|
2180 | #
|
---|
2181 | TEMPLATE_VBOXBLDPROG = VBox Build Program
|
---|
2182 | TEMPLATE_VBOXBLDPROG_DEFS = IN_RING3
|
---|
2183 | ifeq ($(BUILD_PLATFORM),win)
|
---|
2184 | ifeq ($(BUILD_PLATFORM_ARCH),x86)
|
---|
2185 | ifdef VBOX_USE_VCC80
|
---|
2186 | TEMPLATE_VBOXBLDPROG_TOOL = VCC80X86
|
---|
2187 | else
|
---|
2188 | TEMPLATE_VBOXBLDPROG_TOOL = VCC70
|
---|
2189 | endif
|
---|
2190 | TEMPLATE_VBOXBLDPROG_SDKS = WIN32SDK
|
---|
2191 | else
|
---|
2192 | TEMPLATE_VBOXBLDPROG_TOOL = VCC80AMD64
|
---|
2193 | TEMPLATE_VBOXBLDPROG_SDKS = WIN64SDK
|
---|
2194 | endif
|
---|
2195 | ifneq ($(TEMPLATE_VBOXBLDPROG_TOOL),VCC70)
|
---|
2196 | TEMPLATE_VBOXBLDPROG_CXXFLAGS = -Zi -Zl -GR- -EHs-c- -GF- -MT -W3 -wd4996 -Zc:wchar_t-
|
---|
2197 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.debug = -RTCsu
|
---|
2198 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.release = -O2 -Oy- -GS-
|
---|
2199 | else
|
---|
2200 | TEMPLATE_VBOXBLDPROG_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -MT -W3
|
---|
2201 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.debug = -GZ
|
---|
2202 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.release = -Ogitb2 -Oy-
|
---|
2203 | endif
|
---|
2204 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.profile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.release)
|
---|
2205 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.kprofile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.release)
|
---|
2206 | TEMPLATE_VBOXBLDPROG_CFLAGS = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS)
|
---|
2207 | TEMPLATE_VBOXBLDPROG_CFLAGS.debug = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.debug)
|
---|
2208 | TEMPLATE_VBOXBLDPROG_CFLAGS.release = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.release)
|
---|
2209 | TEMPLATE_VBOXBLDPROG_CFLAGS.profile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.profile)
|
---|
2210 | TEMPLATE_VBOXBLDPROG_CFLAGS.kprofile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.kprofile)
|
---|
2211 | TEMPLATE_VBOXBLDPROG_LDFLAGS = \
|
---|
2212 | /NOD /INCREMENTAL:NO /MAPINFO:EXPORTS /LARGEADDRESSAWARE /DEBUG \
|
---|
2213 | /DISALLOWLIB:libcd.lib \
|
---|
2214 | /DISALLOWLIB:libcmtd.lib \
|
---|
2215 | /DISALLOWLIB:msvcrt.lib \
|
---|
2216 | /DISALLOWLIB:msvcrtd.lib \
|
---|
2217 | /DISALLOWLIB:msvcprt.lib \
|
---|
2218 | /DISALLOWLIB:msvcprtd.lib
|
---|
2219 | TEMPLATE_VBOXBLDPROG_LIBS = \
|
---|
2220 | $(PATH_TOOL_$(TEMPLATE_VBOXBLDPROG_TOOL)_LIB)/oldnames.lib \
|
---|
2221 | $(PATH_TOOL_$(TEMPLATE_VBOXBLDPROG_TOOL)_LIB)/libcmt.lib \
|
---|
2222 | $(PATH_TOOL_$(TEMPLATE_VBOXBLDPROG_TOOL)_LIB)/libcpmt.lib
|
---|
2223 |
|
---|
2224 | else
|
---|
2225 | # (gcc of some kind )
|
---|
2226 | TEMPLATE_VBOXBLDPROG_TOOL = GXX3
|
---|
2227 | TEMPLATE_VBOXBLDPROG_CFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs $(VBOX_GCC_Wno-variadic-macros) -pipe -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations
|
---|
2228 | TEMPLATE_VBOXBLDPROG_CFLAGS.x86 = -m32
|
---|
2229 | TEMPLATE_VBOXBLDPROG_CFLAGS.amd64 = -m64
|
---|
2230 | TEMPLATE_VBOXBLDPROG_CFLAGS.release = -O2 -fno-omit-frame-pointer -fno-strict-aliasing
|
---|
2231 | TEMPLATE_VBOXBLDPROG_CFLAGS.profile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.profile)
|
---|
2232 | TEMPLATE_VBOXBLDPROG_CFLAGS.kprofile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.kprofile)
|
---|
2233 | TEMPLATE_VBOXBLDPROG_CXXFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs -pipe
|
---|
2234 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.x86 = -m32
|
---|
2235 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.amd64 = -m64
|
---|
2236 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.release = -O2 -fno-omit-frame-pointer -fno-strict-aliasing
|
---|
2237 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.profile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.release)
|
---|
2238 | TEMPLATE_VBOXBLDPROG_CXXFLAGS.kprofile = $(TEMPLATE_VBOXBLDPROG_CXXFLAGS.release)
|
---|
2239 | TEMPLATE_VBOXBLDPROG_LDFLAGS.x86 = -m32
|
---|
2240 | TEMPLATE_VBOXBLDPROG_LDFLAGS.amd64 = -m64
|
---|
2241 | ifeq ($(BUILD_PLATFORM),linux)
|
---|
2242 | TEMPLATE_VBOXBLDPROG_LIBS = pthread m rt dl
|
---|
2243 | else ifeq ($(BUILD_PLATFORM),os2)
|
---|
2244 | TEMPLATE_VBOXBLDPROG_TOOL = GXX3OMF
|
---|
2245 | TEMPLATE_VBOXBLDPROG_LIBS = socket iconv
|
---|
2246 | else ifeq ($(BUILD_PLATFORM),darwin)
|
---|
2247 | TEMPLATE_VBOXBLDPROG_TOOL = GXX4MACHO
|
---|
2248 | TEMPLATE_VBOXBLDPROG_LIBS =
|
---|
2249 | TEMPLATE_VBOXBLDPROG_INCS += $(VBOX_PATH_MACOSX_SDK_INCS)
|
---|
2250 | else ifeq ($(filter-out freebsd netbsd openbsd,$(BUILD_PLATFORM)),)
|
---|
2251 | TEMPLATE_VBOXBLDPROG_TOOL = GXX3
|
---|
2252 | TEMPLATE_VBOXBLDPROG_LIBS =
|
---|
2253 | else ifeq ($(BUILD_PLATFORM),solaris)
|
---|
2254 | TEMPLATE_VBOXBLDPROG_TOOL = GXX3PLAIN
|
---|
2255 | TEMPLATE_VBOXBLDPROG_LIBS = rt
|
---|
2256 | else
|
---|
2257 | $(warning Warning: VBOX Build: Target $(BUILD_PLATFORM) is not officially supported!)
|
---|
2258 | endif
|
---|
2259 |
|
---|
2260 | endif # !win
|
---|
2261 |
|
---|
2262 |
|
---|
2263 |
|
---|
2264 | #
|
---|
2265 | # Template for building R3 win32 guest additions.
|
---|
2266 | #
|
---|
2267 | TEMPLATE_VBOXW32GUESTR3 = VBox Win32 Guest Program
|
---|
2268 | TEMPLATE_VBOXW32GUESTR3_INST = $(INST_ADDITIONS)
|
---|
2269 | TEMPLATE_VBOXW32GUESTR3_BLD_TRG = win
|
---|
2270 | TEMPLATE_VBOXW32GUESTR3_BLD_TRG_ARCH = x86
|
---|
2271 | TEMPLATE_VBOXW32GUESTR3_BLD_TRG_CPU = i386
|
---|
2272 | TEMPLATE_VBOXW32GUESTR3_DEFS = IN_GUEST IN_GUEST_R3 IN_RING3 IN_RT_R3 __WIN32__ __WIN__ HC_ARCH_BITS=32 GC_ARCH_BITS=32
|
---|
2273 | TEMPLATE_VBOXW32GUESTR3_RCDEFS = \
|
---|
2274 | VBOX_VERSION_MAJOR=\"$(VBOX_VERSION_MAJOR)\" \
|
---|
2275 | VBOX_VERSION_MINOR=\"$(VBOX_VERSION_MINOR)\" \
|
---|
2276 | VBOX_VERSION_BUILD=\"$(VBOX_VERSION_BUILD)\" \
|
---|
2277 | VBOX_VERSION_MAJOR_NR=$(VBOX_VERSION_MAJOR) \
|
---|
2278 | VBOX_VERSION_MINOR_NR=$(VBOX_VERSION_MINOR) \
|
---|
2279 | VBOX_VERSION_BUILD_NR=$(VBOX_VERSION_BUILD)
|
---|
2280 | TEMPLATE_VBOXW32GUESTR3_ASTOOL = YASM
|
---|
2281 | TEMPLATE_VBOXW32GUESTR3_ASFLAGS = -f win32 -DASM_FORMAT_PE -D__YASM__ -w+orphan-labels
|
---|
2282 | TEMPLATE_VBOXW32GUESTR3_DLLSUFF = .dll
|
---|
2283 | TEMPLATE_VBOXW32GUESTR3_EXESUFF = .exe
|
---|
2284 | TEMPLATE_VBOXW32GUESTR3_LIBSUFF = .lib
|
---|
2285 | TEMPLATE_VBOXW32GUESTR3_ARLIBSUFF = .lib
|
---|
2286 | TEMPLATE_VBOXW32GUESTR3_SDKS = WIN32SDK W2K3DDKX86
|
---|
2287 | ifdef VBOX_USE_VCC80
|
---|
2288 | TEMPLATE_VBOXW32GUESTR3_TOOL = VCC80X86
|
---|
2289 | TEMPLATE_VBOXW32GUESTR3_CXXFLAGS = -Zi -Zl -GR- -EHs-c- -GF- -MT -U__LINUX__ -U__OS2__ -W3 -wd4996 -Zc:wchar_t-
|
---|
2290 | TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.debug = -RTCsu
|
---|
2291 | TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.release = -O2 -Oy- -GS-
|
---|
2292 | else
|
---|
2293 | TEMPLATE_VBOXW32GUESTR3_TOOL = VCC70
|
---|
2294 | TEMPLATE_VBOXW32GUESTR3_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -MT -U__LINUX__ -U__OS2__ -W3
|
---|
2295 | TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.debug = -GZ
|
---|
2296 | TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.release = -Ogitb2 -Oy-
|
---|
2297 | endif
|
---|
2298 | TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.profile = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.release)
|
---|
2299 | TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.kprofile = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.release)
|
---|
2300 | TEMPLATE_VBOXW32GUESTR3_CFLAGS = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS)
|
---|
2301 | TEMPLATE_VBOXW32GUESTR3_CFLAGS.debug = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.debug)
|
---|
2302 | TEMPLATE_VBOXW32GUESTR3_CFLAGS.release = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.release)
|
---|
2303 | TEMPLATE_VBOXW32GUESTR3_CFLAGS.profile = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.profile)
|
---|
2304 | TEMPLATE_VBOXW32GUESTR3_CFLAGS.kprofile = $(TEMPLATE_VBOXW32GUESTR3_CXXFLAGS.kprofile)
|
---|
2305 | TEMPLATE_VBOXW32GUESTR3_INCS = \
|
---|
2306 | $(VBOX_PATH_SDK)/include
|
---|
2307 | TEMPLATE_VBOXW32GUESTR3_LDFLAGS = \
|
---|
2308 | /NOD /INCREMENTAL:NO /MAPINFO:EXPORTS /LARGEADDRESSAWARE \
|
---|
2309 | /DISALLOWLIB:libc.lib \
|
---|
2310 | /DISALLOWLIB:libcd.lib \
|
---|
2311 | /DISALLOWLIB:msvcrt.lib \
|
---|
2312 | /DISALLOWLIB:libcmtd.lib \
|
---|
2313 | /DISALLOWLIB:msvcrtd.lib
|
---|
2314 | ifdef VBOX_USE_VCC80
|
---|
2315 | TEMPLATE_VBOXW32GUESTR3_LIBS = \
|
---|
2316 | $(PATH_TOOL_VCC80X86_LIB)/oldnames.lib \
|
---|
2317 | $(PATH_TOOL_VCC80X86_LIB)/libcmt.lib \
|
---|
2318 | $(PATH_SDK_W2K3DDKX86_LIB)/ntdll.lib
|
---|
2319 | else
|
---|
2320 | TEMPLATE_VBOXW32GUESTR3_LIBS = \
|
---|
2321 | $(PATH_TOOL_VCC70_LIB)/oldnames.lib \
|
---|
2322 | $(PATH_TOOL_VCC70_LIB)/libcmt.lib \
|
---|
2323 | $(PATH_SDK_W2K3DDKX86_LIB)/ntdll.lib
|
---|
2324 | endif
|
---|
2325 | TEMPLATE_VBOXW32GUESTR3_POST_CMDS = $(VBOX_SIGN_IMAGE_CMDS)
|
---|
2326 |
|
---|
2327 | #
|
---|
2328 | # R3 win32 guest libraries
|
---|
2329 | #
|
---|
2330 | TEMPLATE_VBOXW32GUESTR3LIB = VBox Win32 Guest User Libraries
|
---|
2331 | TEMPLATE_VBOXW32GUESTR3LIB_EXTENDS = VBOXW32GUESTR3
|
---|
2332 | TEMPLATE_VBOXW32GUESTR3LIB_INST = $(INST_ADDITIONS_LIB)
|
---|
2333 |
|
---|
2334 |
|
---|
2335 | #
|
---|
2336 | # Template for building R0 win32 guest tools.
|
---|
2337 | #
|
---|
2338 | TEMPLATE_VBOXW32GUESTR0 = VBox Win32 Guest Driver
|
---|
2339 | TEMPLATE_VBOXW32GUESTR0_INST = $(INST_ADDITIONS)
|
---|
2340 | TEMPLATE_VBOXW32GUESTR0_BLD_TRG = win
|
---|
2341 | TEMPLATE_VBOXW32GUESTR0_BLD_TRG_ARCH = x86
|
---|
2342 | TEMPLATE_VBOXW32GUESTR0_BLD_TRG_CPU = i386
|
---|
2343 | TEMPLATE_VBOXW32GUESTR0_DEFS = _X86_ IN_GUEST IN_GUEST_R0 IN_RING0 IN_RT_R0 __WIN32__ __WIN__ HC_ARCH_BITS=32 GC_ARCH_BITS=32
|
---|
2344 | TEMPLATE_VBOXW32GUESTR0_RCDEFS = \
|
---|
2345 | VBOX_VERSION_MAJOR=\"$(VBOX_VERSION_MAJOR)\" \
|
---|
2346 | VBOX_VERSION_MINOR=\"$(VBOX_VERSION_MINOR)\" \
|
---|
2347 | VBOX_VERSION_BUILD=\"$(VBOX_VERSION_BUILD)\" \
|
---|
2348 | VBOX_VERSION_MAJOR_NR=$(VBOX_VERSION_MAJOR) \
|
---|
2349 | VBOX_VERSION_MINOR_NR=$(VBOX_VERSION_MINOR) \
|
---|
2350 | VBOX_VERSION_BUILD_NR=$(VBOX_VERSION_BUILD)
|
---|
2351 | TEMPLATE_VBOXW32GUESTR0_ASTOOL = YASM
|
---|
2352 | TEMPLATE_VBOXW32GUESTR0_ASFLAGS = -f win32 -DASM_FORMAT_PE -D__YASM__ -w+orphan-labels
|
---|
2353 | TEMPLATE_VBOXW32GUESTR0_SYSSUFF = .sys
|
---|
2354 | ifdef VBOX_USE_VCC80
|
---|
2355 | TEMPLATE_VBOXW32GUESTR0_TOOL = VCC80X86
|
---|
2356 | TEMPLATE_VBOXW32GUESTR0_CXXFLAGS = -Zi -Zl -GR- -GS- -EHs-c- -GF- -Gz -U__LINUX__ -W3 -wd4996 -Zc:wchar_t-
|
---|
2357 | TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.debug = -GR- -EHs-c- -Zl
|
---|
2358 | TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.release = -O2 -Oy-
|
---|
2359 | else
|
---|
2360 | TEMPLATE_VBOXW32GUESTR0_TOOL = VCC70
|
---|
2361 | TEMPLATE_VBOXW32GUESTR0_CXXFLAGS = -Zi -Zl -GR- -GX- -GF- -Gz -U__LINUX__ -W3
|
---|
2362 | TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.debug = -GR- -GX- -Zl
|
---|
2363 | TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.release = -Ogitb2 -Oy-
|
---|
2364 | endif
|
---|
2365 | TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.profile = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.release)
|
---|
2366 | TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.kprofile = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.release)
|
---|
2367 | TEMPLATE_VBOXW32GUESTR0_CFLAGS = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS)
|
---|
2368 | TEMPLATE_VBOXW32GUESTR0_CFLAGS.debug = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.debug)
|
---|
2369 | TEMPLATE_VBOXW32GUESTR0_CFLAGS.release = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.release)
|
---|
2370 | TEMPLATE_VBOXW32GUESTR0_CFLAGS.profile = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.profile)
|
---|
2371 | TEMPLATE_VBOXW32GUESTR0_CFLAGS.kprofile = $(TEMPLATE_VBOXW32GUESTR0_CXXFLAGS.kprofile)
|
---|
2372 | TEMPLATE_VBOXW32GUESTR0_LDFLAGS = \
|
---|
2373 | -Driver -Subsystem:NATIVE -Incremental:NO -Align:32 -MapInfo:Exports -NoD -Machine:X86 -Debug \
|
---|
2374 | /DISALLOWLIB:libcd.lib \
|
---|
2375 | /DISALLOWLIB:msvcrt.lib \
|
---|
2376 | /DISALLOWLIB:msvcrtd.lib \
|
---|
2377 | /DISALLOWLIB:libcmtd.lib
|
---|
2378 | TEMPLATE_VBOXW32GUESTR0_POST_CMDS = $(VBOX_SIGN_DRIVER_CMDS)
|
---|
2379 |
|
---|
2380 | #
|
---|
2381 | # R0 win32 guest libraries
|
---|
2382 | #
|
---|
2383 | TEMPLATE_VBOXW32GUESTR0LIB = VBox Win32 Guest Driver
|
---|
2384 | TEMPLATE_VBOXW32GUESTR0LIB_EXTENDS = VBOXW32GUESTR0
|
---|
2385 | TEMPLATE_VBOXW32GUESTR0LIB_INST = $(INST_ADDITIONS_LIB)
|
---|
2386 |
|
---|
2387 |
|
---|
2388 | #
|
---|
2389 | # Windows rc workaround for crosscompiling.
|
---|
2390 | # (Some (old) Wine versions fails loading msvcrt.dll from the VCC bin directory.)
|
---|
2391 | #
|
---|
2392 | ifneq ($(BUILD_PLATFORM),win)
|
---|
2393 | TOOL_VCC80X86_RC := $(EXEC_X86_WIN32) $(PATH_DEVTOOLS)/win.x86/bin/rc.exe
|
---|
2394 | TOOL_VCC80AMD64_RC := $(EXEC_X86_WIN32) $(PATH_DEVTOOLS)/win.x86/bin/rc.exe
|
---|
2395 | TOOL_VCC70_RC := $(EXEC_X86_WIN32) $(PATH_DEVTOOLS)/win.x86/bin/rc.exe
|
---|
2396 | WIN32_MC = $(EXEC_X86_WIN32) $(PATH_DEVTOOLS)/win.x86/bin/mc.exe
|
---|
2397 | else
|
---|
2398 | WIN32_MC = $(EXEC_X86_WIN32) $(firstword $(wildcard \
|
---|
2399 | $(PATH_SDK_WINPSDK_BIN)/MC.Exe\
|
---|
2400 | $(PATH_SDK_WINPSDK)/Bin/MC.Exe\
|
---|
2401 | $(PATH_SDK_WIN32SDK_BIN)/MC.Exe\
|
---|
2402 | $(PATH_SDK_WIN64SDK_BIN)/MC.Exe\
|
---|
2403 | $(PATH_DEVTOOLS)/win.x86/bin/mc.exe\
|
---|
2404 | ) Sorry_Cannot_find_mc_in_the_PSDK)
|
---|
2405 | endif
|
---|
2406 |
|
---|
2407 |
|
---|
2408 | #
|
---|
2409 | # Template for syntax checking the linux guest additions.
|
---|
2410 | # Not properly realized yet.
|
---|
2411 | #
|
---|
2412 | TEMPLATE_VBOXLNX32GUESTR0 = Template for *syntax checking* linux guest additions kernel modules
|
---|
2413 | TEMPLATE_VBOXLNX32GUESTR0_TOOL = $(VBOX_GCC_TOOL)
|
---|
2414 | TEMPLATE_VBOXLNX32GUESTR0_BLD_TRG = linux
|
---|
2415 | TEMPLATE_VBOXLNX32GUESTR0_DEFS = __KERNEL__ MODULE IN_GUEST IN_GUEST_R0 IN_RING0 IN_RT_R0
|
---|
2416 | TEMPLATE_VBOXLNX32GUESTR0_INCS = $(VBOX_LINUX_INCS)
|
---|
2417 | TEMPLATE_VBOXLNX32GUESTR0_CFLAGS = -nostdinc -iwithprefix include \
|
---|
2418 | -O2 -Wall -Wstrict-prototypes -Wno-trigraphs $(VBOX_GCC_Wno-pointer-sign) \
|
---|
2419 | $(VBOX_GCC_fno-stack-protector) -fno-strict-aliasing -fno-common \
|
---|
2420 | -mpreferred-stack-boundary=2 -msoft-float
|
---|
2421 | TEMPLATE_VBOXLNX32GUESTR0_CXXFLAGS = $(filter-out -Wstrict-prototypes -Wno-pointer-sign,$(TEMPLATE_VBOXLNX32GUESTR0_CFLAGS)) -fno-exceptions -fno-rtti
|
---|
2422 | ifndef VBOX_LINUX_VERSION_2_4
|
---|
2423 | # 2.6
|
---|
2424 | TEMPLATE_VBOXLNX32GUESTR0_SYSSUFF = .ko
|
---|
2425 | TEMPLATE_VBOXLNX32GUESTR0_LDFLAGS = -m elf_i386 -r
|
---|
2426 | else
|
---|
2427 | # 2.4
|
---|
2428 | TEMPLATE_VBOXLNX32GUESTR0_SYSSUFF = .o
|
---|
2429 | TEMPLATE_VBOXLNX32GUESTR0_LDFLAGS = -r -s
|
---|
2430 | endif
|
---|
2431 |
|
---|
2432 |
|
---|
2433 | #
|
---|
2434 | # Templates for building 32-bit linux guest additions.
|
---|
2435 | #
|
---|
2436 |
|
---|
2437 | TEMPLATE_VBOXLNX32GUESTR3EXE = Template for building 32-bit linux guest additions programs.
|
---|
2438 | TEMPLATE_VBOXLNX32GUESTR3EXE_INST = $(INST_ADDITIONS)
|
---|
2439 | TEMPLATE_VBOXLNX32GUESTR3EXE_BLD_TRG = linux
|
---|
2440 | TEMPLATE_VBOXLNX32GUESTR3EXE_BLD_TRG_ARCH = x86
|
---|
2441 | TEMPLATE_VBOXLNX32GUESTR3EXE_BLD_TRG_CPU = i386
|
---|
2442 | TEMPLATE_VBOXLNX32GUESTR3EXE_TOOL = $(VBOX_GCC32_TOOL)
|
---|
2443 | TEMPLATE_VBOXLNX32GUESTR3EXE_ASTOOL = YASM
|
---|
2444 | TEMPLATE_VBOXLNX32GUESTR3EXE_ASFLAGS = -f elf32 -DASM_FORMAT_ELF -D__YASM__ -w+orphan-labels
|
---|
2445 | TEMPLATE_VBOXLNX32GUESTR3EXE_DEFS = IN_GUEST IN_GUEST_R3 IN_RING3 HC_ARCH_BITS=32 GC_ARCH_BITS=32
|
---|
2446 | TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs -pipe $(VBOX_GCC_fno-stack-protector)
|
---|
2447 | TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.release = -O2 -fno-omit-frame-pointer -fno-strict-aliasing
|
---|
2448 | TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.profile = $(TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.release)
|
---|
2449 | TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.kprofile = $(TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.release)
|
---|
2450 | TEMPLATE_VBOXLNX32GUESTR3EXE_CFLAGS.release = $(TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.release)
|
---|
2451 | TEMPLATE_VBOXLNX32GUESTR3EXE_CFLAGS.debug = $(TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.debug)
|
---|
2452 | TEMPLATE_VBOXLNX32GUESTR3EXE_CFLAGS.profile = $(TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.profile)
|
---|
2453 | TEMPLATE_VBOXLNX32GUESTR3EXE_CFLAGS.kprofile = $(TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS.kprofile)
|
---|
2454 | TEMPLATE_VBOXLNX32GUESTR3EXE_CFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs -pipe -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations $(VBOX_GCC_fno-stack-protector)
|
---|
2455 | # No LDFLAGS nor LIBS!
|
---|
2456 |
|
---|
2457 | TEMPLATE_VBOXLNX32GUESTR3EXENOCPP = Template for building 32-bit linux guest additions programs without any C++.
|
---|
2458 | TEMPLATE_VBOXLNX32GUESTR3EXENOCPP_EXTENDS = VBOXLNX32GUESTR3EXE
|
---|
2459 | TEMPLATE_VBOXLNX32GUESTR3EXENOCPP_TOOL := $(subst GXX,GCC,$(VBOX_GCC32_TOOL))
|
---|
2460 | # No LDFLAGS nor LIBS!
|
---|
2461 |
|
---|
2462 | TEMPLATE_VBOXLNX32GUESTR3DLLNOCPP = Template for building 32-bit linux guest additions shared objects without any C++.
|
---|
2463 | TEMPLATE_VBOXLNX32GUESTR3DLLNOCPP_EXTENDS = VBOXLNX32GUESTR3EXE
|
---|
2464 | TEMPLATE_VBOXLNX32GUESTR3DLLNOCPP_TOOL = $(TEMPLATE_VBOXLNX32GUESTR3EXENOCPP_TOOL)
|
---|
2465 | TEMPLATE_VBOXLNX32GUESTR3DLLNOCPP_CFLAGS = -fPIC $(TEMPLATE_VBOXLNX32GUESTR3EXE_CFLAGS)
|
---|
2466 | TEMPLATE_VBOXLNX32GUESTR3DLLNOCPP_CXXFLAGS = -fPIC $(TEMPLATE_VBOXLNX32GUESTR3EXE_CXXFLAGS)
|
---|
2467 | TEMPLATE_VBOXLNX32GUESTR3DLLNOCPP_LDFLAGS = -fPIC
|
---|
2468 |
|
---|
2469 | TEMPLATE_VBOXLNX32GUESTR3LIB = Template for building 32-bit linux guest additions libraries.
|
---|
2470 | TEMPLATE_VBOXLNX32GUESTR3LIB_EXTENDS = VBOXLNX32GUESTR3EXE
|
---|
2471 | TEMPLATE_VBOXLNX32GUESTR3LIB_INST = $(INST_ADDITION_LIB)
|
---|
2472 |
|
---|
2473 |
|
---|
2474 |
|
---|
2475 |
|
---|
2476 | ifdef VBOX_WITH_OS2_ADDITIONS
|
---|
2477 |
|
---|
2478 | #
|
---|
2479 | # Template for building R3 OS/2 guest additions.
|
---|
2480 | #
|
---|
2481 | TEMPLATE_VBOXOS2GUESTR3 = VBox OS/2 Guest Programs and DLLs
|
---|
2482 | TEMPLATE_VBOXOS2GUESTR3_INST = $(INST_ADDITIONS)os2/
|
---|
2483 | TEMPLATE_VBOXOS2GUESTR3_BLD_TRG = os2
|
---|
2484 | TEMPLATE_VBOXOS2GUESTR3_BLD_TRG_ARCH = x86
|
---|
2485 | TEMPLATE_VBOXOS2GUESTR3_BLD_TRG_CPU = blend
|
---|
2486 | TEMPLATE_VBOXOS2GUESTR3_DEFS = IN_GUEST IN_GUEST_R3 IN_RING3 IN_RT_R3 HC_ARCH_BITS=32 GC_ARCH_BITS=32
|
---|
2487 | TEMPLATE_VBOXOS2GUESTR3_ASTOOL = NASM
|
---|
2488 | TEMPLATE_VBOXOS2GUESTR3_ASFLAGS = -f obj -DASM_FORMAT_OMF -D__NASM__ -w+orphan-labels -g
|
---|
2489 | TEMPLATE_VBOXOS2GUESTR3_DLLSUFF = .dll
|
---|
2490 | TEMPLATE_VBOXOS2GUESTR3_EXESUFF = .exe
|
---|
2491 | TEMPLATE_VBOXOS2GUESTR3_LIBSUFF = .lib
|
---|
2492 | TEMPLATE_VBOXOS2GUESTR3_ARLIBSUFF = .lib
|
---|
2493 | TEMPLATE_VBOXOS2GUESTR3_TOOL = GXX3OMF
|
---|
2494 | TEMPLATE_VBOXOS2GUESTR3_CXXFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs -pipe -fno-strict-aliasing -fno-rtti -fno-exceptions
|
---|
2495 | TEMPLATE_VBOXOS2GUESTR3_CFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs -pipe -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -fno-strict-aliasing
|
---|
2496 | ifneq ($(BUILD_TYPE),debug)
|
---|
2497 | TEMPLATE_VBOXOS2GUESTR3_CFLAGS += -O2 -fno-omit-frame-pointer
|
---|
2498 | TEMPLATE_VBOXOS2GUESTR3_CXXFLAGS += -O2 -fno-omit-frame-pointer
|
---|
2499 | endif
|
---|
2500 | TEMPLATE_VBOXOS2GUESTR3_INCS = \
|
---|
2501 | $(VBOX_PATH_SDK)/include
|
---|
2502 |
|
---|
2503 | #
|
---|
2504 | # Template for building OS/2 guest R3 libraries.
|
---|
2505 | #
|
---|
2506 | TEMPLATE_VBOXOS2GUESTR3LIB = VBox OS/2 Guest Usermode Libraries
|
---|
2507 | TEMPLATE_VBOXOS2GUESTR3LIB_EXTENDS = VBOXOS2GUESTR3
|
---|
2508 | TEMPLATE_VBOXOS2GUESTR3LIB_INST = $(INST_ADDITIONS_LIB)os2/
|
---|
2509 |
|
---|
2510 | #
|
---|
2511 | # Template for building OS/2 Guest R0 images.
|
---|
2512 | #
|
---|
2513 | TEMPLATE_VBOXOS2GUESTR0 = VBox OS/2 Guest Driver
|
---|
2514 | TEMPLATE_VBOXOS2GUESTR0_INST = $(INST_ADDITIONS)os2/
|
---|
2515 | TEMPLATE_VBOXOS2GUESTR0_BLD_TRG = os2
|
---|
2516 | TEMPLATE_VBOXOS2GUESTR0_BLD_TRG_ARCH = x86
|
---|
2517 | TEMPLATE_VBOXOS2GUESTR0_BLD_TRG_CPU = blend
|
---|
2518 | TEMPLATE_VBOXOS2GUESTR0_DEFS = IN_RING0 IN_GUEST IN_GUEST_R0 IN_RT_R0 HC_ARCH_BITS=32 GC_ARCH_BITS=32 LOG_TO_BACKDOOR
|
---|
2519 | TEMPLATE_VBOXOS2GUESTR0_SYSSUFF = .sys
|
---|
2520 | TEMPLATE_VBOXOS2GUESTR0_ASTOOL = NASM
|
---|
2521 | TEMPLATE_VBOXOS2GUESTR0_ASFLAGS = -f obj -DASM_FORMAT_OMF -D__NASM__ -w+orphan-labels -g
|
---|
2522 | TEMPLATE_VBOXOS2GUESTR0_TOOL = GXX3OMF
|
---|
2523 | TEMPLATE_VBOXOS2GUESTR0_CXXFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs -pipe -fno-strict-aliasing -fno-rtti -fno-exceptions
|
---|
2524 | TEMPLATE_VBOXOS2GUESTR0_CFLAGS = -g -Wall -pedantic -Wno-long-long -Wno-trigraphs -pipe -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -fno-strict-aliasing
|
---|
2525 | ifneq ($(BUILD_TYPE),debug)
|
---|
2526 | TEMPLATE_VBOXOS2GUESTR0_CFLAGS += -O2 -fno-omit-frame-pointer
|
---|
2527 | TEMPLATE_VBOXOS2GUESTR0_CXXFLAGS += -O2 -fno-omit-frame-pointer
|
---|
2528 | endif
|
---|
2529 | TEMPLATE_VBOXOS2GUESTR0_LIBS = $(VBOX_GCC_LIBGCC) ## @todo this isn't nice.
|
---|
2530 | TEMPLATE_VBOXOS2GUESTR0_LDFLAGS = -Zlinker Option -Zlinker internalrelocs, -Zlinker togglerelocs
|
---|
2531 |
|
---|
2532 | #
|
---|
2533 | # Template for building OS/2 Guest R0 libraries.
|
---|
2534 | #
|
---|
2535 | TEMPLATE_VBOXOS2GUESTR0LIB = VBox OS/2 Guest Driver Library
|
---|
2536 | TEMPLATE_VBOXOS2GUESTR0LIB_EXTENDS = VBOXOS2GUESTR0
|
---|
2537 | TEMPLATE_VBOXOS2GUESTR0LIB_INST = $(INST_ADDITIONS_LIB)os2/
|
---|
2538 |
|
---|
2539 | #
|
---|
2540 | # OS/2 Guest Libraries.
|
---|
2541 | #
|
---|
2542 | VBOX_LIB_IPRT_OS2_GUEST_R0 = $(PATH_LIB)/additions/os2/RuntimeOS2GuestR0.lib
|
---|
2543 | VBOX_LIB_IPRT_OS2_GUEST_R3 = $(PATH_LIB)/additions/os2/RuntimeOS2GuestR3.lib
|
---|
2544 | VBOX_LIB_VBGL_OS2_R3 = $(PATH_LIB)/additions/os2/VBoxGuestR3LibOS2.lib
|
---|
2545 | VBOX_LIB_VBGL_OS2_R0BASE = $(PATH_LIB)/additions/os2/VBoxGuestR0LibBaseOS2.lib
|
---|
2546 | VBOX_LIB_VBGL_OS2_R0 = $(PATH_LIB)/additions/os2/VBoxGuestR0LibOS2.lib
|
---|
2547 |
|
---|
2548 | endif # VBOX_WITH_OS2_ADDITIONS
|
---|
2549 |
|
---|
2550 |
|
---|
2551 | #
|
---|
2552 | # Two targets to coordinate version number changes properly. Note that the
|
---|
2553 | # only way to get a really consistent build is to run 'kmk' in the top-level
|
---|
2554 | # directory. If you don't run it there, you get a consistent sub-tree only.
|
---|
2555 | #
|
---|
2556 | VBOX_VERSION_STAMP = $(PATH_OUT)/version-stamp-$(VBOX_VERSION_STRING)
|
---|
2557 | VBOX_VERSION_HEADER = $(PATH_OUT)/version-generated.h
|
---|
2558 | VBOX_VERSION_MK = $(PATH_OUT)/version-generated.mk
|
---|
2559 |
|
---|
2560 | $(VBOX_VERSION_STAMP): | $(PATH_ROOT)/Config.kmk
|
---|
2561 | $(call MSG_GENERATE,,$@)
|
---|
2562 | $(QUIET)$(MKDIR) -p $(@D)
|
---|
2563 | $(QUIET)$(RM) -f $(filter-out $@,$(wildcard $(PATH_OUT)/version-stamp-*))
|
---|
2564 | $(QUIET)$(ECHO_EXT) > $@
|
---|
2565 |
|
---|
2566 | $(VBOX_VERSION_HEADER): $(VBOX_VERSION_STAMP)
|
---|
2567 | $(call MSG_GENERATE,,$@)
|
---|
2568 | $(QUIET)$(MKDIR) -p $(@D)
|
---|
2569 | $(QUIET)$(RM) -f $@ $@.tmp
|
---|
2570 | $(QUIET)$(APPEND) $@.tmp "#ifndef ___version_generated_h___"
|
---|
2571 | $(QUIET)$(APPEND) $@.tmp "#define ___version_generated_h___"
|
---|
2572 | $(QUIET)$(APPEND) $@.tmp ""
|
---|
2573 | $(QUIET)$(APPEND) $@.tmp "#define VBOX_VERSION_MAJOR $(VBOX_VERSION_MAJOR)"
|
---|
2574 | $(QUIET)$(APPEND) $@.tmp "#define VBOX_VERSION_MINOR $(VBOX_VERSION_MINOR)"
|
---|
2575 | $(QUIET)$(APPEND) $@.tmp "#define VBOX_VERSION_BUILD $(VBOX_VERSION_BUILD)"
|
---|
2576 | $(QUIET)$(APPEND) $@.tmp '#define VBOX_VERSION_STRING "$(VBOX_VERSION_STRING)"'
|
---|
2577 | $(QUIET)$(APPEND) $@.tmp ""
|
---|
2578 | $(QUIET)$(APPEND) $@.tmp "#endif"
|
---|
2579 | $(QUIET)$(MV) -f $@.tmp $@
|
---|
2580 |
|
---|
2581 | #
|
---|
2582 | # Used for external makefiles which cannot include Config.kmk
|
---|
2583 | #
|
---|
2584 | $(VBOX_VERSION_MK): $(VBOX_VERSION_STAMP)
|
---|
2585 | $(call MSG_GENERATE,,$@)
|
---|
2586 | $(QUIET)$(RM) -f $@ $@.tmp
|
---|
2587 | $(QUIET)$(MKDIR) -p $(@D)
|
---|
2588 | $(QUIET)$(APPEND) $@.tmp "VBOX_VERSION_MAJOR = $(VBOX_VERSION_MAJOR)"
|
---|
2589 | $(QUIET)$(APPEND) $@.tmp "VBOX_VERSION_MINOR = $(VBOX_VERSION_MINOR)"
|
---|
2590 | $(QUIET)$(APPEND) $@.tmp "VBOX_VERSION_BUILD = $(VBOX_VERSION_BUILD)"
|
---|
2591 | $(QUIET)$(APPEND) $@.tmp "VBOX_VERSION_STRING = $(VBOX_VERSION_STRING)"
|
---|
2592 | $(QUIET)$(MV) -f $@.tmp $@
|
---|
2593 |
|
---|
2594 | ifndef VBOX_OSE
|
---|
2595 | ifeq ($(filter-out freebsd linux netbsd openbsd solaris,$(BUILD_TARGET)),) # linux only, yea, right.
|
---|
2596 | VBOX_LICENSE_SRC := $(PATH_ROOT)/doc/License.html
|
---|
2597 | VBOX_LICENSE_VER := $(shell grep Version $(VBOX_LICENSE_SRC)|sed -e 's/.*Version \([0-9.]*\),.*/\1/g')
|
---|
2598 | VBOX_LICENSE_BIN := $(PATH_BIN)/License-$(VBOX_LICENSE_VER).html
|
---|
2599 |
|
---|
2600 | $(VBOX_LICENSE_BIN): $(VBOX_LICENSE_SRC)
|
---|
2601 | $(call MSG_GENERATE,,$@)
|
---|
2602 | $(QUIET)$(CP) $< $@
|
---|
2603 | endif
|
---|
2604 | endif
|
---|
2605 |
|
---|
2606 |
|
---|
2607 | # Force building of the version header file as the first thing anywhere in
|
---|
2608 | # the tree. This eliminates the need for manual dependencies on it.
|
---|
2609 | Makefile.kmk: | $(VBOX_VERSION_HEADER) $(VBOX_VERSION_MK)
|
---|
2610 | Makefile: | $(VBOX_VERSION_HEADER) $(VBOX_VERSION_MK)
|
---|
2611 | makefile: | $(VBOX_VERSION_HEADER) $(VBOX_VERSION_MK)
|
---|
2612 |
|
---|
2613 |
|
---|
2614 | #
|
---|
2615 | # Subversion tree revision.
|
---|
2616 | #
|
---|
2617 | # The VBOX_SVN_REV contains our best guess. Use svn info on the
|
---|
2618 | # root of the treeto determin this it if .svn/entries is found,
|
---|
2619 | # otherwise fall back on the Config.kmk revision.
|
---|
2620 | #
|
---|
2621 | SVN ?= svn$(HOSTSUFF_EXE)
|
---|
2622 | VBOX_SVN_REV_KMK = $(PATH_OUT)/revision.kmk
|
---|
2623 | ifndef VBOX_SVN_REV
|
---|
2624 | VBOX_SVN_REV_FALLBACK := $(patsubst %:,, $Rev: 5601 $ )
|
---|
2625 | VBOX_SVN_DEP := $(wildcard $(PATH_ROOT)/.svn/entries)
|
---|
2626 | ifneq ($(USERNAME),bird) # Wastes nearly half a second on windows, very annoying. TODO: $(which ).
|
---|
2627 | ifneq ($(shell $(SVN) --version > /dev/null 2>&1 || echo 'svn not installed'),)
|
---|
2628 | VBOX_SVN_DEP :=
|
---|
2629 | endif
|
---|
2630 | endif
|
---|
2631 |
|
---|
2632 | # Rule for generating a timestamp and updating the real thing on change.
|
---|
2633 | ifneq ($(VBOX_SVN_DEP),)
|
---|
2634 | # fixed in svn - $(VBOX_SVN_REV_KMK).ts +| $(VBOX_SVN_REV_KMK): $(VBOX_SVN_DEP)
|
---|
2635 | $(VBOX_SVN_REV_KMK).ts: $(VBOX_SVN_DEP)
|
---|
2636 | else
|
---|
2637 | # fixed in svn - $(VBOX_SVN_REV_KMK).ts +| $(VBOX_SVN_REV_KMK): $(PATH_ROOT)/Config.kmk
|
---|
2638 | $(VBOX_SVN_REV_KMK).ts: $(PATH_ROOT)/Config.kmk
|
---|
2639 | endif
|
---|
2640 | $(call MSG_GENERATE,,$(VBOX_SVN_REV_KMK))
|
---|
2641 | $(QUIET)$(RM) -f $@
|
---|
2642 | $(QUIET)$(MKDIR) -p $(@D)
|
---|
2643 | ifneq ($(VBOX_SVN_DEP),)
|
---|
2644 | # $(QUIET)$(APPEND) $@ "export VBOX_SVN_REV=$(shell LC_ALL=C $(SVN) info $(PATH_ROOT) | $(SED) -e '/^Last Changed Rev/!d' -e "s/Last Changed Rev\: *//")"
|
---|
2645 | $(QUIET)$(APPEND) $@ "export VBOX_SVN_REV=$(shell LC_ALL=C $(SVN) info $(PATH_ROOT) | $(SED) -e '/^Revision/!d' -e "s/Revision\: *//")"
|
---|
2646 | else
|
---|
2647 | $(QUIET)$(APPEND) $@ "export VBOX_SVN_REV=$(VBOX_SVN_REV_FALLBACK)"
|
---|
2648 | endif
|
---|
2649 | $(QUIET)if test ! -f $(VBOX_SVN_REV_KMK) \
|
---|
2650 | || test ! "`$(CAT_EXT) $@`" = "`$(CAT_EXT) $(VBOX_SVN_REV_KMK)`"; \
|
---|
2651 | then \
|
---|
2652 | $(RM_EXT) -f $(VBOX_SVN_REV_KMK); \
|
---|
2653 | $(CP_EXT) -f $@ $(VBOX_SVN_REV_KMK) || exit 1; \
|
---|
2654 | echo '* $(VBOX_SVN_REV_KMK) was updated:'; \
|
---|
2655 | else \
|
---|
2656 | echo '* $(VBOX_SVN_REV_KMK) was not changed:'; \
|
---|
2657 | fi
|
---|
2658 | $(QUIET)$(CAT_EXT) $(VBOX_SVN_REV_KMK)
|
---|
2659 |
|
---|
2660 | $(VBOX_SVN_REV_KMK): $(VBOX_SVN_REV_KMK).ts # remove when kBuild is updated.
|
---|
2661 |
|
---|
2662 | include $(VBOX_SVN_REV_KMK)
|
---|
2663 | else
|
---|
2664 | # allow to overwrite VBOX_SVN_REV externally (mainly for building .debs/.rpms)
|
---|
2665 | $(VBOX_SVN_REV_KMK):
|
---|
2666 | $(call MSG_GENERATE,,$(VBOX_SVN_REV_KMK))
|
---|
2667 | $(QUIET)$(RM) -f $@
|
---|
2668 | $(QUIET)$(MKDIR) -p $(@D)
|
---|
2669 | $(QUIET)$(APPEND) $@ "export VBOX_SVN_REV=$(VBOX_SVN_REV)"
|
---|
2670 | $(QUIET)echo '* $(VBOX_SVN_REV_KMK) was externally overwritten:'
|
---|
2671 | $(QUIET)$(CAT_EXT) $(VBOX_SVN_REV_KMK)
|
---|
2672 | endif
|
---|
2673 |
|
---|
2674 |
|
---|
2675 | #
|
---|
2676 | # Legacy.
|
---|
2677 | #
|
---|
2678 | ifneq ($(LOCALCFG),)
|
---|
2679 | include $(LOCALCFG)
|
---|
2680 | endif
|
---|
2681 |
|
---|
2682 |
|
---|
2683 | #
|
---|
2684 | # Some extra goals.
|
---|
2685 | #
|
---|
2686 | .PHONY: up update st stat status
|
---|
2687 | up update::
|
---|
2688 | $(SVN) up
|
---|
2689 |
|
---|
2690 | st stat status:
|
---|
2691 | $(SVN) status
|
---|
2692 |
|
---|
2693 | quick:
|
---|
2694 | $(MAKE) VBOX_QUICK=1
|
---|
2695 |
|
---|