VirtualBox

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

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

Main/USB: USB Controller implementation rework. Moved filter handling into a separate interface

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 32.3 KB
Line 
1# $Id: Makefile.kmk 47376 2013-07-24 15:13:52Z 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/DHCPServerImpl.cpp \
337 src-server/NetworkServiceRunner.cpp \
338 src-server/NATNetworkImpl.cpp \
339 src-server/GuestOSTypeImpl.cpp \
340 src-server/HostImpl.cpp \
341 src-server/HostNetworkInterfaceImpl.cpp \
342 src-server/HostPower.cpp \
343 src-server/MachineImpl.cpp \
344 src-server/MachineImplCloneVM.cpp \
345 src-server/Matching.cpp \
346 src-server/MediumAttachmentImpl.cpp \
347 src-server/MediumFormatImpl.cpp \
348 src-server/MediumImpl.cpp \
349 src-server/MediumLock.cpp \
350 src-server/NATEngineImpl.cpp \
351 src-server/NetworkAdapterImpl.cpp \
352 src-server/ParallelPortImpl.cpp \
353 src-server/ProgressProxyImpl.cpp \
354 src-server/SerialPortImpl.cpp \
355 src-server/SnapshotImpl.cpp \
356 src-server/StorageControllerImpl.cpp \
357 src-server/SystemPropertiesImpl.cpp \
358 src-server/USBControllerImpl.cpp \
359 src-server/USBDeviceFiltersImpl.cpp \
360 src-server/VFSExplorerImpl.cpp \
361 src-server/VirtualBoxImpl.cpp \
362 src-server/VRDEServerImpl.cpp \
363 src-server/generic/AutostartDb-generic.cpp \
364 xml/ovfreader.cpp \
365 xml/Settings.cpp \
366 $(VBOX_XML_SCHEMADEFS_CPP) \
367 $(VBOX_AUTOGEN_EVENT_CPP) \
368 $(if $(VBOX_WITH_XPCOM),src-server/xpcom/server.cpp,)
369
370VBoxSVC_SOURCES.darwin = \
371 src-server/darwin/iokit.cpp \
372 src-server/darwin/HostPowerDarwin.cpp
373
374VBoxSVC_SOURCES.win = \
375 src-server/win/svcmain.cpp \
376 src-server/win/svchlp.cpp \
377 src-server/win/HostPowerWin.cpp \
378 src-server/win/VBoxSVC.rc \
379 src-server/win/VBoxComEvents.cpp
380
381VBoxSVC_SOURCES.linux = \
382 src-server/linux/HostHardwareLinux.cpp
383
384VBoxSVC_SOURCES.solaris = \
385 src-server/linux/vbox-libhal.cpp \
386 src-server/solaris/DynLoadLibSolaris.cpp
387
388VBoxSVC_SOURCES.freebsd = \
389 src-server/freebsd/HostHardwareFreeBSD.cpp
390
391
392ifdef VBOX_WITH_USB
393 ifdef VBOX_WITH_SYSFS_BY_DEFAULT
394 src-server/linux/USBProxyServiceLinux.cpp_DEFS += VBOX_WITH_SYSFS_BY_DEFAULT
395 endif
396 VBoxSVC_SOURCES += \
397 src-server/USBDeviceFilterImpl.cpp \
398 src-server/USBProxyService.cpp \
399 src-server/HostUSBDeviceImpl.cpp
400 VBoxSVC_SOURCES.darwin += src-server/darwin/USBProxyServiceDarwin.cpp
401 VBoxSVC_SOURCES.linux += src-server/linux/USBProxyServiceLinux.cpp
402 VBoxSVC_SOURCES.linux += src-server/linux/USBGetDevices.cpp
403 VBoxSVC_SOURCES.os2 += src-server/os2/USBProxyServiceOs2.cpp
404 VBoxSVC_SOURCES.solaris += src-server/solaris/USBProxyServiceSolaris.cpp
405 VBoxSVC_SOURCES.win += src-server/win/USBProxyServiceWindows.cpp
406 VBoxSVC_SOURCES.freebsd += src-server/freebsd/USBProxyServiceFreeBSD.cpp
407endif
408
409ifdef VBOX_WITH_NETFLT
410 VBoxSVC_LIBS.win += \
411 $(PATH_STAGE_LIB)/WinNetConfig$(VBOX_SUFF_LIB) \
412 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
413 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/Newdev.lib \
414 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
415 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
416endif
417VBoxSVC_LDFLAGS.darwin = -framework IOKit -framework SystemConfiguration
418
419ifdef VBOX_WITH_CROGL
420 VBoxSVC_LIBS += $(PATH_STAGE_LIB)/VBoxOGLTest$(VBOX_SUFF_LIB)
421 VBoxSVC_LDFLAGS.darwin += -framework OpenGL
422endif
423
424ifeq ($(KBUILD_TYPE),debug)
425 VBoxSVC_LDFLAGS.linux += -rdynamic # for backtrace_symbols()
426endif
427
428ifdef VBOX_WITH_RESOURCE_USAGE_API
429 VBoxSVC_SOURCES += \
430 src-server/PerformanceImpl.cpp \
431 src-server/Performance.cpp
432 VBoxSVC_SOURCES.darwin += src-server/darwin/PerformanceDarwin.cpp
433 VBoxSVC_SOURCES.freebsd += src-server/freebsd/PerformanceFreeBSD.cpp
434 VBoxSVC_SOURCES.linux += src-server/linux/PerformanceLinux.cpp
435 VBoxSVC_SOURCES.os2 += src-server/os2/PerformanceOs2.cpp
436 VBoxSVC_SOURCES.solaris += src-server/solaris/PerformanceSolaris.cpp
437 VBoxSVC_SOURCES.win += src-server/win/PerformanceWin.cpp
438 VBoxSVC_LDFLAGS.darwin += -lproc
439 VBoxSVC_LDFLAGS.solaris += -lkstat -lnvpair
440 VBoxSVC_LDFLAGS.win += psapi.lib powrprof.lib
441endif
442
443ifdef VBOX_WITH_HOSTNETIF_API
444 VBoxSVC_SOURCES.win += src-server/win/NetIf-win.cpp
445 VBoxSVC_SOURCES.linux += src-server/linux/NetIf-linux.cpp
446 VBoxSVC_SOURCES.os2 += src-server/os2/NetIf-os2.cpp
447 VBoxSVC_SOURCES.darwin += src-server/darwin/NetIf-darwin.cpp
448 VBoxSVC_SOURCES.solaris += src-server/solaris/NetIf-solaris.cpp
449 VBoxSVC_SOURCES.freebsd += src-server/freebsd/NetIf-freebsd.cpp
450 VBoxSVC_DEFS += VBOX_WITH_HOSTNETIF_API
451 if1of ($(KBUILD_TARGET), linux darwin solaris freebsd)
452 VBoxSVC_SOURCES += src-server/generic/NetIf-generic.cpp
453 endif
454endif
455
456src-server/win/VBoxSVC.rc_INCS = $(VBoxSVC_0_OUTDIR)
457src-server/win/VBoxSVC.rc_DEPS = $(VBoxSVC_0_OUTDIR)/VBoxSVC.rgs $(VBoxSVC_0_OUTDIR)/VBoxSVC-icon.rc
458src-server/win/VBoxSVC.rc_CLEAN = $(VBoxSVC_0_OUTDIR)/VBoxSVC.rgs $(VBoxSVC_0_OUTDIR)/VBoxSVC-icon.rc
459
460$$(VBoxSVC_0_OUTDIR)/VBoxSVC-icon.rc: $(MAKEFILE_CURRENT) $(VBOX_WINDOWS_ICON_FILE) | $$(dir $$(@D))
461 $(APPEND) -t $@ '1 ICON DISCARDABLE "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
462
463$$(VBoxSVC_0_OUTDIR)/VBoxSVC.rgs: $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(dir $$(@D))
464 $(VBOX_XSLTPROC) --stringparam Module VBoxSVC -o $@ $< $(VBOX_XIDL_FILE)
465
466
467#
468# Embed some constraints from XML Schema file into VBoxSVC
469#
470VBOX_XML_SCHEMA = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings.xsd
471
472$(VBOX_XML_SCHEMADEFS_H): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA) | $$(dir $$@)
473 $(call MSG_GENERATE,SchemaDefs,$@,$<)
474 $(QUIET)$(VBOX_XSLTPROC) --stringparam mode declare -o $@ $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA)
475
476$(VBOX_XML_SCHEMADEFS_CPP): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA) | $$(dir $$@)
477 $(call MSG_GENERATE,SchemaDefs,$@,$<)
478 $(QUIET)$(VBOX_XSLTPROC) --stringparam mode define -o $@ $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA)
479
480testvalidsettings: $(VBOX_XML_SCHEMA)
481 xmllint --schema $< --noout $(HOME)/.VirtualBox/VirtualBox.xml
482 xmllint --schema $< --noout $(HOME)/.VirtualBox/Machines/*/*.xml
483 xmllint --schema $< --noout $(HOME)/.VirtualBox/Machines/*/*.vbox
484 xmllint --schema $< --noout $(HOME)/VirtualBox\ VMs/*/*.vbox
485
486OTHER_CLEAN += $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP)
487
488
489#
490# Generate some event stuff for VBoxSVC and VBoxC.
491#
492$(VBOX_AUTOGEN_EVENT_H): $(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
493 $(call MSG_TOOL,xsltproc,autogen events,$<,$@)
494 $(QUIET)$(VBOX_XSLTPROC) --stringparam G_kind VBoxEventHeader -o $@ $< $(VBOX_XIDL_FILE)
495
496$(VBOX_AUTOGEN_EVENT_CPP): $(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
497 $(call MSG_TOOL,xsltproc,autogen events,$<,$@)
498 $(QUIET)$(VBOX_XSLTPROC) --stringparam G_kind VBoxEvent -o $@ $< $(VBOX_XIDL_FILE)
499
500OTHER_CLEAN += $(VBOX_AUTOGEN_EVENT_H) $(VBOX_AUTOGEN_EVENT_CPP)
501
502ifdef VBOX_WITH_XPCOM
503#
504# VBoxSVCM - VBoxSVC wrapper module
505#
506DLLS += VBoxSVCM
507VBoxSVCM_TEMPLATE = VBOXMAINCOMP
508VBoxSVCM_DEFS = IN_RING3 $(VBOX_MAIN_DEFS)
509ifdef VBOX_WITH_HARDENING
510 VBoxSVCM_DEFS += VBOX_WITH_HARDENING
511endif
512VBoxSVCM_INCS = \
513 include \
514 $(VBoxC_0_OUTDIR) \
515 .
516VBoxSVCM_INTERMEDIATES = $(VBOX_MAIN_PREREQS)
517VBoxSVCM_SOURCES = \
518 src-server/xpcom/server_module.cpp
519VBoxSVCM_LDFLAGS.darwin = \
520 -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxSVCM.dylib \
521 -exported_symbols_list $(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def
522 ifeq ($(KBUILD_TARGET),darwin)
523VBoxSVCM_ORDERDEPS += $(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def
524VBoxSVCM_CLEAN += $(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def
525$$(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def:
526 $(RM) -f $@
527 $(APPEND) $@ _NSGetModule
528 endif
529VBoxSVCM_INTERMEDIATES += $(VBOX_IDL_HEADER.XPCOM)
530endif # VBOX_WITH_XPCOM
531
532
533#
534# VBoxC module
535#
536DLLS += VBoxC
537VBoxC_TEMPLATE = VBOXMAINCOMP
538VBoxC_DEFS = \
539 IN_RING3 \
540 $(VBOX_MAIN_DEFS) \
541 VBOX_COM_INPROC \
542 $(if $(VBOX_WITH_HGCM),VBOX_WITH_HGCM,) \
543 $(if $(VBOX_WITH_ALSA),VBOX_WITH_ALSA,) \
544 $(if $(VBOX_WITH_PULSE),VBOX_WITH_PULSE,) \
545 $(if $(VBOX_WITH_WINMM),VBOX_WITH_WINMM,) \
546 $(if $(VBOX_WITH_SOLARIS_OSS),VBOX_WITH_SOLARIS_OSS,) \
547 $(if $(VBOX_WITH_E1000),VBOX_WITH_E1000,) \
548 $(if $(VBOX_WITH_VIRTIO),VBOX_WITH_VIRTIO,) \
549 $(if $(VBOX_WITH_EFI),VBOX_WITH_EFI,) \
550 $(if $(VBOX_WITH_PDM_ASYNC_COMPLETION),VBOX_WITH_PDM_ASYNC_COMPLETION,) \
551 $(if $(VBOX_WITH_LIVE_MIGRATION),VBOX_WITH_LIVE_MIGRATION,) \
552 $(if $(VBOX_WITH_VUSB),VBOX_WITH_VUSB,) \
553 $(if $(VBOX_WITH_HGSMI),VBOX_WITH_HGSMI,) \
554 $(if $(VBOX_WITH_VIDEOHWACCEL),VBOX_WITH_VIDEOHWACCEL,) \
555 $(if $(VBOX_WITH_DRAG_AND_DROP),VBOX_WITH_DRAG_AND_DROP,) \
556 $(if $(VBOX_WITH_DRAG_AND_DROP_GH),VBOX_WITH_DRAG_AND_DROP_GH,) \
557 $(if $(VBOX_WITH_USB),VBOX_WITH_USB,) \
558 $(if-expr defined(VBOX_WITH_EHCI) && defined(VBOX_WITH_USB),VBOX_WITH_EHCI,) \
559 $(if $(VBOX_WITH_EXTPACK),VBOX_WITH_EXTPACK,) \
560 $(if $(VBOX_WITH_PCI_PASSTHROUGH),VBOX_WITH_PCI_PASSTHROUGH,) \
561 $(if $(VBOX_WITH_VPX),VBOX_WITH_VPX,)
562
563
564VBoxC_DEFS.darwin.x86 = VBOX_WITH_2X_4GB_ADDR_SPACE
565VBoxC_DEFS.win.x86 += _WIN32_WINNT=0x0500
566VBoxC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
567
568VBoxC_SDKS = VBOX_LIBPNG VBOX_ZLIB
569ifdef VBOX_WITH_VPX
570 VBoxC_SDKS += VBOX_VPX
571endif
572
573VBoxC_DEPS = $(filter %.h,$(VBoxAPIWrap_GENERATEDSOURCES))
574
575VBoxC_INCS = \
576 include \
577 $(VBoxC_0_OUTDIR) \
578 $(VBoxAPIWrap_0_OUTDIR) \
579 $(dir $(VBOX_XML_SCHEMADEFS_H))
580VBoxC_INCS.win = \
581 $(VBoxCOM_0_OUTDIR) \
582 .
583
584VBoxC_LDFLAGS.darwin = \
585 -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxC.dylib \
586 -exported_symbols_list $(VBoxC_0_OUTDIR)/VBoxC.def \
587 -framework IOKit
588VBoxC_LDFLAGS.win += /MANIFEST
589
590VBoxC_LIBS += \
591 $(if-expr "$(LIB_VMM)" == "$(VBOX_LIB_VMM_LAZY)",$(LIB_REM),) \
592 $(VBOX_LIB_VMM_LAZY)
593
594ifdef VBOX_WITH_NETFLT
595 VBoxC_LIBS.win += \
596 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
597 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/Newdev.lib \
598 $(PATH_STAGE_LIB)/WinNetConfig$(VBOX_SUFF_LIB) \
599 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
600 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib \
601 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib
602endif
603
604ifdef VBOX_WITH_CROGL
605 VBoxC_LIBS += $(PATH_STAGE_LIB)/VBoxOGLTest$(VBOX_SUFF_LIB)
606 VBoxC_LDFLAGS.darwin += -framework OpenGL
607endif
608
609
610VBoxC_INTERMEDIATES = \
611 $(VBOX_MAIN_PREREQS) \
612 $(VBOX_XML_SCHEMADEFS_H) \
613 $(VBOX_AUTOGEN_EVENT_H)
614
615VBoxC_SOURCES = \
616 src-all/DisplayPNGUtil.cpp \
617 src-all/DisplayResampleImage.cpp \
618 src-all/DisplayUtils.cpp \
619 src-all/EventImpl.cpp \
620 src-all/Global.cpp \
621 src-all/HashedPw.cpp \
622 src-all/Logging.cpp \
623 src-all/PCIDeviceAttachmentImpl.cpp \
624 src-all/ProgressImpl.cpp \
625 src-all/SharedFolderImpl.cpp \
626 src-all/VirtualBoxBase.cpp \
627 src-all/VirtualBoxErrorInfoImpl.cpp \
628 $(if $(VBOX_WITH_EXTPACK),src-all/ExtPackManagerImpl.cpp src-all/ExtPackUtil.cpp,) \
629 $(if $(VBOX_WITH_USB_VIDEO),src-client/UsbWebcamInterface.cpp,) \
630 $(if $(VBOX_WITH_USB_CARDREADER),src-client/UsbCardReader.cpp,) \
631 src-client/Nvram.cpp \
632 src-client/AdditionsFacilityImpl.cpp \
633 src-client/AudioSnifferInterface.cpp \
634 src-client/BusAssignmentManager.cpp \
635 $(if $(VBOX_WITH_PCI_PASSTHROUGH),src-client/PCIRawDevImpl.cpp,) \
636 src-client/ConsoleImpl.cpp \
637 src-client/ConsoleImpl2.cpp \
638 src-client/ConsoleImplTeleporter.cpp \
639 src-client/ConsoleVRDPServer.cpp \
640 src-client/DisplayImpl.cpp \
641 src-client/GuestImpl.cpp \
642 src-client/GuestDirectoryImpl.cpp \
643 src-client/GuestFileImpl.cpp \
644 src-client/GuestFsObjInfoImpl.cpp \
645 src-client/GuestProcessImpl.cpp \
646 src-client/GuestSessionImpl.cpp \
647 src-client/GuestCtrlImpl.cpp \
648 src-client/KeyboardImpl.cpp \
649 src-client/MachineDebuggerImpl.cpp \
650 src-client/MouseImpl.cpp \
651 src-client/RemoteUSBDeviceImpl.cpp \
652 src-client/SessionImpl.cpp \
653 src-client/USBDeviceImpl.cpp \
654 src-client/VBoxDriversRegister.cpp \
655 src-client/VirtualBoxClientImpl.cpp \
656 src-client/VMMDevInterface.cpp \
657 $(VBOX_AUTOGEN_EVENT_CPP) \
658 $(VBOX_XML_SCHEMADEFS_CPP)
659VBoxC_SOURCES.win = \
660 src-client/win/dllmain.cpp \
661 src-client/win/VBoxC.def \
662 src-client/win/VBoxC.rc
663
664ifdef VBOX_WITH_GUEST_CONTROL
665VBoxC_SOURCES += \
666 src-client/GuestSessionImplTasks.cpp \
667 src-client/GuestCtrlPrivate.cpp
668endif
669
670ifdef VBOX_WITH_DRAG_AND_DROP
671VBoxC_SOURCES += \
672 src-client/GuestDnDImpl.cpp
673endif
674
675ifdef VBOX_WITH_XPCOM
676VBoxC_SOURCES += \
677 src-client/xpcom/module.cpp
678endif
679
680ifdef VBOX_WITH_HGCM
681VBoxC_SOURCES += \
682 src-client/HGCMObjects.cpp \
683 src-client/HGCMThread.cpp \
684 src-client/HGCM.cpp
685endif
686
687ifdef VBOX_WITH_CRHGSMI
688VBoxC_DEFS += VBOX_WITH_CRHGSMI
689endif
690
691ifdef VBOX_WITH_USB
692VBoxC_SOURCES += \
693 src-client/RemoteUSBBackend.cpp
694endif
695
696ifdef VBOX_WITH_VPX
697VBoxC_SOURCES += \
698 src-client/EbmlWriter.cpp \
699 src-client/VideoRec.cpp
700endif
701
702ifdef VBOX_WITH_NETSHAPER
703VBoxC_DEFS += VBOX_WITH_NETSHAPER
704endif
705
706ifeq ($(KBUILD_TARGET),darwin)
707VBoxC_ORDERDEPS += $(VBoxC_0_OUTDIR)/VBoxC.def
708VBoxC_CLEAN += $(VBoxC_0_OUTDIR)/VBoxC.def
709$$(VBoxC_0_OUTDIR)/VBoxC.def: $(MAKEFILE_CURRENT)
710 $(RM) -f $@
711 $(APPEND) $@ _NSGetModule
712 $(APPEND) $@ _VBoxDriversRegister
713endif
714
715src-client/ConsoleImpl.cpp_DEFS = \
716 $(if $(VBOX_BLEEDING_EDGE),VBOX_BLEEDING_EDGE=\"$(VBOX_BLEEDING_EDGE)\",)
717
718
719src-client/win/VBoxC.rc_DEPS = $(VBoxC_0_OUTDIR)/VBoxC.rgs $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb
720VBoxC_CLEAN.win += $(VBoxC_0_OUTDIR)/VBoxC.rgs
721
722$$(VBoxC_0_OUTDIR)/VBoxC.rgs: $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
723 $(VBOX_XSLTPROC) --stringparam Module VBoxC -o $@ $< $(VBOX_XIDL_FILE)
724
725
726#
727# VBoxCOM - COM Abstraction Layer library
728#
729LIBRARIES += VBoxCOM
730VBoxCOM_TEMPLATE = VBOXMAINLIB
731VBoxCOM_INTERMEDIATES = $(VBOX_MAIN_PREREQS)
732VBoxCOM_SOURCES = \
733 glue/com.cpp \
734 glue/initterm.cpp \
735 glue/string.cpp \
736 glue/AutoLock.cpp \
737 glue/EventQueue.cpp \
738 glue/NativeEventQueue.cpp \
739 glue/ErrorInfo.cpp \
740 glue/errorprint.cpp
741VBoxCOM_INCS += \
742 include
743ifeq ($(KBUILD_TARGET),win)
744 VBoxCOM_DEFS.x86 += _WIN32_WINNT=0x0500
745 VBoxCOM_DEFS.amd64 += _WIN32_WINNT=0x0510
746 VBoxCOM_SOURCES += \
747 $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c
748else # !win
749 VBoxCOM_SOURCES += \
750 glue/xpcom/helpers.cpp
751endif # !win
752
753glue/com.cpp_DEFS = \
754 $(if $(VBOX_BLEEDING_EDGE),VBOX_BLEEDING_EDGE=\"$(VBOX_BLEEDING_EDGE)\",)
755
756
757#
758# The VBoxExtPackHelperApp.
759#
760ifdef VBOX_WITH_EXTPACK
761 PROGRAMS += VBoxExtPackHelperApp
762 VBoxExtPackHelperApp_TEMPLATE = VBoxR3SetUidToRoot
763 VBoxExtPackHelperApp_LDFLAGS.darwin = -framework Security
764 VBoxExtPackHelperApp_LDFLAGS.win = /SUBSYSTEM:windows
765 VBoxExtPackHelperApp_SOURCES = \
766 src-helper-apps/VBoxExtPackHelperApp.cpp \
767 src-all/ExtPackUtil.cpp
768 VBoxExtPackHelperApp_LIBS = \
769 $(LIB_RUNTIME)
770endif # VBOX_WITH_EXTPACK
771
772
773endif # !VBOX_ONLY_SDK (the ifndef is far above)
774
775
776#
777# Installs com related thing(s) to bin.
778#
779INSTALLS.win += VBoxMain-com-inst
780VBoxMain-com-inst_INST = $(INST_BIN)
781VBoxMain-com-inst_MODE = a+r,u+w
782VBoxMain-com-inst_SOURCES = src-all/win/comregister.cmd
783
784
785if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "linux"
786 #
787 # Installs linux/hardening related things to components.
788 #
789 INSTALLS.linux += VBoxMain-hardening-inst
790 VBoxMain-hardening-inst_INST = $(INST_BIN)components/
791 VBoxMain-hardening-inst_SYMLINKS = \
792 VBoxDDU.so=>../VBoxDDU.so \
793 VBoxREM.so=>../VBoxREM.so \
794 VBoxRT.so=>../VBoxRT.so \
795 VBoxVMM.so=>../VBoxVMM.so \
796 VBoxXPCOM.so=>../VBoxXPCOM.so
797endif
798
799
800# generate rules
801include $(FILE_KBUILD_SUB_FOOTER)
802
803
804
805#
806# Additions rules.
807#
808
809## @todo this hack ain't cutting it any longer. (the file name is abspath'ed since ages now.)
810glue/xpcom/helpers.cpp: $(VBOX_IDL_TYPELIB.XPCOM)
811
812$(VBOX_IDL_FILE.XPCOM): $(VBOX_PATH_MAIN_SRC)/idl/xpidl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
813 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
814 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
815
816$(VBOX_IDL_TYPELIB.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
817 $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
818 $(QUIET)$(VBOX_XPIDL_ENV)$(VBOX_XPIDL) -m typelib -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
819 $(CHMOD) 0644 $@
820## @todo ^^^^^^^^^^^^ fix horrible hack
821
822$(VBOX_IDL_HEADER.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
823 $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
824 $(QUIET)$(VBOX_XPIDL_ENV)$(VBOX_XPIDL) -m header -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
825
826$(VBOX_IDL_FILE.MSCOM): $(VBOX_PATH_MAIN_SRC)/idl/midl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
827 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
828 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
829
830# Aliases for testing purposes.
831ifdef VBOX_WITH_XPCOM
832testidl: $(VBOX_IDL_FILE.XPCOM) $(VBOX_IDL_TYPELIB.XPCOM)
833testidlhdr: $(VBOX_IDL_HEADER.XPCOM)
834else
835testidl: $(VBOX_IDL_FILE.MSCOM) $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c
836endif
837
838
839$(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
840+ $(VBoxCOM_0_OUTDIR)/VirtualBox.h \
841+ $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb: $(VBOX_IDL_FILE.MSCOM) | $$(dir $$@)
842 $(VBOX_WIN_MIDL) /nologo \
843 /out $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxCOM_0_OUTDIR)) \
844 /cpp_cmd $(subst $(EXEC_X86_WIN32),,$(call VBOX_FN_MAKE_WIN_PATH,$(TOOL_$(VBOX_VCC_TOOL)_CC))) \
845 /I $(call VBOX_FN_MAKE_WIN_PATH,$(PATH_SDK_$(VBOX_WINPSDK)_INC)) \
846 /I idl \
847 $(call VBOX_FN_MAKE_WIN_PATH,$<)
848
849#
850# Translation stuff
851#
852VBoxSVC_VBOX_HEADERS = \
853 include/collection.h \
854 include/MachineImpl.h
855VBoxSVC_VBOX_TRANSLATIONS = \
856 nls/VBoxSVC_de.ts
857
858VBoxC_VBOX_HEADERS = \
859 include/ConsoleImpl.h
860VBoxC_VBOX_TRANSLATIONS = \
861 nls/VBoxC_de.ts
862
863ifdef VBOX_WITH_JMSCOM
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
875INSTALLS += VBoxJMscom-inst-jar
876VBoxJMscom-inst-jar_INST = $(INST_SDK)bindings/mscom/java/
877VBoxJMscom-inst-jar_MODE = a+r,u+w
878VBoxJMscom-inst-jar_SOURCES = \
879 $(VBOX_JMSCOM_JAR)
880VBoxJMscom-inst-jar_CLEAN = \
881 $(VBOX_JMSCOM_JAR) \
882 $(VBOX_JMSCOM_GEN)/jmscomglue.list \
883 $(wildcard \
884 $(VBOX_JMSCOM_GEN)/java/*.java \
885 $(VBOX_JMSCOM_JDEST)/*.class \
886 $(VBOX_JMSCOM_JDEST)/*/*.class \
887 $(VBOX_JMSCOM_JDEST)/*/*/*.class \
888 $(VBOX_JMSCOM_JDEST)/*/*/*/*.class \
889 )
890VBoxJMscom-inst-jar_BLDDIRS += $(VBOX_JMSCOM_GEN)/java
891
892$(VBOX_JMSCOM_GEN)/jmscomglue.list: \
893 $(VBOX_XIDL_FILE) \
894 $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl \
895 $(VBOX_FILESPLIT) \
896 | $(VBOX_JMSCOM_GEN)/java/
897 $(call MSG_L1,Generating Java MSCOM glue files from XIDL)
898 $(QUIET)$(RM) -f $(wildcard $(VBOX_JMSCOM_GEN)/java/*.java)
899 $(QUIET)$(VBOX_XSLTPROC) \
900 --stringparam G_vboxApiSuffix $(VBOX_API_SUFFIX) \
901 --stringparam G_vboxGlueStyle mscom \
902 --stringparam G_vboxDirPrefix "" \
903 -o $(VBOX_JMSCOM_GEN)/java/merged.file $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl $<
904 $(QUIET)$(VBOX_FILESPLIT) $(VBOX_JMSCOM_GEN)/java/merged.file $(VBOX_JMSCOM_GEN)/java
905 $(QUIET)echo $(VBOX_JMSCOM_GEN)/java/*.java > $@
906
907$$(VBOX_JMSCOM_JAR): $(VBOX_JMSCOM_GEN)/jmscomglue.list | $$(dir $$@)
908 $(call MSG_TOOL,javac,$(notdir $@),jmscomgen.list,)
909 $(QUIET)$(RM) -Rf $(VBOX_JMSCOM_JDEST)
910 $(QUIET)$(MKDIR) -p $(VBOX_JMSCOM_JDEST)
911 $(call MSG_TOOL,javac,$(notdir $@),...,)
912 $(VBOX_JAVAC) $(VBOX_JAVAC_OPTS) \
913 @$(VBOX_JMSCOM_GEN)/jmscomglue.list \
914 -d $(VBOX_JMSCOM_JDEST) -classpath $(VBOX_JMSCOM_JDEST)$(VBOX_SEP)$(VBOX_JACOB_DIR)/jacob.jar
915 $(call MSG_LINK,$(notdir $@),$@)
916 $(VBOX_JAR) cf $@ -C $(VBOX_JMSCOM_JDEST) .
917
918## @todo compile TestVBox.java (see below) to have sanity checking
919
920endif # VBOX_WITH_JMSCOM
921
922#
923# Install Java glue sample code.
924#
925INSTALLS += javagluesample
926javagluesample_INST = $(INST_SDK)bindings/glue/java/
927javagluesample_MODE = a+r,u+w
928javagluesample_SOURCES = \
929 $(VBOX_PATH_MAIN_SRC)/glue/tests/TestVBox.java=>TestVBox.java \
930 $(VBOX_PATH_MAIN_SRC)/glue/tests/Makefile=>Makefile
931
932# moved those rules to the end so that VBoxAPIWrap_0_OUTDIR can be expanded without $$ trickery
933$(VBoxAPIWrap_RAWSRC) \
934+| $(VBoxAPIWrap_GENERATEDSOURCES): \
935 $(VBOX_XIDL_FILE) \
936 $(VBoxAPIWrap_XSLT) \
937 $(VBOX_FILESPLIT) \
938 | $$(dir $$@)
939 $(call MSG_L1,Generating C++ Server API wrapper files from XIDL)
940 $(QUIET)$(RM) -f $(filter-out $(VBoxAPIWrap_GENERATEDSOURCES),$(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.cpp) $(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.h))
941 $(QUIET)$(VBOX_XSLTPROC) --stringparam filelistonly "" -o $@ $(VBoxAPIWrap_XSLT) $<
942 $(QUIET)$(VBOX_FILESPLIT) $@ $(VBoxAPIWrap_0_OUTDIR)
943
944$(VBoxAPIWrap_KMK).ts +| $(VBoxAPIWrap_KMK): $(VBOX_XIDL_FILE) $(VBoxAPIWrap_XSLT)
945 $(call MSG_GENERATE,,$(VBoxAPIWrap_KMK))
946 $(QUIET)$(RM) -f $@
947 $(QUIET)$(MKDIR) -p $(@D)
948 $(QUIET)$(VBOX_XSLTPROC) --stringparam filelistonly VBoxAPIWrap_VBOX_APIWRAPPERFILES -o $@ $(VBoxAPIWrap_XSLT) $<
949 $(QUIET)$(CP) --changed -fv $@ $(VBoxAPIWrap_KMK)
950
951updatenls::
952 $(VBOX_LUPDATE) $(VBoxSVC_SOURCES) $(VBoxSVC_VBOX_HEADERS) -ts $(VBoxSVC_VBOX_TRANSLATIONS)
953 $(VBOX_LUPDATE) $(VBoxC_SOURCES) $(VBoxC_VBOX_HEADERS) -ts $(VBoxC_VBOX_TRANSLATIONS)
954
955testconverter:: $(VBOX_USER_HOME)/VirtualBox.xml
956 $(call MSG_TOOL,xsltproc,Test Settings Converter,$<,$(VBOX_USER_HOME)/VirtualBox.xml.test)
957 $(QUIET)$(VBOX_XSLTPROC) -o $(VBOX_USER_HOME)/VirtualBox.xml.test xml/SettingsConverter.xsl $<
958
959testconverter2:: $(VBOX_USER_HOME)/Machines/dos/dos.xml
960 $(call MSG_TOOL,xsltproc,Test Settings Converter,$<,$<.test)
961 $(QUIET)$(VBOX_XSLTPROC) -o $<.test xml/SettingsConverter.xsl $<
962
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