1 | # $Id: Makefile.kmk 6778 2008-02-04 10:25:17Z vboxsync $
|
---|
2 |
|
---|
3 | ## @file
|
---|
4 | # Makefile for the VBox Main module.
|
---|
5 | #
|
---|
6 |
|
---|
7 | #
|
---|
8 | # Copyright (C) 2006-2007 innotek GmbH
|
---|
9 | #
|
---|
10 | # This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | # available from http://www.virtualbox.org. This file is free software;
|
---|
12 | # you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | # General Public License (GPL) as published by the Free Software
|
---|
14 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
15 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
16 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | #
|
---|
18 |
|
---|
19 | DEPTH = ../../..
|
---|
20 | include $(PATH_KBUILD)/subheader.kmk
|
---|
21 |
|
---|
22 | # The KMK_OPTS_JOBS is a kmk v0.1.3 feature. Fake it for now.
|
---|
23 | ifndef KMK_OPTS_JOBS
|
---|
24 | KMK_OPTS_JOBS = 1
|
---|
25 | endif
|
---|
26 |
|
---|
27 | # Include sub-makefile(s) first if we're doing parallel building.
|
---|
28 | # This is primarily a hack to try avoid idling all but one cpu when
|
---|
29 | # building the gigant soap sources.
|
---|
30 | ifneq ($(KMK_OPTS_JOBS),1)
|
---|
31 | ifdef VBOX_WITH_WEBSERVICES
|
---|
32 | include $(PATH_SUB_CURRENT)/webservice/Makefile.kmk
|
---|
33 | endif
|
---|
34 | include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
|
---|
35 | endif
|
---|
36 |
|
---|
37 | # targets++
|
---|
38 | LIBRARIES += VBoxCOM
|
---|
39 | DLLS += VBoxSettings VBoxC
|
---|
40 | PROGRAMS += VBoxSVC
|
---|
41 | VBOX_MAIN_DEFS =
|
---|
42 | ifneq ($(BUILD_TARGET),win)
|
---|
43 | ifndef VBOX_WITH_XPCOM
|
---|
44 | $(error "VBox: VBOX_WITH_XPCOM isn't defined")
|
---|
45 | endif
|
---|
46 | DLLS += VBoxSVCM
|
---|
47 | ifneq ($(BUILD_TARGET),os2)
|
---|
48 | VBOX_MAIN_DEFS+= VBOX_WITH_SYS_V_IPC_SESSION_WATCHER
|
---|
49 | endif
|
---|
50 | VBOX_MAIN_DEFS += VBOX_WITH_UNIXY_TAP_NETWORKING
|
---|
51 | endif
|
---|
52 | ifndef VBOX_OSE
|
---|
53 | VBOX_MAIN_DEFS += VBOX_WITH_E1000
|
---|
54 | endif
|
---|
55 | ## @todo eliminate or expand VBOX_MAIN_DEFS.
|
---|
56 |
|
---|
57 | #PROGRAMS += tstCFGLdr
|
---|
58 |
|
---|
59 | ifeq ($(BUILD_TARGET),win)
|
---|
60 | OTHERS += $(PATH_BIN)/comregister.cmd
|
---|
61 | IDLFILE = $(VBOX_PATH_SDK)/idl/VirtualBox.idl
|
---|
62 | OTHER_CLEAN += \
|
---|
63 | $(PATH_BIN)/comregister.cmd \
|
---|
64 | $(VBOX_PATH_SDK)/include/VirtualBox.h \
|
---|
65 | $(IDLFILE) \
|
---|
66 | $(VBOX_PATH_SDK)/lib/VirtualBox.tlb \
|
---|
67 | $(VBOX_PATH_SDK)/lib/VirtualBox_i.c \
|
---|
68 | $(PATH_VBoxCOM)/VirtualBox.h \
|
---|
69 | $(PATH_VBoxCOM)/VirtualBox_i.c \
|
---|
70 | $(PATH_VBoxCOM)/VirtualBox.tlb
|
---|
71 | else
|
---|
72 | INSTALLS += xpcom-components
|
---|
73 | IDLFILE = $(VBOX_PATH_SDK)/idl/VirtualBox_XPCOM.idl
|
---|
74 | ifeq ($(BUILD_TARGET),linux)
|
---|
75 | IDLTYPELIB = $(PATH_BIN)/VirtualBox_XPCOM.xpt
|
---|
76 | else
|
---|
77 | IDLTYPELIB = $(PATH_BIN)/components/VirtualBox_XPCOM.xpt
|
---|
78 | endif
|
---|
79 | IDLHEADER = $(VBOX_PATH_SDK)/include/VirtualBox_XPCOM.h
|
---|
80 | OTHERS += $(IDLTYPELIB)
|
---|
81 | OTHER_CLEAN += \
|
---|
82 | $(IDLFILE) \
|
---|
83 | $(IDLHEADER) \
|
---|
84 | $(IDLTYPELIB)
|
---|
85 |
|
---|
86 | endif
|
---|
87 |
|
---|
88 |
|
---|
89 | #
|
---|
90 | # The Main API documentation
|
---|
91 | #
|
---|
92 | docs: $(PATH_TARGET)/docs.Main
|
---|
93 |
|
---|
94 | $(PATH_TARGET)/docs.Main: \
|
---|
95 | Doxyfile.Main \
|
---|
96 | idl/doxygen.xsl \
|
---|
97 | idl/VirtualBox.xidl \
|
---|
98 | | $(call DIRDEP, $(PATH_TARGET)) \
|
---|
99 | $(call DIRDEP, $(PATH_OUT)/docs/Main)
|
---|
100 | $(RM) -f $(wildcard $(PATH_OUT)/docs/Main/html/*)
|
---|
101 | $(VBOX_XSLTPROC) -o $(PATH_TARGET)/VirtualBox.idl idl/doxygen.xsl idl/VirtualBox.xidl
|
---|
102 | $(REDIRECT) -E 'PATH_OUT=$(PATH_OUT)' -E 'PATH_TARGET=$(PATH_TARGET)' -E 'PATH_CHM=$(subst /,\,$(PATH_BIN)/VirtualBoxAPI.chm)' \
|
---|
103 | -- doxygen Doxyfile.Main
|
---|
104 | -$(EXEC_X86_WIN32) $(VBOX_PATH_HTML_HELP_WORKSHOP)/hhc.exe $(subst /,\\,$(PATH_OUT)/docs/Main/html/index.hhp)
|
---|
105 | $(APPEND) $(PATH_TARGET)/docs.Main
|
---|
106 |
|
---|
107 | $(call DIRDEP, $(PATH_OUT)/docs/Main):
|
---|
108 | $(MKDIR) -p $@
|
---|
109 |
|
---|
110 |
|
---|
111 | #
|
---|
112 | # VBoxSVC executable
|
---|
113 | #
|
---|
114 | VBoxSVC_TEMPLATE = VBOXMAINEXE
|
---|
115 | VBoxSVC_DEFS = VBOX_MAIN_SETTINGS_ADDONS $(VBOX_MAIN_DEFS)
|
---|
116 | ifdef VBOX_WITH_VRDP
|
---|
117 | VBoxSVC_DEFS += VBOX_VRDP
|
---|
118 | endif
|
---|
119 | ifdef VBOX_WITH_HGCM
|
---|
120 | VBoxSVC_DEFS += VBOX_HGCM
|
---|
121 | endif
|
---|
122 | ifdef VBOX_MAIN_RELEASE_LOG
|
---|
123 | VBoxSVC_DEFS += VBOX_MAIN_RELEASE_LOG LOG_ENABLED
|
---|
124 | endif
|
---|
125 | ifdef VBOX_WITH_USB
|
---|
126 | VBoxSVC_DEFS += VBOX_WITH_USB
|
---|
127 | ifdef VBOX_WITH_EHCI
|
---|
128 | VBoxSVC_DEFS += VBOX_WITH_EHCI
|
---|
129 | endif
|
---|
130 | endif
|
---|
131 | ifdef VBOX_WITH_ALSA
|
---|
132 | VBoxSVC_DEFS += VBOX_WITH_ALSA
|
---|
133 | endif
|
---|
134 | ifdef VBOX_WITH_PULSE
|
---|
135 | VBoxSVC_DEFS += VBOX_WITH_PULSE
|
---|
136 | endif
|
---|
137 | ifdef VBOX_WITH_WINMM
|
---|
138 | VBoxSVC_DEFS += VBOX_WITH_WINMM
|
---|
139 | endif
|
---|
140 | ifdef VBOX_WITHOUT_LINUX_COMPILER_H
|
---|
141 | VBoxSVC_DEFS += VBOX_WITHOUT_LINUX_COMPILER_H
|
---|
142 | endif
|
---|
143 |
|
---|
144 | VBoxSVC_DEFS.win += VBOX_COM_OUTOFPROC_MODULE
|
---|
145 | VBoxSVC_DEFS.win.x86 += _WIN32_WINNT=0x0500
|
---|
146 | VBoxSVC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
|
---|
147 | VBoxSVC_DEFS.linux += VBOX_USE_LIBHAL
|
---|
148 | VBoxSVC_DEFS.solaris += VBOX_USE_LIBHAL
|
---|
149 |
|
---|
150 | VBoxSVC_INCS = \
|
---|
151 | include \
|
---|
152 | $(PATH_VBoxSVC) \
|
---|
153 | $(PATH_CURRENT)
|
---|
154 | VBoxSVC_INCS.win = \
|
---|
155 | $(PATH_VBoxCOM)
|
---|
156 | ifdef VBOX_WITH_USB
|
---|
157 | VBoxSVC_INCS.os2 = \
|
---|
158 | $(PATH_ROOT)/src/VBox/HostDrivers/VBoxUSB/os2
|
---|
159 | endif
|
---|
160 |
|
---|
161 | VBoxSVC_LIBS += \
|
---|
162 | $(LIB_DDU) \
|
---|
163 | $(LIB_SETTINGS)
|
---|
164 | VBoxSVC_LIBS.darwin = \
|
---|
165 | $(LIB_VMM) \
|
---|
166 | $(LIB_REM)
|
---|
167 | VBoxSVC_LIBS.solaris = \
|
---|
168 | adm
|
---|
169 |
|
---|
170 | VBoxSVC_SOURCES = \
|
---|
171 | Logging.cpp \
|
---|
172 | Matching.cpp \
|
---|
173 | USBDeviceFilterImpl.cpp \
|
---|
174 | USBProxyService.cpp \
|
---|
175 | VirtualBoxBase.cpp \
|
---|
176 | VirtualBoxErrorInfoImpl.cpp \
|
---|
177 | VirtualBoxImpl.cpp \
|
---|
178 | VirtualBoxImplExtra.cpp \
|
---|
179 | MachineImpl.cpp \
|
---|
180 | SnapshotImpl.cpp \
|
---|
181 | HardDiskImpl.cpp \
|
---|
182 | HardDiskAttachmentImpl.cpp \
|
---|
183 | ProgressImpl.cpp \
|
---|
184 | DVDDriveImpl.cpp \
|
---|
185 | DVDImageImpl.cpp \
|
---|
186 | FloppyDriveImpl.cpp \
|
---|
187 | FloppyImageImpl.cpp \
|
---|
188 | HostImpl.cpp \
|
---|
189 | HostDVDDriveImpl.cpp \
|
---|
190 | HostFloppyDriveImpl.cpp \
|
---|
191 | HostUSBDeviceImpl.cpp \
|
---|
192 | GuestOSTypeImpl.cpp \
|
---|
193 | NetworkAdapterImpl.cpp \
|
---|
194 | SerialPortImpl.cpp \
|
---|
195 | ParallelPortImpl.cpp \
|
---|
196 | USBControllerImpl.cpp \
|
---|
197 | AudioAdapterImpl.cpp \
|
---|
198 | SharedFolderImpl.cpp \
|
---|
199 | SystemPropertiesImpl.cpp \
|
---|
200 | BIOSSettingsImpl.cpp
|
---|
201 |
|
---|
202 | ifdef VBOX_WITH_VRDP
|
---|
203 | VBoxSVC_SOURCES += VRDPServerImpl.cpp
|
---|
204 | endif
|
---|
205 |
|
---|
206 | VBoxSVC_SOURCES.darwin = \
|
---|
207 | darwin/iokit.cpp
|
---|
208 |
|
---|
209 | VBoxSVC_SOURCES.win = \
|
---|
210 | HostNetworkInterfaceImpl.cpp \
|
---|
211 | win32/svcmain.cpp \
|
---|
212 | win32/svchlp.cpp \
|
---|
213 | win32/VBoxSVC.rc
|
---|
214 |
|
---|
215 | VBoxSVC_SOURCES.linux = \
|
---|
216 | linux/vbox-libhal.cpp
|
---|
217 |
|
---|
218 | VBoxSVC_SOURCES.solaris = \
|
---|
219 | linux/vbox-libhal.cpp
|
---|
220 |
|
---|
221 | ifdef VBOX_WITH_XPCOM
|
---|
222 | VBoxSVC_SOURCES += \
|
---|
223 | linux/server.cpp
|
---|
224 | endif
|
---|
225 |
|
---|
226 | ifdef VBOX_WITH_USB
|
---|
227 | VBoxSVC_SOURCES.darwin += darwin/USBProxyServiceDarwin.cpp
|
---|
228 | VBoxSVC_SOURCES.linux += linux/USBProxyServiceLinux.cpp
|
---|
229 | VBoxSVC_SOURCES.os2 += os2/USBProxyServiceOs2.cpp
|
---|
230 | VBoxSVC_SOURCES.win += win32/USBProxyServiceWin32.cpp
|
---|
231 | endif
|
---|
232 |
|
---|
233 | VBoxSVC_LDFLAGS.darwin = -framework IOKit
|
---|
234 | ifeq ($(BUILD_TYPE),debug)
|
---|
235 | VBoxSVC_LDFLAGS.linux += -rdynamic # for backtrace_symbols()
|
---|
236 | endif
|
---|
237 |
|
---|
238 | ## Alternative USB filtering.
|
---|
239 | #ifeq ($(filter-out darwin,$(BUILD_TARGET)),)
|
---|
240 | #VBoxSVC_DEFS += VBOX_WITH_USBFILTER
|
---|
241 | #VBoxSVC_LIBS += $(PATH_LIB)/USBLib$(VBOX_SUFF_LIB)
|
---|
242 | #endif
|
---|
243 |
|
---|
244 | win32/VBoxSVC.rc_DEPS = $(PATH_TARGET)/VBoxSVC.rgs
|
---|
245 |
|
---|
246 |
|
---|
247 | #
|
---|
248 | # VBoxSVC wrapper module
|
---|
249 | #
|
---|
250 | ifdef VBOX_WITH_XPCOM
|
---|
251 |
|
---|
252 | VBoxSVCM_TEMPLATE = VBOXMAINDLL
|
---|
253 | ifneq ($(BUILD_TARGET),linux)
|
---|
254 | VBoxSVCM_INST = $(INST_BIN)components/
|
---|
255 | endif
|
---|
256 | VBoxSVCM_DEFS = IN_RING3 $(VBOX_MAIN_DEFS)
|
---|
257 | VBoxSVCM_INCS = \
|
---|
258 | include \
|
---|
259 | $(PATH_VBoxC) \
|
---|
260 | $(PATH_CURRENT)
|
---|
261 | VBoxSVCM_SOURCES = \
|
---|
262 | linux/server_module.cpp
|
---|
263 | VBoxSVCM_LDFLAGS.darwin = \
|
---|
264 | -install_name @executable_path/components/VBoxSVCM.dylib \
|
---|
265 | -exported_symbols_list $(PATH_TARGET)/VBoxSVCM.def
|
---|
266 | ifeq ($(BUILD_TARGET),darwin)
|
---|
267 | VBoxSVCM_ORDERDEPS += $(PATH_TARGET)/VBoxSVCM.def
|
---|
268 | VBoxSVCM_CLEAN += $(PATH_TARGET)/VBoxSVCM.def
|
---|
269 | $(PATH_TARGET)/VBoxSVCM.def:
|
---|
270 | $(RM) -f $@
|
---|
271 | $(APPEND) $@ _NSGetModule
|
---|
272 | endif
|
---|
273 |
|
---|
274 | endif # VBOX_WITH_XPCOM
|
---|
275 |
|
---|
276 |
|
---|
277 | #
|
---|
278 | # VBoxC module
|
---|
279 | #
|
---|
280 | VBoxC_TEMPLATE = VBOXMAINDLL
|
---|
281 | ifneq ($(filter-out linux win,$(BUILD_TARGET)),)
|
---|
282 | VBoxC_INST = $(INST_BIN)components/
|
---|
283 | endif
|
---|
284 |
|
---|
285 | VBoxC_DEFS = IN_RING3 $(VBOX_MAIN_DEFS)
|
---|
286 | VBoxC_DEFS += VBOX_COM_INPROC
|
---|
287 |
|
---|
288 | ifdef VBOX_WITH_VRDP
|
---|
289 | VBoxC_DEFS += VBOX_VRDP
|
---|
290 | endif
|
---|
291 | ifdef VBOX_WITH_HGCM
|
---|
292 | VBoxC_DEFS += VBOX_HGCM
|
---|
293 | endif
|
---|
294 | ifdef VBOX_MAIN_RELEASE_LOG
|
---|
295 | VBoxC_DEFS += VBOX_MAIN_RELEASE_LOG LOG_ENABLED
|
---|
296 | endif
|
---|
297 | ifdef VBOX_WITH_USB
|
---|
298 | VBoxC_DEFS += VBOX_WITH_USB
|
---|
299 | ifdef VBOX_WITH_EHCI
|
---|
300 | VBoxC_DEFS += VBOX_WITH_EHCI
|
---|
301 | endif
|
---|
302 | endif
|
---|
303 | ifdef VBOX_WITH_ALSA
|
---|
304 | VBoxC_DEFS += VBOX_WITH_ALSA
|
---|
305 | endif
|
---|
306 | ifdef VBOX_WITH_PULSE
|
---|
307 | VBoxC_DEFS += VBOX_WITH_PULSE
|
---|
308 | endif
|
---|
309 | ifdef VBOX_WITH_WINMM
|
---|
310 | VBoxC_DEFS += VBOX_WITH_WINMM
|
---|
311 | endif
|
---|
312 | ifdef VBOX_WITH_CROSSBOW
|
---|
313 | VBoxC_DEFS += VBOX_WITH_CROSSBOW
|
---|
314 | endif
|
---|
315 |
|
---|
316 | VBoxC_DEFS.win.x86 += _WIN32_WINNT=0x0500
|
---|
317 | VBoxC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
|
---|
318 |
|
---|
319 | VBoxC_INCS = \
|
---|
320 | include \
|
---|
321 | $(PATH_VBoxC)
|
---|
322 | VBoxC_INCS.win = \
|
---|
323 | $(PATH_VBoxCOM) \
|
---|
324 | $(PATH_SUB_CURRENT)
|
---|
325 |
|
---|
326 | VBoxC_LDFLAGS.darwin = \
|
---|
327 | -install_name @executable_path/components/VBoxSVCM.dylib \
|
---|
328 | -exported_symbols_list $(PATH_TARGET)/VBoxC.def
|
---|
329 | ifdef VBOX_USE_VCC80
|
---|
330 | VBoxC_LDFLAGS.win = /MANIFEST
|
---|
331 | endif
|
---|
332 |
|
---|
333 | VBoxC_LIBS += \
|
---|
334 | $(LIB_VMM) \
|
---|
335 | $(LIB_REM)
|
---|
336 |
|
---|
337 | VBoxC_SOURCES = \
|
---|
338 | Logging.cpp \
|
---|
339 | VBoxDll.cpp \
|
---|
340 | Version.cpp \
|
---|
341 | USBDeviceImpl.cpp \
|
---|
342 | RemoteUSBDeviceImpl.cpp \
|
---|
343 | VirtualBoxBase.cpp \
|
---|
344 | VirtualBoxErrorInfoImpl.cpp \
|
---|
345 | ProgressImpl.cpp \
|
---|
346 | SharedFolderImpl.cpp \
|
---|
347 | SessionImpl.cpp \
|
---|
348 | ConsoleImpl.cpp \
|
---|
349 | ConsoleImpl2.cpp \
|
---|
350 | ConsoleVRDPServer.cpp \
|
---|
351 | GuestImpl.cpp \
|
---|
352 | KeyboardImpl.cpp \
|
---|
353 | MouseImpl.cpp \
|
---|
354 | DisplayImpl.cpp \
|
---|
355 | FramebufferImpl.cpp \
|
---|
356 | MachineDebuggerImpl.cpp \
|
---|
357 | VBoxDriversRegister.cpp \
|
---|
358 | AudioSnifferInterface.cpp \
|
---|
359 | VMMDevInterface.cpp
|
---|
360 | VBoxC_SOURCES.win = \
|
---|
361 | win32/dllmain.cpp \
|
---|
362 | win32/VBoxC.def \
|
---|
363 | win32/VBoxC.rc
|
---|
364 | ifdef VBOX_WITH_XPCOM
|
---|
365 | VBoxC_SOURCES += \
|
---|
366 | linux/module.cpp
|
---|
367 | endif
|
---|
368 |
|
---|
369 | ifdef VBOX_WITH_HGCM
|
---|
370 | VBoxC_SOURCES += \
|
---|
371 | hgcm/HGCMObjects.cpp \
|
---|
372 | hgcm/HGCMThread.cpp \
|
---|
373 | hgcm/HGCM.cpp
|
---|
374 | endif
|
---|
375 |
|
---|
376 | ifdef VBOX_WITH_USB
|
---|
377 | VBoxC_SOURCES += \
|
---|
378 | RemoteUSBBackend.cpp
|
---|
379 | endif
|
---|
380 |
|
---|
381 | ifeq ($(BUILD_TARGET),darwin)
|
---|
382 | VBoxC_ORDERDEPS += $(PATH_TARGET)/VBoxC.def
|
---|
383 | VBoxC_CLEAN += $(PATH_TARGET)/VBoxC.def
|
---|
384 | $(PATH_TARGET)/VBoxC.def: $(MAKEFILE_CURRENT)
|
---|
385 | $(RM) -f $@
|
---|
386 | $(APPEND) $@ _NSGetModule
|
---|
387 | $(APPEND) $@ _VBoxDriversRegister
|
---|
388 | endif
|
---|
389 |
|
---|
390 | # Version.cpp uses VBOX_SVN_REV.
|
---|
391 | Version.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
|
---|
392 | Version.cpp_DEPS = $(VBOX_SVN_REV_KMK)
|
---|
393 |
|
---|
394 | ConsoleImpl.cpp_DEFS = VBOX_BUILD_TARGET=\"$(BUILD_TARGET).$(BUILD_TARGET_ARCH)\"
|
---|
395 |
|
---|
396 | win32/VBoxC.rc_DEPS = $(PATH_TARGET)/VBoxC.rgs
|
---|
397 |
|
---|
398 |
|
---|
399 | #
|
---|
400 | # VBoxSettings
|
---|
401 | #
|
---|
402 | VBoxSettings_TEMPLATE = VBOXMAINDLL
|
---|
403 | VBoxSettings_NAME = $(basename $(notdir $(LIB_SETTINGS)))
|
---|
404 | VBoxSettings_SDKS = VBOX_LIBXML2 VBOX_ZLIB
|
---|
405 | VBoxSettings_DEFS = IN_VBOXSETTINGS_R3
|
---|
406 | VBoxSettings_INCS = \
|
---|
407 | include \
|
---|
408 | $(PATH_TARGET)
|
---|
409 | VBoxSettings_SOURCES = \
|
---|
410 | xml/Settings.cpp
|
---|
411 | VBoxSettings_LDFLAGS.darwin = -install_name @executable_path/$(notdir $(LIB_SETTINGS)) -Wl,-x # no debug info please.
|
---|
412 |
|
---|
413 |
|
---|
414 | #
|
---|
415 | # VBoxCOM - COM Abstraction Layer library
|
---|
416 | #
|
---|
417 | VBoxCOM_TEMPLATE = VBOXMAINLIB
|
---|
418 | VBoxCOM_SOURCES = \
|
---|
419 | glue/com.cpp \
|
---|
420 | glue/initterm.cpp \
|
---|
421 | glue/string.cpp \
|
---|
422 | glue/EventQueue.cpp \
|
---|
423 | glue/ErrorInfo.cpp
|
---|
424 | ifeq ($(BUILD_TARGET),win)
|
---|
425 | VBoxCOM_DEFS.x86 += _WIN32_WINNT=0x0500
|
---|
426 | VBoxCOM_DEFS.amd64 += _WIN32_WINNT=0x0510
|
---|
427 | VBoxCOM_SOURCES += \
|
---|
428 | $(PATH_VBoxCOM)/VirtualBox_i.c
|
---|
429 | else
|
---|
430 | VBoxCOM_INCS += \
|
---|
431 | include
|
---|
432 | VBoxCOM_SOURCES += \
|
---|
433 | linux/helpers.cpp
|
---|
434 | endif
|
---|
435 |
|
---|
436 |
|
---|
437 | #
|
---|
438 | # Generate _DEPS on all sources which depends on generated headers.
|
---|
439 | #
|
---|
440 | ifeq ($(BUILD_TARGET),win)
|
---|
441 | PREREQS = $(PATH_VBoxCOM)/VirtualBox_i.c
|
---|
442 | else
|
---|
443 | PREREQS = $(IDLTYPELIB) $(IDLHEADER)
|
---|
444 | endif
|
---|
445 |
|
---|
446 | # brute force way to ensure the prereqs are generated before anything is compiled.
|
---|
447 | define def_src_deps
|
---|
448 | $(src)_ORDERDEPS += $(PREREQS)
|
---|
449 | endef
|
---|
450 | $(foreach src,\
|
---|
451 | $(VBoxC_SOURCES) $(VBoxC_SOURCES.$(BUILD_TARGET)) \
|
---|
452 | $(VBoxSVC_SOURCES) $(VBoxSVC_SOURCES.$(BUILD_TARGET)) \
|
---|
453 | $(VBoxCOM_SOURCES) \
|
---|
454 | ,$(eval $(value def_src_deps)))
|
---|
455 |
|
---|
456 |
|
---|
457 | #
|
---|
458 | # Embed XML Schema files to VBoxSVC
|
---|
459 | #
|
---|
460 |
|
---|
461 | VBOX_XML_SCHEMA_H = $(PATH_TARGET)/xml_VirtualBox_settings_xsd.h
|
---|
462 | VBOX_XML_SCHEMA_COMMON_H = $(PATH_TARGET)/xml_VirtualBox_settings_common_xsd.h
|
---|
463 | VBOX_XML_CONVERTER_TEMPLATE_H = $(PATH_TARGET)/xml_SettingsConverter_xsl.h
|
---|
464 |
|
---|
465 | VBOX_XML_SCHEMA_COMMON = xml/VirtualBox-settings-common.xsd
|
---|
466 | VBOX_XML_SCHEMA.darwin = xml/VirtualBox-settings-macosx.xsd
|
---|
467 | VBOX_XML_SCHEMA.linux = xml/VirtualBox-settings-linux.xsd
|
---|
468 | VBOX_XML_SCHEMA.freebsd = xml/VirtualBox-settings-freebsd.xsd
|
---|
469 | VBOX_XML_SCHEMA.win = xml/VirtualBox-settings-windows.xsd
|
---|
470 | VBOX_XML_SCHEMA.os2 = xml/VirtualBox-settings-os2.xsd
|
---|
471 | VBOX_XML_SCHEMA.solaris = xml/VirtualBox-settings-solaris.xsd
|
---|
472 |
|
---|
473 | VBOX_XML_CONVERTER_TEMPLATE = xml/SettingsConverter.xsl
|
---|
474 |
|
---|
475 | VirtualBoxImplExtra.cpp_DEPS = \
|
---|
476 | $(VBOX_XML_SCHEMA_H) $(VBOX_XML_SCHEMA_COMMON_H) $(VBOX_XML_CONVERTER_TEMPLATE_H)
|
---|
477 |
|
---|
478 | $(VBOX_XML_SCHEMA_H): $(VBOX_XML_SCHEMA.$(BUILD_TARGET)) $(VBOX_BIN2C)
|
---|
479 | $(call MSG_TOOL,bin2c,VBoxSVC,$<,$@)
|
---|
480 | $(QUIET)$(VBOX_BIN2C) _xml_VirtualBox_settings_xsd $< $@
|
---|
481 |
|
---|
482 | $(VBOX_XML_SCHEMA_COMMON_H): $(VBOX_XML_SCHEMA_COMMON) $(VBOX_BIN2C)
|
---|
483 | $(call MSG_TOOL,bin2c,VBoxSVC,$<,$@)
|
---|
484 | $(QUIET)$(VBOX_BIN2C) _xml_VirtualBox_settings_common_xsd $< $@
|
---|
485 |
|
---|
486 | $(VBOX_XML_CONVERTER_TEMPLATE_H): $(VBOX_XML_CONVERTER_TEMPLATE) $(VBOX_BIN2C)
|
---|
487 | $(call MSG_TOOL,bin2c,VBoxSVC,$<,$@)
|
---|
488 | $(QUIET)$(VBOX_BIN2C) _xml_SettingsConverter_xsl $< $@
|
---|
489 |
|
---|
490 | OTHER_CLEAN += \
|
---|
491 | $(VBOX_XML_SCHEMA_H) $(VBOX_XML_SCHEMA_COMMON_H) $(VBOX_XML_CONVERTER_TEMPLATE_H)
|
---|
492 |
|
---|
493 |
|
---|
494 | #
|
---|
495 | # Generate SchemaDefs.h from XML Schema
|
---|
496 | #
|
---|
497 | VBOX_XML_SCHEMADEFS_H = $(PATH_TARGET)/SchemaDefs.h
|
---|
498 | VBOX_XML_SCHEMADEFS_XSL = xml/SchemaDefs.xsl
|
---|
499 |
|
---|
500 | VBoxC_DEPS += $(VBOX_XML_SCHEMADEFS_H)
|
---|
501 | VBoxC_INCS += $(PATH_TARGET)
|
---|
502 | VBoxSVC_DEPS += $(VBOX_XML_SCHEMADEFS_H)
|
---|
503 | VBoxSVC_INCS += $(PATH_TARGET)
|
---|
504 |
|
---|
505 | $(VBOX_XML_SCHEMADEFS_H): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(BUILD_TARGET)) $(VBOX_XML_SCHEMA_COMMON)
|
---|
506 | $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
|
---|
507 | $(QUIET)$(VBOX_XSLTPROC) -o $@ $(filter-out $(VBOX_XML_SCHEMA_COMMON),$^)
|
---|
508 |
|
---|
509 | OTHER_CLEAN += $(VBOX_XML_SCHEMADEFS_H)
|
---|
510 | .NOTPARALLEL: $(VBOX_XML_SCHEMADEFS_H)
|
---|
511 |
|
---|
512 |
|
---|
513 | #
|
---|
514 | # Creates the symlinks necessary for making XPCOM work.
|
---|
515 | #
|
---|
516 | ## @todo Figure out why Linux really needs this, darwin doesn't...
|
---|
517 |
|
---|
518 | xpcom-components_INST = $(INST_BIN)components/
|
---|
519 | ifeq ($(BUILD_TARGET),linux)
|
---|
520 | xpcom-components_SYMLINKS = \
|
---|
521 | VirtualBox_XPCOM.xpt=>../VirtualBox_XPCOM.xpt \
|
---|
522 | VBoxXPCOMBase.xpt=>../VBoxXPCOMBase.xpt \
|
---|
523 | VBoxC$(SUFF_DLL)=>../VBoxC$(SUFF_DLL) \
|
---|
524 | VBoxSVCM$(SUFF_DLL)=>../VBoxSVCM$(SUFF_DLL) \
|
---|
525 | VBoxXPCOMIPCC$(SUFF_DLL)=>../VBoxXPCOMIPCC$(SUFF_DLL)
|
---|
526 | endif
|
---|
527 |
|
---|
528 |
|
---|
529 | #
|
---|
530 | # Include sub-makefile(s) last if we're not doing parallel building.
|
---|
531 | #
|
---|
532 | # We do this here so that the webservices ends up last in the target
|
---|
533 | # lists. For 100% correctness we must do this after all the main
|
---|
534 | # targets has been fully fleshed out as subheader/footer.kmk will
|
---|
535 | # process new targets.
|
---|
536 | #
|
---|
537 | ifeq ($(KMK_OPTS_JOBS),1)
|
---|
538 | ifdef VBOX_WITH_WEBSERVICES
|
---|
539 | include $(PATH_SUB_CURRENT)/webservice/Makefile.kmk
|
---|
540 | endif
|
---|
541 | include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
|
---|
542 | endif
|
---|
543 |
|
---|
544 | # generate rules
|
---|
545 | include $(PATH_KBUILD)/subfooter.kmk
|
---|
546 |
|
---|
547 |
|
---|
548 | #
|
---|
549 | # Additions rules.
|
---|
550 | #
|
---|
551 |
|
---|
552 | XIDLFILE = idl/VirtualBox.xidl
|
---|
553 |
|
---|
554 | ifneq ($(BUILD_TARGET),win)
|
---|
555 |
|
---|
556 | linux/helpers.cpp: $(IDLTYPELIB)
|
---|
557 |
|
---|
558 | $(IDLFILE): idl/xpidl.xsl $(XIDLFILE) | $(call DIRDEP,$(dir $(IDLFILE)))
|
---|
559 | $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
|
---|
560 | $(QUIET)$(MKDIR) -p $(@D)
|
---|
561 | $(QUIET)$(VBOX_XSLTPROC) -o $@ $^
|
---|
562 |
|
---|
563 | $(IDLTYPELIB): $(IDLFILE) | $(call DIRDEP,$(dir $(IDLTYPELIB)))
|
---|
564 | $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
|
---|
565 | $(QUIET)$(VBOX_XPIDL) -m typelib -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
|
---|
566 |
|
---|
567 | $(IDLHEADER): $(IDLFILE) | $(call DIRDEP,$(dir $(IDLHEADER)))
|
---|
568 | $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
|
---|
569 | $(QUIET)$(VBOX_XPIDL) -m header -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
|
---|
570 |
|
---|
571 | else
|
---|
572 |
|
---|
573 | MAIN_IDL ?= $(EXEC_X86_WIN32) $(firstword $(wildcard \
|
---|
574 | $(PATH_SDK_WINPSDK_BIN)/Midl.Exe\
|
---|
575 | $(PATH_SDK_WINPSDK)/Bin/Midl.Exe\
|
---|
576 | $(PATH_DEVTOOLS)/win.x86/bin/midl.exe\
|
---|
577 | ) Sorry_Cannot_Find_The_Midl_Compiler_In_The_PSDK)
|
---|
578 | IDL_DEFS = /nologo
|
---|
579 | ifdef VBOX_WITH_VRDP
|
---|
580 | IDL_DEFS += /D VBOX_VRDP
|
---|
581 | endif
|
---|
582 |
|
---|
583 | $(IDLFILE): idl/midl.xsl $(XIDLFILE)
|
---|
584 | $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
|
---|
585 | $(QUIET)$(MKDIR) -p $(VBOX_PATH_SDK)/idl
|
---|
586 | $(QUIET)$(VBOX_XSLTPROC) -o $@ $^
|
---|
587 |
|
---|
588 | $(PATH_TARGET)/VBoxSVC.rgs: win32/VirtualBox_rgs.xsl $(XIDLFILE)
|
---|
589 | $(VBOX_XSLTPROC) --stringparam Module VBoxSVC -o $@ $^
|
---|
590 |
|
---|
591 | $(PATH_TARGET)/VBoxC.rgs: win32/VirtualBox_rgs.xsl $(XIDLFILE)
|
---|
592 | $(VBOX_XSLTPROC) --stringparam Module VBoxC -o $@ $^
|
---|
593 |
|
---|
594 | ## @todo r=bird: last changes to this rule showed incorrect dependencies here as it broke testcase (see testboxwin2).
|
---|
595 | # This is kind of obvious when looking at the rule, because it's (a) not specifing all it output
|
---|
596 | # and (b) generating more stuff *after* the maintarget has been completed.
|
---|
597 | #
|
---|
598 | # What needs to be done is to not depend on _i.c in the object subdir, but on all the final outputs.
|
---|
599 | $(PATH_VBoxCOM)/VirtualBox_i.c \
|
---|
600 | + $(VBOX_PATH_SDK)/lib/VirtualBox_i.c \
|
---|
601 | + $(PATH_VBoxCOM)/VirtualBox.h \
|
---|
602 | + $(VBOX_PATH_SDK)/include/VirtualBox.h \
|
---|
603 | + $(PATH_VBoxCOM)/VirtualBox.tlb \
|
---|
604 | + $(VBOX_PATH_SDK)/lib/VirtualBox.tlb: $(IDLFILE) | $(call DIRDEP,$(PATH_VBoxCOM))
|
---|
605 | $(MAIN_IDL) $(IDL_DEFS) \
|
---|
606 | /out $(subst /,\\,$(PATH_VBoxCOM)) \
|
---|
607 | /cpp_cmd $(subst /,\\,$(TOOL_$(VBOX_VCC_TOOL)_CC)) \
|
---|
608 | /I $(subst /,\\,$(PATH_SDK_WINPSDK_INC)) \
|
---|
609 | /I idl \
|
---|
610 | $(subst /,\\,$<)
|
---|
611 | $(MKDIR) -p $(VBOX_PATH_SDK)/include
|
---|
612 | $(CP) $(PATH_VBoxCOM)/VirtualBox.h $(VBOX_PATH_SDK)/include
|
---|
613 | $(MKDIR) -p $(VBOX_PATH_SDK)/lib
|
---|
614 | $(CP) $(PATH_VBoxCOM)/VirtualBox.tlb $(VBOX_PATH_SDK)/lib
|
---|
615 | $(CP) $(PATH_VBoxCOM)/VirtualBox_i.c $(VBOX_PATH_SDK)/lib
|
---|
616 |
|
---|
617 | endif
|
---|
618 |
|
---|
619 | # bird: anyone still using this? If not it's a gonner.
|
---|
620 | ## Hack to work around wine's trouble with midl.exe and rc.exe (seems to be msvcrt.dll related)
|
---|
621 | #gen: $(PREREQS)
|
---|
622 |
|
---|
623 |
|
---|
624 | #
|
---|
625 | # Translation stuff
|
---|
626 | #
|
---|
627 | VBoxSVC_HEADERS = \
|
---|
628 | include/collection.h \
|
---|
629 | include/MachineImpl.h \
|
---|
630 | include/HostDVDDriveImpl.h \
|
---|
631 | include/HostFloppyDriveImpl.h
|
---|
632 |
|
---|
633 | VBoxC_HEADERS = \
|
---|
634 | include/ConsoleImpl.h
|
---|
635 |
|
---|
636 | VBoxSVC_TRANSLATIONS = \
|
---|
637 | nls/VBoxSVC_de.ts
|
---|
638 |
|
---|
639 | VBoxC_TRANSLATIONS = \
|
---|
640 | nls/VBoxC_de.ts
|
---|
641 |
|
---|
642 | updatenls:
|
---|
643 | $(VBOX_LUPDATE) $(VBoxSVC_SOURCES) $(VBoxSVC_HEADERS) -ts $(VBoxSVC_TRANSLATIONS)
|
---|
644 | $(VBOX_LUPDATE) $(VBoxC_SOURCES) $(VBoxC_HEADERS) -ts $(VBoxC_TRANSLATIONS)
|
---|
645 |
|
---|
646 | ifdef VBOX_WITH_XPCOM
|
---|
647 |
|
---|
648 | testidl: $(IDLFILE) $(IDLTYPELIB)
|
---|
649 | testidlhdr: $(IDLHEADER)
|
---|
650 |
|
---|
651 | else
|
---|
652 |
|
---|
653 | testidl: $(IDLFILE) $(PATH_VBoxCOM)/VirtualBox_i.c
|
---|
654 |
|
---|
655 | endif
|
---|
656 |
|
---|
657 | $(PATH_BIN)/comregister.cmd: win32/comregister.cmd
|
---|
658 | $(CP) $< $@
|
---|
659 |
|
---|
660 |
|
---|
661 | # Hot fix when dependencies goes bad again...
|
---|
662 | #.NOTPARALLEL: $(TARGET_VBoxC) $(TARGET_VBoxSVC) $(TARGET_VBoxCOM) $(IDLHEADER) $(IDLFILE) $(PATH_VBoxCOM)/VirtualBox_i.c
|
---|
663 |
|
---|