VirtualBox

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

Last change on this file since 47561 was 47561, checked in by vboxsync, 11 years ago

Main/VirtualBox+Machine+Session: separate out the client death detection functionality into separate objects

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