VirtualBox

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

Last change on this file since 33944 was 33893, checked in by vboxsync, 14 years ago

space

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 30.4 KB
Line 
1# $Id: Makefile.kmk 33893 2010-11-09 12:33:57Z vboxsync $
2## @file
3# Makefile for the VBox Main module.
4#
5
6#
7# Copyright (C) 2006-2010 Oracle Corporation
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
18SUB_DEPTH = ../../..
19include $(KBUILD_PATH)/subheader.kmk
20
21#
22# Include sub-makefile(s).
23#
24ifdef VBOX_WITH_WEBSERVICES
25 include $(PATH_SUB_CURRENT)/webservice/Makefile.kmk
26endif
27include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
28include $(PATH_SUB_CURRENT)/cbinding/Makefile.kmk
29
30
31#
32# Targets and globals (bit of a mess...)
33#
34VBOX_PATH_MAIN_SRC := $(PATH_SUB_CURRENT)
35
36ifdef VBOX_ONLY_SDK
37 # used by some rules
38 PATH_VBoxCOM = $(PATH_TARGET)/VBoxCOM
39 BLDDIRS += $(PATH_VBoxCOM) $(PATH_BIN)/components
40 # I'm Evil! Dr. Evil.
41 include $(KBUILD_PATH)/tools/VCC70.kmk
42 include $(KBUILD_PATH)/sdks/WINPSDK.kmk
43endif # !VBOX_ONLY_SDK
44
45
46# Construct VBOX_MAIN_DEFS
47## @todo eliminate or expand VBOX_MAIN_DEFS.
48VBOX_MAIN_DEFS =
49ifneq ($(KBUILD_TARGET),win)
50 ifndef VBOX_WITH_XPCOM
51 $(error "VBox: VBOX_WITH_XPCOM isn't defined")
52 endif
53 ifneq ($(KBUILD_TARGET),os2)
54 VBOX_MAIN_DEFS += VBOX_WITH_SYS_V_IPC_SESSION_WATCHER
55 endif
56endif
57VBOX_MAIN_DEFS += \
58 $(if $(VBOX_WITH_RAW_MODE),VBOX_WITH_RAW_MODE,) \
59 $(if $(VBOX_WITH_NETFLT),VBOX_WITH_NETFLT,) \
60 $(if $(VBOX_WITH_COPYTOGUEST),VBOX_WITH_COPYTOGUEST,) \
61 $(if $(VBOX_WITH_CROGL),VBOX_WITH_CROGL,) \
62 $(if $(VBOX_WITH_GUEST_PROPS),VBOX_WITH_GUEST_PROPS,) \
63 $(if $(VBOX_WITH_GUEST_PROPS_RDONLY_GUEST),VBOX_WITH_GUEST_PROPS_RDONLY_GUEST,) \
64 $(if $(VBOX_WITH_GUEST_CONTROL),VBOX_WITH_GUEST_CONTROL,) \
65 $(if $(VBOX_WITH_HOSTNETIF_API),VBOX_WITH_HOSTNETIF_API,) \
66 $(if $(VBOX_WITH_VDE),VBOX_WITH_VDE,)
67
68# Unconditionally enable the new semaphore key generation code
69VBOX_MAIN_DEFS += VBOX_WITH_NEW_SYS_V_KEYGEN
70
71VBOX_IDL_FILE.MSCOM = $(VBOX_PATH_SDK)/bindings/mscom/idl/VirtualBox.idl
72VBOX_IDL_FILE.XPCOM = $(VBOX_PATH_SDK)/bindings/xpcom/idl/VirtualBox_XPCOM.idl
73
74VBOX_IDL_TYPELIB.XPCOM = $(PATH_BIN)/components/VirtualBox_XPCOM.xpt
75VBOX_IDL_HEADER.XPCOM = $(VBOX_PATH_SDK)/bindings/xpcom/include/VirtualBox_XPCOM.h
76
77# The MS COM specific stuff.
78if defined(VBOX_ONLY_SDK) || "$(KBUILD_TARGET)" == "win"
79 OTHERS += \
80 $(VBOX_IDL_FILE.MSCOM) \
81 $(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h \
82 $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox.tlb \
83 $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox_i.c
84 OTHER_CLEAN += \
85 $(VBOX_IDL_FILE.MSCOM) \
86 $(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h \
87 $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox.tlb \
88 $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox_i.c \
89 $(PATH_VBoxCOM)/VirtualBox.h \
90 $(PATH_VBoxCOM)/VirtualBox_i.c \
91 $(PATH_VBoxCOM)/VirtualBox.tlb
92
93 VBOX_MAIN_PREREQS += $(PATH_VBoxCOM)/VirtualBox_i.c
94 BLDDIRS += $(VBOX_PATH_SDK)/bindings/mscom/idl
95endif
96
97# The XPCOM specific stuff.
98if defined(VBOX_ONLY_SDK) || "$(KBUILD_TARGET)" != "win"
99 OTHERS += $(VBOX_IDL_FILE.XPCOM) $(VBOX_IDL_TYPELIB.XPCOM) $(VBOX_IDL_HEADER.XPCOM)
100 OTHER_CLEAN += \
101 $(VBOX_IDL_FILE.XPCOM) \
102 $(VBOX_IDL_HEADER.XPCOM) \
103 $(VBOX_IDL_TYPELIB.XPCOM)
104
105 VBOX_MAIN_PREREQS += $(VBOX_IDL_TYPELIB.XPCOM) $(VBOX_IDL_HEADER.XPCOM)
106 BLDDIRS += \
107 $(VBOX_PATH_SDK)/bindings/xpcom/idl \
108 $(VBOX_PATH_SDK)/bindings/xpcom/include
109endif # xpcom
110
111
112#
113# Strip documentation from source XIDL so that we don't get a full
114# recompile every time a comma in the documentation is changed.
115#
116$(VBOX_XIDL_FILE).ts +| $(VBOX_XIDL_FILE): \
117 $(VBOX_XIDL_FILE_SRC) \
118 $(VBOX_PATH_MAIN_SRC)/idl/docstrip.xsl \
119 | $$(dir $$@)
120# $(CP) -fv $< $(VBOX_XIDL_FILE).ts
121 $(QUIET)$(VBOX_XSLTPROC) -o $(VBOX_XIDL_FILE).ts $(VBOX_PATH_MAIN_SRC)/idl/docstrip.xsl $<
122 $(QUIET)$(CP) --changed -fv $(VBOX_XIDL_FILE).ts $(VBOX_XIDL_FILE)
123
124OTHER_CLEAN += $(VBOX_XIDL_FILE) $(VBOX_XIDL_FILE).ts
125
126#
127# The Main API documentation
128#
129VBOX_MAIN_DOC_DIR = $(VBOX_PATH_SDK)/docs
130BLDDIRS += $(VBOX_MAIN_DOC_DIR)
131
132$(PATH_TARGET)/docs.Main: \
133 $(VBOX_PATH_MAIN_SRC)/Doxyfile.Main \
134 $(VBOX_PATH_MAIN_SRC)/idl/doxygen.xsl \
135 $(VBOX_XIDL_FILE_SRC) \
136 | $(PATH_TARGET)/ \
137 $(VBOX_MAIN_DOC_DIR)/
138 $(call MSG_TOOL,xsltproc,doxygen input,$<,$@)
139 $(QUIET)$(RM) -f $(wildcard $(VBOX_MAIN_DOC_DIR)/html/*) $(PATH_TARGET)/docs.Main
140 $(QUIET)$(VBOX_XSLTPROC) -o $(PATH_TARGET)/VirtualBox.idl $(VBOX_PATH_MAIN_SRC)/idl/doxygen.xsl $(VBOX_XIDL_FILE_SRC)
141 $(QUIET)$(REDIRECT) -E 'DOCDIR=$(VBOX_MAIN_DOC_DIR)' -E 'PATH_TARGET=$(PATH_TARGET)' -E 'PATH_CHM=$(subst /,\,$(VBOX_MAIN_DOC_DIR)/VirtualBoxAPI.chm)' \
142 -- doxygen $(VBOX_PATH_MAIN_SRC)/Doxyfile.Main
143 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) ">>>>>>>>>>>>>>>>>>>> Main.err: >>>>>>>>>>>>>>>>>>>>>>>>"
144 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(CAT) "$(PATH_TARGET)/Main.err"
145 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "<<<<<<<<<<<<<<<<<<<< Main.err <<<<<<<<<<<<<<<<<<<<<<<<<"
146 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "===> **************************************************"
147 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "===> Please fix above doxygen errors/warnings listed in"
148 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "===> $(PATH_TARGET)/Main.err"
149 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "===> **************************************************"
150 -$(EXEC_X86_WIN32) $(VBOX_PATH_HTML_HELP_WORKSHOP)/hhc.exe $(subst /,\\,$(VBOX_MAIN_DOC_DIR)/html/index.hhp)
151 $(APPEND) $(PATH_TARGET)/docs.Main
152# aliases
153docs.main docs.Main: $(PATH_TARGET)/docs.Main
154if !defined(VBOX_ONLY_DOCS)
155docs: $(PATH_TARGET)/docs.Main
156endif
157
158
159#
160# Some SDK bit.
161#
162INSTALLS += VBox-main-xidl
163VBox-main-xidl_INST = $(INST_SDK)bindings/
164VBox-main-xidl_SOURCES = $(VBOX_XIDL_FILE_SRC)
165
166ifdef VBOX_WITH_PYTHON
167
168# or to some subdir?
169VBOX_PYTHON_CONSTANTS = $(PATH_TARGET)/VirtualBox_constants.py
170
171INSTALLS += VBox-python-glue
172VBox-python-glue_INST = $(INST_SDK)installer
173VBox-python-glue_SOURCES = glue/vboxapi.py=>vboxapi/__init__.py \
174 $(VBOX_PYTHON_CONSTANTS)=>vboxapi/VirtualBox_constants.py
175
176$(VBOX_PYTHON_CONSTANTS): $(VBOX_PATH_MAIN_SRC)/glue/constants-python.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
177 $(call MSG_TOOL,xsltproc,Python constants,$<,$@)
178 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
179
180endif # VBOX_WITH_PYTHON
181
182ifndef VBOX_ONLY_SDK # Note this goes on for *very* long
183
184#
185# Generate SchemaDefs.h and SchemaDefs.cpp from XML Schema
186# These two files are used by both VBoxC and VBoxSVC.
187#
188BLDDIRS += $(PATH_TARGET)/Main
189VBOX_XML_SCHEMADEFS_H = $(PATH_TARGET)/Main/SchemaDefs.h
190VBOX_XML_SCHEMADEFS_CPP = $(PATH_TARGET)/Main/SchemaDefs.cpp
191VBOX_XML_SCHEMADEFS_XSL = $(VBOX_PATH_MAIN_SRC)/xml/SchemaDefs.xsl
192
193VBOX_AUTOGEN_EVENT_CPP = $(PATH_TARGET)/Main/VBoxEvents.cpp
194
195testschemadefs: $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP)
196
197
198#
199# VBoxSVC executable
200#
201PROGRAMS += VBoxSVC
202VBoxSVC_TEMPLATE = VBOXMAINEXE
203VBoxSVC_DEFS = \
204 VBOX_MAIN_SETTINGS_ADDONS \
205 IN_VMM_STATIC \
206 $(VBOX_MAIN_DEFS) \
207 $(if $(VBOX_WITH_VBOXSDL),VBOX_WITH_VBOXSDL,) \
208 $(if $(VBOX_WITH_HEADLESS),VBOX_WITH_HEADLESS,) \
209 $(if $(VBOX_WITH_QTGUI),VBOX_WITH_QTGUI,) \
210 $(if $(VBOX_WITH_COCOA_QT),VBOX_WITH_COCOA_QT,) \
211 $(if $(VBOX_WITH_HGCM),VBOX_WITH_HGCM,) \
212 $(if $(VBOX_MAIN_RELEASE_LOG),VBOX_MAIN_RELEASE_LOG LOG_ENABLED,) \
213 $(if $(VBOX_WITH_ALSA),VBOX_WITH_ALSA,) \
214 $(if $(VBOX_WITH_PULSE),VBOX_WITH_PULSE,) \
215 $(if $(VBOX_WITH_WINMM),VBOX_WITH_WINMM,) \
216 $(if $(VBOX_WITH_SOLARIS_OSS),VBOX_WITH_SOLARIS_OSS,) \
217 $(if $(VBOX_WITH_E1000),VBOX_WITH_E1000,) \
218 $(if $(VBOX_WITH_VIRTIO),VBOX_WITH_VIRTIO,) \
219 $(if $(VBOX_WITH_AHCI),VBOX_WITH_AHCI,) \
220 $(if $(VBOX_WITH_LSILOGIC),VBOX_WITH_LSILOGIC,) \
221 $(if $(VBOX_WITH_LINUX_COMPILER_H),VBOX_WITH_LINUX_COMPILER_H,) \
222 $(if $(VBOX_WITH_RESOURCE_USAGE_API),VBOX_WITH_RESOURCE_USAGE_API,) \
223 $(if $(VBOX_WITH_PDM_ASYNC_COMPLETION),VBOX_WITH_PDM_ASYNC_COMPLETION,) \
224 $(if $(VBOX_WITH_DBUS),$(if $(VBOX_USB_WITH_DBUS),VBOX_USB_WITH_DBUS,),) \
225 $(if $(VBOX_USB_WITH_SYSFS),VBOX_USB_WITH_SYSFS,) \
226 $(if $(VBOX_USB_WITH_INOTIFY),VBOX_USB_WITH_INOTIFY,) \
227 $(if $(VBOX_WITH_LIVE_MIGRATION),VBOX_WITH_LIVE_MIGRATION,) \
228 $(if $(VBOX_WITH_EXTPACK),VBOX_WITH_EXTPACK,) \
229 $(if $(VBOX_WITH_VUSB),VBOX_WITH_VUSB,)
230ifdef VBOX_WITH_USB
231 VBoxSVC_DEFS += \
232 VBOX_WITH_USB \
233 $(if $(VBOX_WITH_EHCI),VBOX_WITH_EHCI,) \
234 $(if $(VBOX_WITH_NEW_USB_CODE_ON_DARWIN),VBOX_WITH_NEW_USB_CODE_ON_DARWIN,)
235endif
236VBoxSVC_DEFS.win += VBOX_COM_OUTOFPROC_MODULE
237VBoxSVC_DEFS.win.x86 += _WIN32_WINNT=0x0500
238VBoxSVC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
239# Try to load and use libhal at runtime for probing removable media
240# VBoxSVC_DEFS.linux += VBOX_USE_LIBHAL
241VBoxSVC_DEFS.solaris += VBOX_USE_LIBHAL
242VBoxSVC_DEFS.freebsd += VBOX_USE_LIBHAL
243
244VBoxSVC_CXXFLAGS = $(filter-out -Wno-unused,$(TEMPLATE_VBOXMAINEXE_CXXFLAGS))
245## @todo We're disabling optimizations on FreeBSD to work around strange linker
246# errors in release builds. Figure out why and how to work around it in a
247# more optimal fashion.
248VBoxSVC_CXXFLAGS.freebsd = -O0
249
250VBoxSVC_INCS = \
251 include \
252 $(PATH_VBoxSVC) \
253 $(dir $(VBOX_XML_SCHEMADEFS_H)) \
254 .
255VBoxSVC_INCS.win = \
256 $(PATH_VBoxCOM)
257ifdef VBOX_WITH_USB
258 VBoxSVC_INCS.os2 = \
259 $(PATH_ROOT)/src/VBox/HostDrivers/VBoxUSB/os2
260endif
261
262VBoxSVC_LIBS += \
263 $(PATH_LIB)/SSMStandalone$(VBOX_SUFF_LIB) \
264 $(LIB_DDU)
265VBoxSVC_SDKS = VBOX_LIBPNG VBOX_ZLIB
266VBoxSVC_LIBS.solaris = \
267 adm \
268 nsl \
269 devinfo \
270 socket
271
272VBoxSVC_INTERMEDIATES = \
273 $(VBOX_MAIN_PREREQS) \
274 $(VBOX_XML_SCHEMADEFS_H)
275
276VBoxSVC_SOURCES = \
277 Global.cpp \
278 Logging.cpp \
279 Matching.cpp \
280 xml/Settings.cpp \
281 VirtualBoxBase.cpp \
282 VirtualBoxErrorInfoImpl.cpp \
283 VirtualBoxImpl.cpp \
284 ApplianceImpl.cpp \
285 ApplianceImplIO.cpp \
286 ApplianceImplExport.cpp \
287 ApplianceImplImport.cpp \
288 xml/ovfreader.cpp \
289 VFSExplorerImpl.cpp \
290 MachineImpl.cpp \
291 SnapshotImpl.cpp \
292 MediumImpl.cpp \
293 MediumLock.cpp \
294 MediumAttachmentImpl.cpp \
295 MediumFormatImpl.cpp \
296 ProgressImpl.cpp \
297 ProgressProxyImpl.cpp \
298 HostImpl.cpp \
299 HostNetworkInterfaceImpl.cpp \
300 DHCPServerImpl.cpp \
301 DHCPServerRunner.cpp \
302 GuestOSTypeImpl.cpp \
303 NATEngineImpl.cpp \
304 NetworkAdapterImpl.cpp \
305 SerialPortImpl.cpp \
306 ParallelPortImpl.cpp \
307 USBControllerImpl.cpp \
308 StorageControllerImpl.cpp \
309 AudioAdapterImpl.cpp \
310 SharedFolderImpl.cpp \
311 SystemPropertiesImpl.cpp \
312 BIOSSettingsImpl.cpp \
313 HostPower.cpp \
314 EventImpl.cpp \
315 DisplayUtils.cpp \
316 DisplayPNGUtil.cpp \
317 DisplayResampleImage.cpp \
318 $(VBOX_AUTOGEN_EVENT_CPP) \
319 VRDEServerImpl.cpp \
320 $(if $(VBOX_WITH_XPCOM),xpcom/server.cpp,) \
321 $(VBOX_XML_SCHEMADEFS_CPP) \
322 $(if $(VBOX_WITH_EXTPACK),ExtPackManagerImpl.cpp ExtPackUtil.cpp,)
323
324VBoxSVC_SOURCES.darwin = \
325 darwin/iokit.cpp \
326 darwin/HostPowerDarwin.cpp
327
328ifdef VBOX_WITH_CROGL
329 ifneq ($(KBUILD_TARGET),darwin)
330 VBoxSVC_SOURCES += generic/OpenGLTest.cpp
331 endif
332 VBoxSVC_SOURCES.darwin += darwin/OpenGLTestDarwin.cpp
333endif
334
335VBoxSVC_SOURCES.win = \
336 win/svcmain.cpp \
337 win/svchlp.cpp \
338 win/HostPowerWin.cpp \
339 win/VBoxSVC.rc \
340 win/VBoxComEvents.cpp
341
342VBoxSVC_SOURCES.linux = \
343 linux/HostHardwareLinux.cpp
344
345VBoxSVC_SOURCES.solaris = \
346 linux/vbox-libhal.cpp \
347 solaris/DynLoadLibSolaris.cpp
348
349VBoxSVC_SOURCES.freebsd = \
350 freebsd/HostHardwareFreeBSD.cpp
351
352ifdef VBOX_WITH_USB
353 ifdef VBOX_WITH_SYSFS_BY_DEFAULT
354 linux/USBProxyServiceLinux.cpp_DEFS += VBOX_WITH_SYSFS_BY_DEFAULT
355 endif
356 VBoxSVC_SOURCES += \
357 USBDeviceFilterImpl.cpp \
358 USBProxyService.cpp \
359 HostUSBDeviceImpl.cpp
360 VBoxSVC_SOURCES.darwin += darwin/USBProxyServiceDarwin.cpp
361 VBoxSVC_SOURCES.linux += linux/USBProxyServiceLinux.cpp
362 VBoxSVC_SOURCES.linux += linux/USBGetDevices.cpp
363 VBoxSVC_SOURCES.os2 += os2/USBProxyServiceOs2.cpp
364 VBoxSVC_SOURCES.solaris += solaris/USBProxyServiceSolaris.cpp
365 VBoxSVC_SOURCES.win += win/USBProxyServiceWindows.cpp
366 VBoxSVC_SOURCES.freebsd += freebsd/USBProxyServiceFreeBSD.cpp
367endif
368
369ifdef VBOX_WITH_NETFLT
370 # Note! The includes from the TOOL has lower priority than the SDKs,
371 # since comdef.h is in both the DDK and VCC we want to make sure
372 # we're using the VCC since we're not using the DDK compiler/crt.
373 # Since this is potentially risky, restrict it to the source file
374 # needing it.
375 win/NetIf-win.cpp_INCS.win += $(PATH_TOOL_$(VBOX_VCC_TOOL)_INC)
376 VBoxSVC_LIBS.win += \
377 $(PATH_LIB)/WinNetConfig.lib \
378 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
379 $(PATH_SDK_WINPSDK_LIB)/WbemUuid.Lib
380 ifdef VBOX_NETFLT_ONDEMAND_BIND
381 VBoxSVC_DEFS.win += VBOX_NETFLT_ONDEMAND_BIND
382 endif
383endif
384VBoxSVC_LDFLAGS.darwin = -framework IOKit -framework SystemConfiguration
385
386ifdef VBOX_WITH_CROGL
387 VBoxSVC_LDFLAGS.darwin += -framework OpenGL
388endif
389
390ifeq ($(KBUILD_TYPE),debug)
391 VBoxSVC_LDFLAGS.linux += -rdynamic # for backtrace_symbols()
392endif
393
394ifdef VBOX_WITH_RESOURCE_USAGE_API
395 VBoxSVC_SOURCES += \
396 PerformanceImpl.cpp \
397 Performance.cpp
398 VBoxSVC_SOURCES.darwin += darwin/PerformanceDarwin.cpp
399 VBoxSVC_SOURCES.freebsd += freebsd/PerformanceFreeBSD.cpp
400 VBoxSVC_SOURCES.linux += linux/PerformanceLinux.cpp
401 VBoxSVC_SOURCES.os2 += os2/PerformanceOs2.cpp
402 VBoxSVC_SOURCES.solaris += solaris/PerformanceSolaris.cpp
403 VBoxSVC_SOURCES.win += win/PerformanceWin.cpp
404 VBoxSVC_LDFLAGS.darwin += -lproc
405 VBoxSVC_LDFLAGS.solaris += -lkstat
406 VBoxSVC_LDFLAGS.win += psapi.lib powrprof.lib
407endif
408
409ifdef VBOX_WITH_HOSTNETIF_API
410 VBoxSVC_SOURCES.win += win/NetIf-win.cpp
411 VBoxSVC_SOURCES.linux += linux/NetIf-linux.cpp
412 VBoxSVC_SOURCES.os2 += os2/NetIf-os2.cpp
413 VBoxSVC_SOURCES.darwin += darwin/NetIf-darwin.cpp
414 VBoxSVC_SOURCES.solaris += solaris/NetIf-solaris.cpp
415 VBoxSVC_SOURCES.freebsd += freebsd/NetIf-freebsd.cpp
416 VBoxSVC_DEFS += VBOX_WITH_HOSTNETIF_API
417 if1of ($(KBUILD_TARGET), linux darwin solaris freebsd)
418 VBoxSVC_SOURCES += generic/NetIf-generic.cpp
419 endif
420endif
421
422win/VBoxSVC.rc_INCS = $(PATH_VBoxSVC)
423win/VBoxSVC.rc_DEPS = $(PATH_VBoxSVC)/VBoxSVC.rgs $(PATH_VBoxSVC)/VBoxSVC-icon.rc
424win/VBoxSVC.rc_CLEAN = $(PATH_VBoxSVC)/VBoxSVC.rgs $(PATH_VBoxSVC)/VBoxSVC-icon.rc
425
426$$(PATH_VBoxSVC)/VBoxSVC-icon.rc: $(MAKEFILE_CURRENT) $(VBOX_WINDOWS_ICON_FILE) | $$(dir $$(@D))
427 $(APPEND) -t $@ '1 ICON DISCARDABLE "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
428
429$$(PATH_VBoxSVC)/VBoxSVC.rgs: $(VBOX_PATH_MAIN_SRC)/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(dir $$(@D))
430 $(VBOX_XSLTPROC) --stringparam Module VBoxSVC -o $@ $< $(VBOX_XIDL_FILE)
431
432
433#
434# Embed XML Schema files to VBoxSVC
435#
436VBOX_XML_SCHEMA_COMMON = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-common.xsd
437VBOX_XML_SCHEMA.darwin = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-macosx.xsd
438VBOX_XML_SCHEMA.linux = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-linux.xsd
439VBOX_XML_SCHEMA.freebsd = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-freebsd.xsd
440VBOX_XML_SCHEMA.win = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-windows.xsd
441VBOX_XML_SCHEMA.os2 = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-os2.xsd
442VBOX_XML_SCHEMA.solaris = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-solaris.xsd
443
444VBOX_XML_CONVERTER_TEMPLATE = $(VBOX_PATH_MAIN_SRC)/xml/SettingsConverter.xsl
445
446$$(PATH_VBoxSVC)/xml_VirtualBox_settings_xsd.h: $(VBOX_XML_SCHEMA.$(KBUILD_TARGET)) $(VBOX_BIN2C)
447 $(call MSG_TOOL,bin2c,VBoxSVC,$<,$@)
448 $(QUIET)$(VBOX_BIN2C) _xml_VirtualBox_settings_xsd $< $@
449
450$$(PATH_VBoxSVC)/xml_VirtualBox_settings_common_xsd.h: $(VBOX_XML_SCHEMA_COMMON) $(VBOX_BIN2C)
451 $(call MSG_TOOL,bin2c,VBoxSVC,$<,$@)
452 $(QUIET)$(VBOX_BIN2C) _xml_VirtualBox_settings_common_xsd $< $@
453
454$$(PATH_VBoxSVC)/xml_SettingsConverter_xsl.h: $(VBOX_XML_CONVERTER_TEMPLATE) $(VBOX_BIN2C)
455 $(call MSG_TOOL,bin2c,VBoxSVC,$<,$@)
456 $(QUIET)$(VBOX_BIN2C) _xml_SettingsConverter_xsl $< $@
457
458$(VBOX_XML_SCHEMADEFS_H): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(KBUILD_TARGET)) $(VBOX_XML_SCHEMA_COMMON) | $$(dir $$@)
459 $(call MSG_GENERATE,SchemaDefs,$@,$<)
460 $(QUIET)$(VBOX_XSLTPROC) --stringparam mode declare -o $@ $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(KBUILD_TARGET))
461
462$(VBOX_XML_SCHEMADEFS_CPP): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(KBUILD_TARGET)) $(VBOX_XML_SCHEMA_COMMON) | $$(dir $$@)
463 $(call MSG_GENERATE,SchemaDefs,$@,$<)
464 $(QUIET)$(VBOX_XSLTPROC) --stringparam mode define -o $@ $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(KBUILD_TARGET))
465
466OTHER_CLEAN += $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP)
467
468
469#
470# Generate some event stuff for VBoxSVC and VBoxC.
471#
472$(VBOX_AUTOGEN_EVENT_CPP): $(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
473 $(call MSG_TOOL,xsltproc,autogen events,$<,$@)
474 $(QUIET)$(VBOX_XSLTPROC) --stringparam G_kind VBoxEvent -o $@ $< $(VBOX_XIDL_FILE)
475
476OTHER_CLEAN += $(VBOX_AUTOGEN_EVENT_CPP)
477
478
479#
480# VBoxTestOGL - OpenGL support test app.
481# Note! Doesn't link with VBOX_WITH_DEBUG_VCC_CRT defined because it uses Qt.
482#
483if ( defined(VBOX_WITH_QTGUI) \
484 && (defined(VBOX_WITH_CROGL) || defined(VBOX_WITH_VIDEOHWACCEL)) \
485 && !defined(VBOX_WITH_DEBUG_VCC_CRT))
486 ifneq ($(KBUILD_TARGET),darwin)
487 ifdef VBOX_WITH_VIDEOHWACCEL
488 USES += qt4
489 endif
490 PROGRAMS += VBoxTestOGL
491 VBoxTestOGL_TEMPLATE = $(if $(VBOX_WITH_VIDEOHWACCEL),$(if $(VBOX_WITH_HARDENING),VBOXQT4GUI,VBOXQT4GUIEXE),VBOXMAINEXE)
492 VBoxTestOGL_SOURCES = generic/OpenGLTestApp.cpp
493 VBoxTestOGL_LIBS = \
494 $(if $(VBOX_WITH_CROGL), \
495 $(PATH_LIB)/VBoxOGLhostspuload$(VBOX_SUFF_LIB) \
496 $(VBOX_LIB_OGL_HOSTCRUTIL),) \
497 $(if $(VBOX_WITH_VIDEOHWACCEL), $(PATH_LIB)/VBoxOGL2D$(VBOX_SUFF_LIB),) \
498 $(LIB_RUNTIME)
499 VBoxTestOGL_DEFS += \
500 $(if $(VBOX_WITH_CROGL), VBOX_WITH_CROGL,) \
501 $(if $(VBOX_WITH_VIDEOHWACCEL), VBOX_WITH_VIDEOHWACCEL,) \
502 VBOX_BUILD_TARGET=\"$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)\" \
503 $(if $(VBOX_BLEEDING_EDGE),VBOX_BLEEDING_EDGE=\"$(VBOX_BLEEDING_EDGE)\",)
504 ifdef VBOX_WITH_VIDEOHWACCEL
505 VBoxTestOGL_QT_MODULES += Core Gui OpenGL
506 VBoxTestOGL_LDFLAGS.darwin += -framework OpenGL
507 VBoxTestOGL_LIBS.win += $(PATH_SDK_WINPSDK_LIB)/Opengl32.lib
508 if1of ($(KBUILD_TARGET), solaris linux freebsd)
509 # must come after VBoxOGL2D, therefore don't set the arch-specific LIBS variable here!
510 VBoxTestOGL_LIBS += GL
511 endif
512 endif
513 VBoxTestOGL_LDFLAGS.win = /SUBSYSTEM:windows
514 endif
515endif
516
517
518ifdef VBOX_WITH_XPCOM
519#
520# VBoxSVCM - VBoxSVC wrapper module
521#
522DLLS += VBoxSVCM
523VBoxSVCM_TEMPLATE = VBOXMAINCOMP
524VBoxSVCM_DEFS = IN_RING3 $(VBOX_MAIN_DEFS)
525ifdef VBOX_WITH_HARDENING
526 VBoxSVCM_DEFS += VBOX_WITH_HARDENING
527endif
528VBoxSVCM_INCS = \
529 include \
530 $(PATH_VBoxC) \
531 .
532VBoxSVCM_INTERMEDIATES = $(VBOX_MAIN_PREREQS)
533VBoxSVCM_SOURCES = \
534 xpcom/server_module.cpp
535VBoxSVCM_LDFLAGS.darwin = \
536 -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxSVCM.dylib \
537 -exported_symbols_list $(PATH_VBoxSVCM)/VBoxSVCM.def
538 ifeq ($(KBUILD_TARGET),darwin)
539VBoxSVCM_ORDERDEPS += $(PATH_VBoxSVCM)/VBoxSVCM.def
540VBoxSVCM_CLEAN += $(PATH_VBoxSVCM)/VBoxSVCM.def
541$$(PATH_VBoxSVCM)/VBoxSVCM.def:
542 $(RM) -f $@
543 $(APPEND) $@ _NSGetModule
544 endif
545VBoxSVCM_INTERMEDIATES += $(VBOX_IDL_HEADER.XPCOM)
546endif # VBOX_WITH_XPCOM
547
548
549#
550# VBoxC module
551#
552DLLS += VBoxC
553VBoxC_TEMPLATE = VBOXMAINCOMP
554VBoxC_SDKS = VBOX_LIBPNG VBOX_ZLIB
555VBoxC_DEFS = \
556 IN_RING3 \
557 $(VBOX_MAIN_DEFS) \
558 VBOX_COM_INPROC \
559 $(if $(VBOX_WITH_VRDP_VIDEO_CHANNEL),VBOX_WITH_VRDP_VIDEO_CHANNEL,) \
560 $(if $(VBOX_WITH_HGCM),VBOX_WITH_HGCM,) \
561 $(if $(VBOX_MAIN_RELEASE_LOG),VBOX_MAIN_RELEASE_LOG LOG_ENABLED,) \
562 $(if $(VBOX_WITH_ALSA),VBOX_WITH_ALSA,) \
563 $(if $(VBOX_WITH_PULSE),VBOX_WITH_PULSE,) \
564 $(if $(VBOX_WITH_WINMM),VBOX_WITH_WINMM,) \
565 $(if $(VBOX_WITH_SOLARIS_OSS),VBOX_WITH_SOLARIS_OSS,) \
566 $(if $(VBOX_WITH_CROSSBOW),VBOX_WITH_CROSSBOW,) \
567 $(if $(VBOX_WITH_E1000),VBOX_WITH_E1000,) \
568 $(if $(VBOX_WITH_VIRTIO),VBOX_WITH_VIRTIO,) \
569 $(if $(VBOX_WITH_EFI),VBOX_WITH_EFI,) \
570 $(if $(VBOX_WITH_PDM_ASYNC_COMPLETION),VBOX_WITH_PDM_ASYNC_COMPLETION,) \
571 $(if $(VBOX_WITH_LIVE_MIGRATION),VBOX_WITH_LIVE_MIGRATION,) \
572 $(if $(VBOX_WITH_VUSB),VBOX_WITH_VUSB,) \
573 $(if $(VBOX_WITH_OLD_VBVA_LOCK),VBOX_WITH_OLD_VBVA_LOCK,) \
574 $(if $(VBOX_WITH_HGSMI),VBOX_WITH_HGSMI,) \
575 $(if $(VBOX_WITH_VIDEOHWACCEL),VBOX_WITH_VIDEOHWACCEL,) \
576 $(if $(VBOX_WITH_USB),VBOX_WITH_USB,) \
577 $(if-expr defined(VBOX_WITH_EHCI) && defined(VBOX_WITH_USB),VBOX_WITH_EHCI,) \
578 $(if $(VBOX_WITH_EXTPACK),VBOX_WITH_EXTPACK,)
579
580VBoxC_DEFS.darwin.x86 = VBOX_WITH_2X_4GB_ADDR_SPACE
581VBoxC_DEFS.win.x86 += _WIN32_WINNT=0x0500
582VBoxC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
583
584#temporary define
585VBoxC_DEFS += MMSEAMLESS
586
587VBoxC_INCS = \
588 include \
589 $(PATH_VBoxC) \
590 $(dir $(VBOX_XML_SCHEMADEFS_H))
591VBoxC_INCS.win = \
592 $(PATH_VBoxCOM) \
593 .
594
595VBoxC_LDFLAGS.darwin = \
596 -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxC.dylib \
597 -exported_symbols_list $(PATH_VBoxC)/VBoxC.def \
598 -framework IOKit
599ifdef VBOX_USE_VCC80
600 VBoxC_LDFLAGS.win = /MANIFEST
601endif
602
603VBoxC_LIBS += \
604 $(LIB_VMM) \
605 $(LIB_REM)
606
607ifdef VBOX_WITH_NETFLT
608 VBoxC_LIBS.win += $(PATH_LIB)/WinNetConfig.lib \
609 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
610 $(PATH_SDK_WINPSDK_LIB)/WbemUuid.Lib
611endif
612
613VBoxC_INTERMEDIATES = \
614 $(VBOX_MAIN_PREREQS) \
615 $(VBOX_XML_SCHEMADEFS_H)
616
617VBoxC_SOURCES = \
618 Global.cpp \
619 Logging.cpp \
620 VBoxDll.cpp \
621 USBDeviceImpl.cpp \
622 RemoteUSBDeviceImpl.cpp \
623 VirtualBoxBase.cpp \
624 VirtualBoxErrorInfoImpl.cpp \
625 ProgressImpl.cpp \
626 SharedFolderImpl.cpp \
627 SessionImpl.cpp \
628 ConsoleImpl.cpp \
629 ConsoleImpl2.cpp \
630 ConsoleImplTeleporter.cpp \
631 ConsoleVRDPServer.cpp \
632 GuestImpl.cpp \
633 KeyboardImpl.cpp \
634 MouseImpl.cpp \
635 DisplayImpl.cpp \
636 DisplayUtils.cpp \
637 DisplayPNGUtil.cpp \
638 DisplayResampleImage.cpp \
639 MachineDebuggerImpl.cpp \
640 VBoxDriversRegister.cpp \
641 AudioSnifferInterface.cpp \
642 VMMDevInterface.cpp \
643 EventImpl.cpp \
644 BusAssignmentManager.cpp \
645 $(VBOX_AUTOGEN_EVENT_CPP) \
646 $(VBOX_XML_SCHEMADEFS_CPP) \
647 $(if $(VBOX_WITH_EXTPACK),ExtPackManagerImpl.cpp ExtPackUtil.cpp,)
648VBoxC_SOURCES.win = \
649 win/dllmain.cpp \
650 win/VBoxC.def \
651 win/VBoxC.rc
652
653
654ifdef VBOX_WITH_XPCOM
655VBoxC_SOURCES += \
656 xpcom/module.cpp
657endif
658
659ifdef VBOX_WITH_HGCM
660VBoxC_SOURCES += \
661 hgcm/HGCMObjects.cpp \
662 hgcm/HGCMThread.cpp \
663 hgcm/HGCM.cpp
664endif
665
666ifdef VBOX_WITH_CRHGSMI
667VBoxC_DEFS += VBOX_WITH_CRHGSMI
668endif
669
670ifdef VBOX_WITH_USB
671VBoxC_SOURCES += \
672 RemoteUSBBackend.cpp
673endif
674
675ifeq ($(KBUILD_TARGET),darwin)
676VBoxC_ORDERDEPS += $(PATH_VBoxC)/VBoxC.def
677VBoxC_CLEAN += $(PATH_VBoxC)/VBoxC.def
678$$(PATH_VBoxC)/VBoxC.def: $(MAKEFILE_CURRENT)
679 $(RM) -f $@
680 $(APPEND) $@ _NSGetModule
681 $(APPEND) $@ _VBoxDriversRegister
682endif
683
684ConsoleImpl.cpp_DEFS = \
685 VBOX_BUILD_TARGET=\"$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)\" \
686 $(if $(VBOX_BLEEDING_EDGE),VBOX_BLEEDING_EDGE=\"$(VBOX_BLEEDING_EDGE)\",)
687
688
689win/VBoxC.rc_DEPS = $(PATH_VBoxC)/VBoxC.rgs $(PATH_VBoxCOM)/VirtualBox.tlb
690VBoxC_CLEAN.win += $(PATH_VBoxC)/VBoxC.rgs
691
692$$(PATH_VBoxC)/VBoxC.rgs: $(VBOX_PATH_MAIN_SRC)/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(PATH_VBoxC)/
693 $(VBOX_XSLTPROC) --stringparam Module VBoxC -o $@ $< $(VBOX_XIDL_FILE)
694
695
696#
697# VBoxCOM - COM Abstraction Layer library
698#
699LIBRARIES += VBoxCOM
700VBoxCOM_TEMPLATE = VBOXMAINLIB
701VBoxCOM_INTERMEDIATES = $(VBOX_MAIN_PREREQS)
702VBoxCOM_SOURCES = \
703 glue/com.cpp \
704 glue/initterm.cpp \
705 glue/string.cpp \
706 glue/AutoLock.cpp \
707 glue/EventQueue.cpp \
708 glue/ErrorInfo.cpp \
709 glue/errorprint.cpp \
710 glue/VirtualBoxErrorInfo.cpp
711VBoxCOM_INCS += \
712 include
713ifeq ($(KBUILD_TARGET),win)
714 VBoxCOM_DEFS.x86 += _WIN32_WINNT=0x0500
715 VBoxCOM_DEFS.amd64 += _WIN32_WINNT=0x0510
716 VBoxCOM_SOURCES += \
717 $(PATH_VBoxCOM)/VirtualBox_i.c
718else # !win
719 VBoxCOM_SOURCES += \
720 xpcom/helpers.cpp
721endif # !win
722
723
724endif # !VBOX_ONLY_SDK (the ifndef is far above)
725
726
727#
728# The VBoxExtPackHelperApp.
729#
730ifeq ($(LOGNAME),bird) # def VBOX_WITH_EXTPACK
731 PROGRAMS += VBoxExtPackHelperApp
732 VBoxExtPackHelperApp_TEMPLATE = VBoxR3SetUidToRoot
733 VBoxExtPackHelperApp_SOURCES = \
734 VBoxExtPackHelperApp.cpp \
735 ExtPackUtil.cpp
736 VBoxExtPackHelperApp_LIBS = \
737 $(LIB_RUNTIME)
738
739endif # VBOX_WITH_EXTPACK
740
741#
742# Installs com related thing(s) to bin.
743#
744INSTALLS.win += VBoxMain-com-inst
745VBoxMain-com-inst_INST = $(INST_BIN)
746VBoxMain-com-inst_SOURCES = \
747 win/comregister.cmd
748
749
750if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "linux"
751 #
752 # Installs linux/hardening related things to components.
753 #
754 INSTALLS.linux += VBoxMain-hardening-inst
755 VBoxMain-hardening-inst_INST = $(INST_BIN)components/
756 VBoxMain-hardening-inst_SYMLINKS = \
757 VBoxDDU.so=>../VBoxDDU.so \
758 VBoxREM.so=>../VBoxREM.so \
759 VBoxRT.so=>../VBoxRT.so \
760 VBoxVMM.so=>../VBoxVMM.so \
761 VBoxXPCOM.so=>../VBoxXPCOM.so
762endif
763
764
765# generate rules
766include $(KBUILD_PATH)/subfooter.kmk
767
768
769
770#
771# Additions rules.
772#
773
774## @todo this hack ain't cutting it any longer. (the file name is abspath'ed since ages now.)
775xpcom/helpers.cpp: $(VBOX_IDL_TYPELIB.XPCOM)
776
777$(VBOX_IDL_FILE.XPCOM): $(VBOX_PATH_MAIN_SRC)/idl/xpidl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
778 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
779 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
780
781$(VBOX_IDL_TYPELIB.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
782 $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
783 $(QUIET)$(VBOX_XPIDL_ENV)$(VBOX_XPIDL) -m typelib -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
784 $(CHMOD) 0644 $@
785## @todo ^^^^^^^^^^^^ fix horrible hack
786
787$(VBOX_IDL_HEADER.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
788 $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
789 $(QUIET)$(VBOX_XPIDL_ENV)$(VBOX_XPIDL) -m header -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
790
791
792VBOX_MAIN_IDL ?= $(EXEC_X86_WIN32) $(call VBOX_FN_MAKE_WIN_PATH,$(firstword $(wildcard \
793 $(PATH_SDK_WINPSDK_BIN)/Midl.Exe\
794 $(PATH_SDK_WINPSDK)/Bin/Midl.Exe\
795 $(PATH_DEVTOOLS)/win.x86/bin/midl.exe\
796 ) Sorry_Cannot_Find_The_Midl_Compiler_In_The_PSDK))
797IDL_DEFS = /nologo
798
799$(VBOX_IDL_FILE.MSCOM): $(VBOX_PATH_MAIN_SRC)/idl/midl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
800 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
801 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
802
803# Aliases for testing purposes.
804ifdef VBOX_WITH_XPCOM
805testidl: $(VBOX_IDL_FILE.XPCOM) $(VBOX_IDL_TYPELIB.XPCOM)
806testidlhdr: $(VBOX_IDL_HEADER.XPCOM)
807else
808testidl: $(VBOX_IDL_FILE.MSCOM) $(PATH_VBoxCOM)/VirtualBox_i.c
809endif
810
811
812## @todo r=bird: last changes to this rule showed incorrect dependencies here as it broke testcase (see testboxwin2).
813# This is kind of obvious when looking at the rule, because it's (a) not specifying all it output
814# and (b) generating more stuff *after* the main target has been completed.
815#
816# What needs to be done is to not depend on _i.c in the object subdir, but on all the final outputs.
817$(PATH_VBoxCOM)/VirtualBox_i.c \
818+ $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox_i.c \
819+ $(PATH_VBoxCOM)/VirtualBox.h \
820+ $(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h \
821+ $(PATH_VBoxCOM)/VirtualBox.tlb \
822+ $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox.tlb: $(VBOX_IDL_FILE.MSCOM) | $(call DIRDEP,$(PATH_VBoxCOM))
823 $(VBOX_MAIN_IDL) $(IDL_DEFS) \
824 /out $(call VBOX_FN_MAKE_WIN_PATH,$(PATH_VBoxCOM)) \
825 /cpp_cmd $(subst $(EXEC_X86_WIN32),,$(call VBOX_FN_MAKE_WIN_PATH,$(TOOL_$(VBOX_VCC_TOOL)_CC))) \
826 /I $(call VBOX_FN_MAKE_WIN_PATH,$(PATH_SDK_WINPSDK_INC)) \
827 /I idl \
828 $(call VBOX_FN_MAKE_WIN_PATH,$<)
829 $(MKDIR) -p $(VBOX_PATH_SDK)/bindings/mscom/include
830 $(CP) $(PATH_VBoxCOM)/VirtualBox.h $(VBOX_PATH_SDK)/bindings/mscom/include
831 $(MKDIR) -p $(VBOX_PATH_SDK)/bindings/mscom/lib
832 $(CP) $(PATH_VBoxCOM)/VirtualBox.tlb $(VBOX_PATH_SDK)/bindings/mscom/lib
833 $(CP) $(PATH_VBoxCOM)/VirtualBox_i.c $(VBOX_PATH_SDK)/bindings/mscom/lib
834
835#
836# Translation stuff
837#
838VBoxSVC_VBOX_HEADERS = \
839 include/collection.h \
840 include/MachineImpl.h
841VBoxSVC_VBOX_TRANSLATIONS = \
842 nls/VBoxSVC_de.ts
843
844VBoxC_VBOX_HEADERS = \
845 include/ConsoleImpl.h
846VBoxC_VBOX_TRANSLATIONS = \
847 nls/VBoxC_de.ts
848
849ifdef VBOX_WITH_JMSCOM
850INSTALLS += VBoxJMscom-inst-jar
851
852#
853# Java glue JAR files
854#
855VBOX_JMSCOM_JAR = $(VBoxJMscom-inst-jar_0_OUTDIR)/vboxjmscom.jar
856VBOX_JMSCOM_TARGET := $(PATH_TARGET)/vboxjmscom-gen
857VBOX_JMSCOM_GEN = $(VBOX_JMSCOM_TARGET)/jmscomgen
858VBOX_JMSCOM_JDEST := $(VBOX_JMSCOM_TARGET)/jdest
859VBOX_GLUE_XSLT_DIR := $(PATH_ROOT)/src/VBox/Main/glue
860VBOX_JACOB_DIR := $(PATH_ROOT)/src/libs/jacob-1.15-M3
861
862VBoxJMscom-inst-jar_INST = $(INST_SDK)bindings/mscom/java/
863VBoxJMscom-inst-jar_SOURCES = \
864 $(VBOX_JMSCOM_JAR)
865VBoxJMscom-inst-jar_CLEAN = \
866 $(VBOX_JMSCOM_JAR) \
867 $(VBOX_JMSCOM_GEN)/jmscomglue.list \
868 $(wildcard \
869 $(VBOX_JMSCOM_GEN)/java/*.java \
870 $(VBOX_JMSCOM_JDEST)/*.class \
871 $(VBOX_JMSCOM_JDEST)/*/*.class \
872 $(VBOX_JMSCOM_JDEST)/*/*/*.class \
873 $(VBOX_JMSCOM_JDEST)/*/*/*/*.class \
874 )
875VBoxJMscom-inst-jar_BLDDIRS += $(VBOX_JMSCOM_GEN)/java
876
877$(VBOX_JMSCOM_GEN)/jmscomglue.list: \
878 $(VBOX_XIDL_FILE) \
879 $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl \
880 $(VBOX_FILESPLIT) \
881 | $(VBOX_JMSCOM_GEN)/java/
882 $(call MSG_L1,Generating Java MSCOM glue files from XIDL)
883 $(QUIET)$(RM) -f $(wildcard $(VBOX_JMSCOM_GEN)/java/*.java)
884 $(QUIET)$(VBOX_XSLTPROC) \
885 --stringparam G_vboxApiSuffix $(VBOX_API_SUFFIX) \
886 --stringparam G_vboxGlueStyle mscom \
887 -o $(VBOX_JMSCOM_GEN)/java/merged.file $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl $<
888 $(QUIET)$(VBOX_FILESPLIT) $(VBOX_JMSCOM_GEN)/java/merged.file $(VBOX_JMSCOM_GEN)/java
889 $(QUIET)echo $(VBOX_JMSCOM_GEN)/java/*.java > $@
890
891$$(VBOX_JMSCOM_JAR): $(VBOX_JMSCOM_GEN)/jmscomglue.list | $$(dir $$@)
892 $(call MSG_TOOL,javac,$(notdir $@),jmscomgen.list,)
893 $(QUIET)$(RM) -Rf $(VBOX_JMSCOM_JDEST)
894 $(QUIET)$(MKDIR) -p $(VBOX_JMSCOM_JDEST)
895 $(call MSG_TOOL,javac,$(notdir $@),...,)
896 $(VBOX_JAVAC) $(VBOX_JAVAC_OPTS) \
897 @$(VBOX_JMSCOM_GEN)/jmscomglue.list \
898 -d $(VBOX_JMSCOM_JDEST) -classpath $(VBOX_JMSCOM_JDEST)$(VBOX_SEP)$(VBOX_JACOB_DIR)/jacob.jar
899 $(call MSG_LINK,$(notdir $@),$@)
900 $(VBOX_JAR) cf $@ -C $(VBOX_JMSCOM_JDEST) .
901
902endif # VBOX_WITH_JMSCOM
903
904#
905# Install Java glue sample code.
906#
907INSTALLS += javagluesample
908javagluesample_INST = $(INST_SDK)bindings/glue/java
909javagluesample_MODE = a+rx,u+w
910javagluesample_SOURCES = \
911 $(VBOX_PATH_MAIN_SRC)/glue/tests/TestVBox.java=>TestVBox.java \
912 $(VBOX_PATH_MAIN_SRC)/glue/tests/Makefile.kmk=>Makefile.kmk
913
914updatenls::
915 $(VBOX_LUPDATE) $(VBoxSVC_SOURCES) $(VBoxSVC_VBOX_HEADERS) -ts $(VBoxSVC_VBOX_TRANSLATIONS)
916 $(VBOX_LUPDATE) $(VBoxC_SOURCES) $(VBoxC_VBOX_HEADERS) -ts $(VBoxC_VBOX_TRANSLATIONS)
917
918testconverter:: $(VBOX_USER_HOME)/VirtualBox.xml
919 $(call MSG_TOOL,xsltproc,Test Settings Converter,$<,$(VBOX_USER_HOME)/VirtualBox.xml.test)
920 $(QUIET)$(VBOX_XSLTPROC) -o $(VBOX_USER_HOME)/VirtualBox.xml.test xml/SettingsConverter.xsl $<
921
922testconverter2:: $(VBOX_USER_HOME)/Machines/dos/dos.xml
923 $(call MSG_TOOL,xsltproc,Test Settings Converter,$<,$<.test)
924 $(QUIET)$(VBOX_XSLTPROC) -o $<.test xml/SettingsConverter.xsl $<
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