VirtualBox

source: vbox/trunk/src/VBox/Main/Makefile.kmk@ 12073

Last change on this file since 12073 was 12028, checked in by vboxsync, 16 years ago

Main: Only enable support for async I/O on platforms we support yet.

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette