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