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