VirtualBox

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

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

src/VBox/Devices/Audio, src/VBox/Main/src-client, include/VBox/vmm:

src/VBox/Devices/Audio: part of restructuring of audio code. Devices files correspondin to Hda, AC97 and SB16 audio. The structure of files have been modifed as per PDM specs. The modified code is under #ifdef VBOX_WITH_PDM_AUDIO_DRIVER

src/VBox/Main/src-client: Driver for the VRDE that interacts with DrvAudio. Enhancement of the CFGM tree for audio.

Config.kmk : addition of one configuration parameter that will control whether new audio code is disabled or enabled. "VBOX_WITH_PDM_AUDIO_DRIVER"

pdmaudioifs.h: common header file between Device , Intermediate audio driver and Backends specific to audio.

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