VirtualBox

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

Last change on this file since 45546 was 45518, checked in by vboxsync, 12 years ago

Main: Code generator for (xp)com API implementations, including logging and parameter conversion, so far only used by MediumFormat. Next try, needed significant tweaks to work with xpcom (safearray handling fixes in the parameter conversion helpers), different STL implementation (which doesn't support declaring template type parameters as const), missing build dependencies (which didn't show on the dual core system used for writing the code), and finally the duplicate XPCOM classinfo and AddRef/Release/QueryInterface method definitions needed to be removed.

  • 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 45518 2013-04-12 12:01:02Z 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/DHCPServerRunner.cpp \
338 src-server/NATNetworkImpl.cpp \
339 $(if $(VBOX_WITH_NAT_SERVICE),src-server/NATNetworkServiceRunner.cpp,) \
340 src-server/GuestOSTypeImpl.cpp \
341 src-server/HostImpl.cpp \
342 src-server/HostNetworkInterfaceImpl.cpp \
343 src-server/HostPower.cpp \
344 src-server/MachineImpl.cpp \
345 src-server/MachineImplCloneVM.cpp \
346 src-server/Matching.cpp \
347 src-server/MediumAttachmentImpl.cpp \
348 src-server/MediumFormatImpl.cpp \
349 src-server/MediumImpl.cpp \
350 src-server/MediumLock.cpp \
351 src-server/NATEngineImpl.cpp \
352 src-server/NetworkAdapterImpl.cpp \
353 src-server/ParallelPortImpl.cpp \
354 src-server/ProgressProxyImpl.cpp \
355 src-server/SerialPortImpl.cpp \
356 src-server/SnapshotImpl.cpp \
357 src-server/StorageControllerImpl.cpp \
358 src-server/SystemPropertiesImpl.cpp \
359 src-server/USBControllerImpl.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
568ifdef VBOX_WITH_VPX
569 VBoxC_SDKS = VBOX_LIBPNG VBOX_ZLIB VBOX_VPX
570else
571 VBoxC_SDKS = VBOX_LIBPNG VBOX_ZLIB
572endif
573
574VBoxC_DEPS = $(filter %.h,$(VBoxAPIWrap_GENERATEDSOURCES))
575
576VBoxC_INCS = \
577 include \
578 $(VBoxC_0_OUTDIR) \
579 $(VBoxAPIWrap_0_OUTDIR) \
580 $(dir $(VBOX_XML_SCHEMADEFS_H))
581VBoxC_INCS.win = \
582 $(VBoxCOM_0_OUTDIR) \
583 .
584
585VBoxC_LDFLAGS.darwin = \
586 -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxC.dylib \
587 -exported_symbols_list $(VBoxC_0_OUTDIR)/VBoxC.def \
588 -framework IOKit
589VBoxC_LDFLAGS.win += /DELAYLOAD:VBoxVMM.dll /MANIFEST
590
591VBoxC_LIBS += \
592 $(LIB_VMM) \
593 $(LIB_REM)
594
595ifdef VBOX_WITH_NETFLT
596 VBoxC_LIBS.win += \
597 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
598 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/Newdev.lib \
599 $(PATH_STAGE_LIB)/WinNetConfig$(VBOX_SUFF_LIB) \
600 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
601 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib \
602 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib
603endif
604
605ifdef VBOX_WITH_CROGL
606 VBoxC_LIBS += $(PATH_STAGE_LIB)/VBoxOGLTest$(VBOX_SUFF_LIB)
607 VBoxC_LDFLAGS.darwin += -framework OpenGL
608endif
609
610
611VBoxC_INTERMEDIATES = \
612 $(VBOX_MAIN_PREREQS) \
613 $(VBOX_XML_SCHEMADEFS_H) \
614 $(VBOX_AUTOGEN_EVENT_H)
615
616VBoxC_SOURCES = \
617 src-all/DisplayPNGUtil.cpp \
618 src-all/DisplayResampleImage.cpp \
619 src-all/DisplayUtils.cpp \
620 src-all/EventImpl.cpp \
621 src-all/Global.cpp \
622 src-all/HashedPw.cpp \
623 src-all/Logging.cpp \
624 src-all/PCIDeviceAttachmentImpl.cpp \
625 src-all/ProgressImpl.cpp \
626 src-all/SharedFolderImpl.cpp \
627 src-all/VirtualBoxBase.cpp \
628 src-all/VirtualBoxErrorInfoImpl.cpp \
629 $(if $(VBOX_WITH_EXTPACK),src-all/ExtPackManagerImpl.cpp src-all/ExtPackUtil.cpp,) \
630 $(if $(VBOX_WITH_USB_VIDEO),src-client/UsbWebcamInterface.cpp,) \
631 $(if $(VBOX_WITH_USB_CARDREADER),src-client/UsbCardReader.cpp,) \
632 src-client/Nvram.cpp \
633 src-client/AdditionsFacilityImpl.cpp \
634 src-client/AudioSnifferInterface.cpp \
635 src-client/BusAssignmentManager.cpp \
636 $(if $(VBOX_WITH_PCI_PASSTHROUGH),src-client/PCIRawDevImpl.cpp,) \
637 src-client/ConsoleImpl.cpp \
638 src-client/ConsoleImpl2.cpp \
639 src-client/ConsoleImplTeleporter.cpp \
640 src-client/ConsoleVRDPServer.cpp \
641 src-client/DisplayImpl.cpp \
642 src-client/GuestImpl.cpp \
643 src-client/GuestDirectoryImpl.cpp \
644 src-client/GuestErrorInfoImpl.cpp \
645 src-client/GuestFileImpl.cpp \
646 src-client/GuestFsObjInfoImpl.cpp \
647 src-client/GuestProcessImpl.cpp \
648 src-client/GuestSessionImpl.cpp \
649 src-client/GuestCtrlImpl.cpp \
650 src-client/KeyboardImpl.cpp \
651 src-client/MachineDebuggerImpl.cpp \
652 src-client/MouseImpl.cpp \
653 src-client/RemoteUSBDeviceImpl.cpp \
654 src-client/SessionImpl.cpp \
655 src-client/USBDeviceImpl.cpp \
656 src-client/VBoxDriversRegister.cpp \
657 src-client/VirtualBoxClientImpl.cpp \
658 src-client/VMMDevInterface.cpp \
659 $(VBOX_AUTOGEN_EVENT_CPP) \
660 $(VBOX_XML_SCHEMADEFS_CPP)
661VBoxC_SOURCES.win = \
662 src-client/win/dllmain.cpp \
663 src-client/win/VBoxC.def \
664 src-client/win/VBoxC.rc
665
666ifdef VBOX_WITH_GUEST_CONTROL
667VBoxC_SOURCES += \
668 src-client/GuestSessionImplTasks.cpp \
669 src-client/GuestCtrlPrivate.cpp
670endif
671
672ifdef VBOX_WITH_DRAG_AND_DROP
673VBoxC_SOURCES += \
674 src-client/GuestDnDImpl.cpp
675endif
676
677ifdef VBOX_WITH_XPCOM
678VBoxC_SOURCES += \
679 src-client/xpcom/module.cpp
680endif
681
682ifdef VBOX_WITH_HGCM
683VBoxC_SOURCES += \
684 src-client/HGCMObjects.cpp \
685 src-client/HGCMThread.cpp \
686 src-client/HGCM.cpp
687endif
688
689ifdef VBOX_WITH_CRHGSMI
690VBoxC_DEFS += VBOX_WITH_CRHGSMI
691endif
692
693ifdef VBOX_WITH_USB
694VBoxC_SOURCES += \
695 src-client/RemoteUSBBackend.cpp
696endif
697
698ifdef VBOX_WITH_VPX
699VBoxC_SOURCES += \
700 src-client/EbmlWriter.cpp \
701 src-client/VideoRec.cpp
702endif
703
704ifdef VBOX_WITH_NETSHAPER
705VBoxC_DEFS += VBOX_WITH_NETSHAPER
706endif
707
708ifeq ($(KBUILD_TARGET),darwin)
709VBoxC_ORDERDEPS += $(VBoxC_0_OUTDIR)/VBoxC.def
710VBoxC_CLEAN += $(VBoxC_0_OUTDIR)/VBoxC.def
711$$(VBoxC_0_OUTDIR)/VBoxC.def: $(MAKEFILE_CURRENT)
712 $(RM) -f $@
713 $(APPEND) $@ _NSGetModule
714 $(APPEND) $@ _VBoxDriversRegister
715endif
716
717src-client/ConsoleImpl.cpp_DEFS = \
718 $(if $(VBOX_BLEEDING_EDGE),VBOX_BLEEDING_EDGE=\"$(VBOX_BLEEDING_EDGE)\",)
719
720
721src-client/win/VBoxC.rc_DEPS = $(VBoxC_0_OUTDIR)/VBoxC.rgs $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb
722VBoxC_CLEAN.win += $(VBoxC_0_OUTDIR)/VBoxC.rgs
723
724$$(VBoxC_0_OUTDIR)/VBoxC.rgs: $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
725 $(VBOX_XSLTPROC) --stringparam Module VBoxC -o $@ $< $(VBOX_XIDL_FILE)
726
727
728#
729# VBoxCOM - COM Abstraction Layer library
730#
731LIBRARIES += VBoxCOM
732VBoxCOM_TEMPLATE = VBOXMAINLIB
733VBoxCOM_INTERMEDIATES = $(VBOX_MAIN_PREREQS)
734VBoxCOM_SOURCES = \
735 glue/com.cpp \
736 glue/initterm.cpp \
737 glue/string.cpp \
738 glue/AutoLock.cpp \
739 glue/EventQueue.cpp \
740 glue/ErrorInfo.cpp \
741 glue/errorprint.cpp
742VBoxCOM_INCS += \
743 include
744ifeq ($(KBUILD_TARGET),win)
745 VBoxCOM_DEFS.x86 += _WIN32_WINNT=0x0500
746 VBoxCOM_DEFS.amd64 += _WIN32_WINNT=0x0510
747 VBoxCOM_SOURCES += \
748 $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c
749else # !win
750 VBoxCOM_SOURCES += \
751 glue/xpcom/helpers.cpp
752endif # !win
753
754glue/com.cpp_DEFS = \
755 $(if $(VBOX_BLEEDING_EDGE),VBOX_BLEEDING_EDGE=\"$(VBOX_BLEEDING_EDGE)\",)
756
757
758#
759# The VBoxExtPackHelperApp.
760#
761ifdef VBOX_WITH_EXTPACK
762 PROGRAMS += VBoxExtPackHelperApp
763 VBoxExtPackHelperApp_TEMPLATE = VBoxR3SetUidToRoot
764 VBoxExtPackHelperApp_LDFLAGS.darwin = -framework Security
765 VBoxExtPackHelperApp_LDFLAGS.win = /SUBSYSTEM:windows
766 VBoxExtPackHelperApp_SOURCES = \
767 src-helper-apps/VBoxExtPackHelperApp.cpp \
768 src-all/ExtPackUtil.cpp
769 VBoxExtPackHelperApp_LIBS = \
770 $(LIB_RUNTIME)
771endif # VBOX_WITH_EXTPACK
772
773
774endif # !VBOX_ONLY_SDK (the ifndef is far above)
775
776
777#
778# Installs com related thing(s) to bin.
779#
780INSTALLS.win += VBoxMain-com-inst
781VBoxMain-com-inst_INST = $(INST_BIN)
782VBoxMain-com-inst_MODE = a+r,u+w
783VBoxMain-com-inst_SOURCES = src-all/win/comregister.cmd
784
785
786if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "linux"
787 #
788 # Installs linux/hardening related things to components.
789 #
790 INSTALLS.linux += VBoxMain-hardening-inst
791 VBoxMain-hardening-inst_INST = $(INST_BIN)components/
792 VBoxMain-hardening-inst_SYMLINKS = \
793 VBoxDDU.so=>../VBoxDDU.so \
794 VBoxREM.so=>../VBoxREM.so \
795 VBoxRT.so=>../VBoxRT.so \
796 VBoxVMM.so=>../VBoxVMM.so \
797 VBoxXPCOM.so=>../VBoxXPCOM.so
798endif
799
800
801# generate rules
802include $(FILE_KBUILD_SUB_FOOTER)
803
804
805
806#
807# Additions rules.
808#
809
810## @todo this hack ain't cutting it any longer. (the file name is abspath'ed since ages now.)
811glue/xpcom/helpers.cpp: $(VBOX_IDL_TYPELIB.XPCOM)
812
813$(VBOX_IDL_FILE.XPCOM): $(VBOX_PATH_MAIN_SRC)/idl/xpidl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
814 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
815 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
816
817$(VBOX_IDL_TYPELIB.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
818 $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
819 $(QUIET)$(VBOX_XPIDL_ENV)$(VBOX_XPIDL) -m typelib -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
820 $(CHMOD) 0644 $@
821## @todo ^^^^^^^^^^^^ fix horrible hack
822
823$(VBOX_IDL_HEADER.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
824 $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
825 $(QUIET)$(VBOX_XPIDL_ENV)$(VBOX_XPIDL) -m header -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
826
827$(VBOX_IDL_FILE.MSCOM): $(VBOX_PATH_MAIN_SRC)/idl/midl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
828 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
829 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
830
831# Aliases for testing purposes.
832ifdef VBOX_WITH_XPCOM
833testidl: $(VBOX_IDL_FILE.XPCOM) $(VBOX_IDL_TYPELIB.XPCOM)
834testidlhdr: $(VBOX_IDL_HEADER.XPCOM)
835else
836testidl: $(VBOX_IDL_FILE.MSCOM) $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c
837endif
838
839
840$(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
841+ $(VBoxCOM_0_OUTDIR)/VirtualBox.h \
842+ $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb: $(VBOX_IDL_FILE.MSCOM) | $$(dir $$@)
843 $(VBOX_WIN_MIDL) /nologo \
844 /out $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxCOM_0_OUTDIR)) \
845 /cpp_cmd $(subst $(EXEC_X86_WIN32),,$(call VBOX_FN_MAKE_WIN_PATH,$(TOOL_$(VBOX_VCC_TOOL)_CC))) \
846 /I $(call VBOX_FN_MAKE_WIN_PATH,$(PATH_SDK_$(VBOX_WINPSDK)_INC)) \
847 /I idl \
848 $(call VBOX_FN_MAKE_WIN_PATH,$<)
849
850#
851# Translation stuff
852#
853VBoxSVC_VBOX_HEADERS = \
854 include/collection.h \
855 include/MachineImpl.h
856VBoxSVC_VBOX_TRANSLATIONS = \
857 nls/VBoxSVC_de.ts
858
859VBoxC_VBOX_HEADERS = \
860 include/ConsoleImpl.h
861VBoxC_VBOX_TRANSLATIONS = \
862 nls/VBoxC_de.ts
863
864ifdef VBOX_WITH_JMSCOM
865
866#
867# Java glue JAR files
868#
869VBOX_JMSCOM_JAR = $(VBoxJMscom-inst-jar_0_OUTDIR)/vboxjmscom.jar
870VBOX_JMSCOM_TARGET := $(PATH_TARGET)/vboxjmscom-gen
871VBOX_JMSCOM_GEN = $(VBOX_JMSCOM_TARGET)/jmscomgen
872VBOX_JMSCOM_JDEST := $(VBOX_JMSCOM_TARGET)/jdest
873VBOX_GLUE_XSLT_DIR := $(PATH_ROOT)/src/VBox/Main/glue
874VBOX_JACOB_DIR := $(PATH_ROOT)/src/libs/jacob-1.15-M3
875
876INSTALLS += VBoxJMscom-inst-jar
877VBoxJMscom-inst-jar_INST = $(INST_SDK)bindings/mscom/java/
878VBoxJMscom-inst-jar_MODE = a+r,u+w
879VBoxJMscom-inst-jar_SOURCES = \
880 $(VBOX_JMSCOM_JAR)
881VBoxJMscom-inst-jar_CLEAN = \
882 $(VBOX_JMSCOM_JAR) \
883 $(VBOX_JMSCOM_GEN)/jmscomglue.list \
884 $(wildcard \
885 $(VBOX_JMSCOM_GEN)/java/*.java \
886 $(VBOX_JMSCOM_JDEST)/*.class \
887 $(VBOX_JMSCOM_JDEST)/*/*.class \
888 $(VBOX_JMSCOM_JDEST)/*/*/*.class \
889 $(VBOX_JMSCOM_JDEST)/*/*/*/*.class \
890 )
891VBoxJMscom-inst-jar_BLDDIRS += $(VBOX_JMSCOM_GEN)/java
892
893$(VBOX_JMSCOM_GEN)/jmscomglue.list: \
894 $(VBOX_XIDL_FILE) \
895 $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl \
896 $(VBOX_FILESPLIT) \
897 | $(VBOX_JMSCOM_GEN)/java/
898 $(call MSG_L1,Generating Java MSCOM glue files from XIDL)
899 $(QUIET)$(RM) -f $(wildcard $(VBOX_JMSCOM_GEN)/java/*.java)
900 $(QUIET)$(VBOX_XSLTPROC) \
901 --stringparam G_vboxApiSuffix $(VBOX_API_SUFFIX) \
902 --stringparam G_vboxGlueStyle mscom \
903 --stringparam G_vboxDirPrefix "" \
904 -o $(VBOX_JMSCOM_GEN)/java/merged.file $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl $<
905 $(QUIET)$(VBOX_FILESPLIT) $(VBOX_JMSCOM_GEN)/java/merged.file $(VBOX_JMSCOM_GEN)/java
906 $(QUIET)echo $(VBOX_JMSCOM_GEN)/java/*.java > $@
907
908$$(VBOX_JMSCOM_JAR): $(VBOX_JMSCOM_GEN)/jmscomglue.list | $$(dir $$@)
909 $(call MSG_TOOL,javac,$(notdir $@),jmscomgen.list,)
910 $(QUIET)$(RM) -Rf $(VBOX_JMSCOM_JDEST)
911 $(QUIET)$(MKDIR) -p $(VBOX_JMSCOM_JDEST)
912 $(call MSG_TOOL,javac,$(notdir $@),...,)
913 $(VBOX_JAVAC) $(VBOX_JAVAC_OPTS) \
914 @$(VBOX_JMSCOM_GEN)/jmscomglue.list \
915 -d $(VBOX_JMSCOM_JDEST) -classpath $(VBOX_JMSCOM_JDEST)$(VBOX_SEP)$(VBOX_JACOB_DIR)/jacob.jar
916 $(call MSG_LINK,$(notdir $@),$@)
917 $(VBOX_JAR) cf $@ -C $(VBOX_JMSCOM_JDEST) .
918
919## @todo compile TestVBox.java (see below) to have sanity checking
920
921endif # VBOX_WITH_JMSCOM
922
923#
924# Install Java glue sample code.
925#
926INSTALLS += javagluesample
927javagluesample_INST = $(INST_SDK)bindings/glue/java/
928javagluesample_MODE = a+r,u+w
929javagluesample_SOURCES = \
930 $(VBOX_PATH_MAIN_SRC)/glue/tests/TestVBox.java=>TestVBox.java \
931 $(VBOX_PATH_MAIN_SRC)/glue/tests/Makefile=>Makefile
932
933# moved those rules to the end so that VBoxAPIWrap_0_OUTDIR can be expanded without $$ trickery
934$(VBoxAPIWrap_RAWSRC) \
935+| $(VBoxAPIWrap_GENERATEDSOURCES): \
936 $(VBOX_XIDL_FILE) \
937 $(VBoxAPIWrap_XSLT) \
938 $(VBOX_FILESPLIT) \
939 | $$(dir $$@)
940 $(call MSG_L1,Generating C++ Server API wrapper files from XIDL)
941 $(QUIET)$(RM) -f $(filter-out $(VBoxAPIWrap_GENERATEDSOURCES),$(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.cpp) $(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.h))
942 $(QUIET)$(VBOX_XSLTPROC) --stringparam filelistonly "" -o $@ $(VBoxAPIWrap_XSLT) $<
943 $(QUIET)$(VBOX_FILESPLIT) $@ $(VBoxAPIWrap_0_OUTDIR)
944
945$(VBoxAPIWrap_KMK).ts +| $(VBoxAPIWrap_KMK): $(VBOX_XIDL_FILE) $(VBoxAPIWrap_XSLT)
946 $(call MSG_GENERATE,,$(VBoxAPIWrap_KMK))
947 $(QUIET)$(RM) -f $@
948 $(QUIET)$(MKDIR) -p $(@D)
949 $(QUIET)$(VBOX_XSLTPROC) --stringparam filelistonly VBoxAPIWrap_VBOX_APIWRAPPERFILES -o $@ $(VBoxAPIWrap_XSLT) $<
950 $(QUIET)$(CP) --changed -fv $@ $(VBoxAPIWrap_KMK)
951
952updatenls::
953 $(VBOX_LUPDATE) $(VBoxSVC_SOURCES) $(VBoxSVC_VBOX_HEADERS) -ts $(VBoxSVC_VBOX_TRANSLATIONS)
954 $(VBOX_LUPDATE) $(VBoxC_SOURCES) $(VBoxC_VBOX_HEADERS) -ts $(VBoxC_VBOX_TRANSLATIONS)
955
956testconverter:: $(VBOX_USER_HOME)/VirtualBox.xml
957 $(call MSG_TOOL,xsltproc,Test Settings Converter,$<,$(VBOX_USER_HOME)/VirtualBox.xml.test)
958 $(QUIET)$(VBOX_XSLTPROC) -o $(VBOX_USER_HOME)/VirtualBox.xml.test xml/SettingsConverter.xsl $<
959
960testconverter2:: $(VBOX_USER_HOME)/Machines/dos/dos.xml
961 $(call MSG_TOOL,xsltproc,Test Settings Converter,$<,$<.test)
962 $(QUIET)$(VBOX_XSLTPROC) -o $<.test xml/SettingsConverter.xsl $<
963
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