VirtualBox

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

Last change on this file since 34927 was 34723, checked in by vboxsync, 14 years ago

VBoxExtPackHelperApp: Authorize root execution the standard way and drop the set-uid-to-root stuff on darwin.

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