VirtualBox

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

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

6813 - src-client/GuestFsObjInfoImpl.cpp wrapper issues sorted

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 39.2 KB
Line 
1# $Id: Makefile.kmk 50528 2014-02-20 19:13: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_NAT_SERVICE),VBOX_WITH_NAT_SERVICE,) \
285 $(if $(VBOX_WITH_HGCM),VBOX_WITH_CROGL,) \
286 $(if $(VBOX_WITH_CRHGSMI),VBOX_WITH_CRHGSMI,)
287ifdef VBOX_WITH_USB
288 VBoxSVC_DEFS += \
289 VBOX_WITH_USB \
290 $(if $(VBOX_WITH_EHCI),VBOX_WITH_EHCI,) \
291 $(if $(VBOX_WITH_NEW_USB_CODE_ON_DARWIN),VBOX_WITH_NEW_USB_CODE_ON_DARWIN,)
292endif
293VBoxSVC_DEFS.win += VBOX_COM_OUTOFPROC_MODULE
294VBoxSVC_DEFS.win += _WIN32_WINNT=0x0510
295# Try to load and use libhal at runtime for probing removable media
296# VBoxSVC_DEFS.linux += VBOX_USE_LIBHAL
297VBoxSVC_DEFS.solaris += VBOX_USE_LIBHAL
298VBoxSVC_DEFS.freebsd += VBOX_USE_LIBHAL
299
300VBoxSVC_CXXFLAGS = $(filter-out -Wno-unused,$(TEMPLATE_VBOXMAINEXE_CXXFLAGS))
301
302VBoxSVC_INCS = \
303 include \
304 $(VBoxSVC_0_OUTDIR) \
305 $(dir $(VBOX_XML_SCHEMADEFS_H)) \
306 $(VBOX_MAIN_APIWRAPPER_INCS) \
307 .
308VBoxSVC_INCS.win = \
309 $(VBoxCOM_0_OUTDIR)
310ifdef VBOX_WITH_USB
311 VBoxSVC_INCS.os2 = \
312 $(PATH_ROOT)/src/VBox/HostDrivers/VBoxUSB/os2
313endif
314
315VBoxSVC_LIBS += \
316 $(PATH_STAGE_LIB)/VBoxAPIWrap$(VBOX_SUFF_LIB) \
317 $(PATH_STAGE_LIB)/SSMStandalone$(VBOX_SUFF_LIB) \
318 $(LIB_DDU)
319VBoxSVC_SDKS = VBOX_LIBPNG VBOX_ZLIB
320VBoxSVC_LIBS.solaris = \
321 adm \
322 nsl \
323 devinfo \
324 socket \
325 $(LIB_VMM)
326
327VBoxSVC_INTERMEDIATES = \
328 $(VBOX_MAIN_PREREQS) \
329 $(VBOX_XML_SCHEMADEFS_H) \
330 $(VBOX_AUTOGEN_EVENT_H) \
331 $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
332
333VBoxSVC_SOURCES = \
334 src-all/DisplayPNGUtil.cpp \
335 src-all/DisplayResampleImage.cpp \
336 src-all/DisplayUtils.cpp \
337 src-all/EventImpl.cpp \
338 src-all/Global.cpp \
339 src-all/HashedPw.cpp \
340 src-all/Logging.cpp \
341 src-all/PCIDeviceAttachmentImpl.cpp \
342 src-all/ProgressImpl.cpp \
343 src-all/SharedFolderImpl.cpp \
344 src-all/VirtualBoxBase.cpp \
345 src-all/VirtualBoxErrorInfoImpl.cpp \
346 $(if $(VBOX_WITH_EXTPACK),src-all/ExtPackManagerImpl.cpp src-all/ExtPackUtil.cpp,) \
347 src-server/ApplianceImpl.cpp \
348 src-server/ApplianceImplExport.cpp \
349 src-server/ApplianceImplImport.cpp \
350 src-server/ApplianceImplIO.cpp \
351 src-server/AudioAdapterImpl.cpp \
352 src-server/BandwidthControlImpl.cpp \
353 src-server/BandwidthGroupImpl.cpp \
354 src-server/BIOSSettingsImpl.cpp \
355 src-server/ClientWatcher.cpp \
356 src-server/ClientToken.cpp \
357 src-server/DHCPServerImpl.cpp \
358 src-server/NetworkServiceRunner.cpp \
359 src-server/NATNetworkImpl.cpp \
360 src-server/GuestOSTypeImpl.cpp \
361 src-server/HostDnsService.cpp \
362 src-server/HostImpl.cpp \
363 src-server/HostNetworkInterfaceImpl.cpp \
364 src-server/HostPower.cpp \
365 src-server/HostVideoInputDeviceImpl.cpp \
366 src-server/MachineImpl.cpp \
367 src-server/MachineImplCloneVM.cpp \
368 src-server/Matching.cpp \
369 src-server/MediumAttachmentImpl.cpp \
370 src-server/MediumFormatImpl.cpp \
371 src-server/MediumImpl.cpp \
372 src-server/MediumLock.cpp \
373 src-server/NATEngineImpl.cpp \
374 src-server/NetworkAdapterImpl.cpp \
375 src-server/ParallelPortImpl.cpp \
376 src-server/ProgressProxyImpl.cpp \
377 src-server/SerialPortImpl.cpp \
378 src-server/SnapshotImpl.cpp \
379 src-server/StorageControllerImpl.cpp \
380 src-server/SystemPropertiesImpl.cpp \
381 src-server/TokenImpl.cpp \
382 src-server/USBControllerImpl.cpp \
383 src-server/USBDeviceFiltersImpl.cpp \
384 src-server/VFSExplorerImpl.cpp \
385 src-server/VirtualBoxImpl.cpp \
386 src-server/VRDEServerImpl.cpp \
387 src-server/generic/AutostartDb-generic.cpp \
388 xml/ovfreader.cpp \
389 xml/Settings.cpp \
390 $(VBOX_XML_SCHEMADEFS_CPP) \
391 $(VBOX_AUTOGEN_EVENT_CPP) \
392 $(if $(VBOX_WITH_XPCOM),src-server/xpcom/server.cpp,)
393
394ifn1of ($(KBUILD_TARGET), win darwin)
395 VBoxSVC_SOURCES += $(PATH_ROOT)/src/VBox/Devices/Network/slirp/resolv_conf_parser.c
396endif
397
398VBoxSVC_SOURCES.darwin = \
399 src-server/darwin/iokit.cpp \
400 src-server/darwin/HostPowerDarwin.cpp \
401 src-server/darwin/HostDnsServiceDarwin.cpp
402
403VBoxSVC_SOURCES.win = \
404 src-server/win/svcmain.cpp \
405 src-server/win/svchlp.cpp \
406 src-server/win/HostPowerWin.cpp \
407 src-server/win/VBoxSVC.rc \
408 src-server/win/VBoxComEvents.cpp \
409 src-server/win/HostDnsServiceWin.cpp
410
411VBoxSVC_SOURCES.linux = \
412 src-server/linux/HostHardwareLinux.cpp \
413 src-server/linux/HostDnsServiceLinux.cpp \
414 src-server/HostDnsServiceResolvConf.cpp
415
416VBoxSVC_SOURCES.solaris = \
417 src-server/linux/vbox-libhal.cpp \
418 src-server/solaris/DynLoadLibSolaris.cpp \
419 src-server/HostDnsServiceResolvConf.cpp
420
421VBoxSVC_SOURCES.os2 = \
422 src-server/HostDnsServiceResolvConf.cpp
423
424VBoxSVC_SOURCES.freebsd = \
425 src-server/freebsd/HostHardwareFreeBSD.cpp
426
427
428ifdef VBOX_WITH_USB
429 ifdef VBOX_WITH_SYSFS_BY_DEFAULT
430 src-server/linux/USBProxyServiceLinux.cpp_DEFS += VBOX_WITH_SYSFS_BY_DEFAULT
431 endif
432 VBoxSVC_SOURCES += \
433 src-server/USBDeviceFilterImpl.cpp \
434 src-server/USBProxyService.cpp \
435 src-server/HostUSBDeviceImpl.cpp
436 VBoxSVC_SOURCES.darwin += src-server/darwin/USBProxyServiceDarwin.cpp
437 VBoxSVC_SOURCES.linux += src-server/linux/USBProxyServiceLinux.cpp
438 VBoxSVC_SOURCES.linux += src-server/linux/USBGetDevices.cpp
439 VBoxSVC_SOURCES.os2 += src-server/os2/USBProxyServiceOs2.cpp
440 VBoxSVC_SOURCES.solaris += src-server/solaris/USBProxyServiceSolaris.cpp
441 VBoxSVC_SOURCES.win += src-server/win/USBProxyServiceWindows.cpp
442 VBoxSVC_SOURCES.freebsd += src-server/freebsd/USBProxyServiceFreeBSD.cpp
443endif
444
445ifdef VBOX_WITH_NETFLT
446 VBoxSVC_LIBS.win += \
447 $(PATH_STAGE_LIB)/WinNetConfig$(VBOX_SUFF_LIB) \
448 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
449 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/Newdev.lib \
450 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
451 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
452endif
453VBoxSVC_LDFLAGS.darwin = -framework IOKit -framework SystemConfiguration
454
455ifdef VBOX_WITH_CROGL
456 VBoxSVC_LIBS += $(PATH_STAGE_LIB)/VBoxOGLTest$(VBOX_SUFF_LIB)
457 VBoxSVC_LDFLAGS.darwin += -framework OpenGL
458endif
459
460ifeq ($(KBUILD_TYPE),debug)
461 VBoxSVC_LDFLAGS.linux += -rdynamic # for backtrace_symbols()
462endif
463
464ifdef VBOX_WITH_RESOURCE_USAGE_API
465 VBoxSVC_SOURCES += \
466 src-server/PerformanceImpl.cpp \
467 src-server/Performance.cpp
468 VBoxSVC_SOURCES.darwin += src-server/darwin/PerformanceDarwin.cpp
469 VBoxSVC_SOURCES.freebsd += src-server/freebsd/PerformanceFreeBSD.cpp
470 VBoxSVC_SOURCES.linux += src-server/linux/PerformanceLinux.cpp
471 VBoxSVC_SOURCES.os2 += src-server/os2/PerformanceOs2.cpp
472 VBoxSVC_SOURCES.solaris += src-server/solaris/PerformanceSolaris.cpp
473 VBoxSVC_SOURCES.win += src-server/win/PerformanceWin.cpp
474 VBoxSVC_LDFLAGS.darwin += -lproc
475 VBoxSVC_LDFLAGS.solaris += -lkstat -lnvpair
476 VBoxSVC_LDFLAGS.win += psapi.lib powrprof.lib
477endif
478
479ifdef VBOX_WITH_HOSTNETIF_API
480 VBoxSVC_SOURCES.win += src-server/win/NetIf-win.cpp
481 VBoxSVC_SOURCES.linux += src-server/linux/NetIf-linux.cpp
482 VBoxSVC_SOURCES.os2 += src-server/os2/NetIf-os2.cpp
483 VBoxSVC_SOURCES.darwin += src-server/darwin/NetIf-darwin.cpp
484 VBoxSVC_SOURCES.solaris += src-server/solaris/NetIf-solaris.cpp
485 VBoxSVC_SOURCES.freebsd += src-server/freebsd/NetIf-freebsd.cpp
486 VBoxSVC_DEFS += VBOX_WITH_HOSTNETIF_API
487 if1of ($(KBUILD_TARGET), linux darwin solaris freebsd)
488 VBoxSVC_SOURCES += src-server/generic/NetIf-generic.cpp
489 endif
490endif
491
492src-server/win/VBoxSVC.rc_INCS = $(VBoxSVC_0_OUTDIR)
493src-server/win/VBoxSVC.rc_DEPS = $(VBoxSVC_0_OUTDIR)/VBoxSVC.rgs $(VBoxSVC_0_OUTDIR)/VBoxSVC-icon.rc
494src-server/win/VBoxSVC.rc_CLEAN = $(VBoxSVC_0_OUTDIR)/VBoxSVC.rgs $(VBoxSVC_0_OUTDIR)/VBoxSVC-icon.rc
495
496$$(VBoxSVC_0_OUTDIR)/VBoxSVC-icon.rc: $(MAKEFILE_CURRENT) $(VBOX_WINDOWS_ICON_FILE) | $$(dir $$(@D))
497 $(APPEND) -t $@ '1 ICON DISCARDABLE "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
498
499$$(VBoxSVC_0_OUTDIR)/VBoxSVC.rgs: $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(dir $$(@D))
500 $(VBOX_XSLTPROC) --stringparam Module VBoxSVC -o $@ $< $(VBOX_XIDL_FILE)
501
502## @todo r=klaus unfortunately we don't have xmllint everywhere, would be
503# good to check the validity for every VirtualBox.xidl change.
504#$(VBOX_XIDL_FILE).validated.ts: $(VBOX_XIDL_FILE_SRC)
505# xmllint --dtdvalid $(VBOX_PATH_MAIN_SRC)/idl/VirtualBox.dtd --noout $<
506# $(QUIET)$(CP) --changed -fv $< $(VBOX_XIDL_FILE).validated.ts
507#
508#OTHERS += $(VBOX_XIDL_FILE).validated.ts
509#OTHER_CLEAN += $(VBOX_XIDL_FILE).validated.ts
510
511testvalidxidl: $(VBOX_XIDL_FILE_SRC)
512 xmllint --dtdvalid $(VBOX_PATH_MAIN_SRC)/idl/VirtualBox.dtd --noout $<
513
514
515#
516# Embed some constraints from XML Schema file into VBoxSVC
517#
518VBOX_XML_SCHEMA = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings.xsd
519
520$(VBOX_XML_SCHEMADEFS_H): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA) | $$(dir $$@)
521 $(call MSG_GENERATE,SchemaDefs,$@,$<)
522 $(QUIET)$(VBOX_XSLTPROC) --stringparam mode declare -o $@ $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA)
523
524$(VBOX_XML_SCHEMADEFS_CPP): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA) | $$(dir $$@)
525 $(call MSG_GENERATE,SchemaDefs,$@,$<)
526 $(QUIET)$(VBOX_XSLTPROC) --stringparam mode define -o $@ $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA)
527
528testvalidsettings: $(VBOX_XML_SCHEMA)
529 xmllint --schema $< --noout $(HOME)/.VirtualBox/VirtualBox.xml
530 xmllint --schema $< --noout $(HOME)/.VirtualBox/Machines/*/*.xml
531 xmllint --schema $< --noout $(HOME)/.VirtualBox/Machines/*/*.vbox
532 xmllint --schema $< --noout $(HOME)/VirtualBox\ VMs/*/*.vbox
533
534OTHER_CLEAN += $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP)
535
536
537#
538# Generate some event stuff for VBoxSVC and VBoxC.
539#
540$(VBOX_AUTOGEN_EVENT_H): $(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
541 $(call MSG_TOOL,xsltproc,autogen events,$<,$@)
542 $(QUIET)$(VBOX_XSLTPROC) --stringparam G_kind VBoxEventHeader -o $@ $< $(VBOX_XIDL_FILE)
543
544$(VBOX_AUTOGEN_EVENT_CPP): $(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
545 $(call MSG_TOOL,xsltproc,autogen events,$<,$@)
546 $(QUIET)$(VBOX_XSLTPROC) --stringparam G_kind VBoxEvent -o $@ $< $(VBOX_XIDL_FILE)
547
548OTHER_CLEAN += $(VBOX_AUTOGEN_EVENT_H) $(VBOX_AUTOGEN_EVENT_CPP)
549
550ifdef VBOX_WITH_XPCOM
551#
552# VBoxSVCM - VBoxSVC wrapper module
553#
554DLLS += VBoxSVCM
555VBoxSVCM_TEMPLATE = VBOXMAINCOMP
556VBoxSVCM_DEFS = IN_RING3 $(VBOX_MAIN_DEFS)
557ifdef VBOX_WITH_HARDENING
558 VBoxSVCM_DEFS += VBOX_WITH_HARDENING
559endif
560VBoxSVCM_INCS = \
561 include \
562 $(VBoxC_0_OUTDIR) \
563 .
564VBoxSVCM_INTERMEDIATES = $(VBOX_MAIN_PREREQS)
565VBoxSVCM_SOURCES = \
566 src-server/xpcom/server_module.cpp
567VBoxSVCM_LDFLAGS.darwin = \
568 -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxSVCM.dylib \
569 -exported_symbols_list $(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def
570 ifeq ($(KBUILD_TARGET),darwin)
571VBoxSVCM_ORDERDEPS += $(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def
572VBoxSVCM_CLEAN += $(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def
573$$(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def:
574 $(RM) -f $@
575 $(APPEND) $@ _NSGetModule
576 endif
577VBoxSVCM_INTERMEDIATES += $(VBOX_IDL_HEADER.XPCOM)
578
579 # 32-bit version of the module.
580 ifdef VBOX_WITH_32_ON_64_MAIN_API
581DLLS += VBoxSVCM-x86
582VBoxSVCM-x86_TEMPLATE = VBoxMainComp-x86
583VBoxSVCM-x86_EXTENDS = VBoxSVCM
584 endif
585
586endif # VBOX_WITH_XPCOM
587
588
589#
590# VBoxC module
591#
592DLLS += VBoxC
593VBoxC_TEMPLATE = VBOXMAINCOMP
594VBoxC_DEFS = \
595 IN_RING3 \
596 $(VBOX_MAIN_DEFS) \
597 VBOX_COM_INPROC \
598 $(if $(VBOX_WITH_HGCM),VBOX_WITH_HGCM,) \
599 $(if $(VBOX_WITH_ALSA),VBOX_WITH_ALSA,) \
600 $(if $(VBOX_WITH_PULSE),VBOX_WITH_PULSE,) \
601 $(if $(VBOX_WITH_WINMM),VBOX_WITH_WINMM,) \
602 $(if $(VBOX_WITH_SOLARIS_OSS),VBOX_WITH_SOLARIS_OSS,) \
603 $(if $(VBOX_WITH_E1000),VBOX_WITH_E1000,) \
604 $(if $(VBOX_WITH_VIRTIO),VBOX_WITH_VIRTIO,) \
605 $(if $(VBOX_WITH_EFI),VBOX_WITH_EFI,) \
606 $(if $(VBOX_WITH_PDM_ASYNC_COMPLETION),VBOX_WITH_PDM_ASYNC_COMPLETION,) \
607 $(if $(VBOX_WITH_LIVE_MIGRATION),VBOX_WITH_LIVE_MIGRATION,) \
608 $(if $(VBOX_WITH_VUSB),VBOX_WITH_VUSB,) \
609 $(if $(VBOX_WITH_HGSMI),VBOX_WITH_HGSMI,) \
610 $(if $(VBOX_WITH_VIDEOHWACCEL),VBOX_WITH_VIDEOHWACCEL,) \
611 $(if $(VBOX_WITH_DRAG_AND_DROP),VBOX_WITH_DRAG_AND_DROP,) \
612 $(if $(VBOX_WITH_DRAG_AND_DROP_GH),VBOX_WITH_DRAG_AND_DROP_GH,) \
613 $(if $(VBOX_WITH_USB),VBOX_WITH_USB,) \
614 $(if-expr defined(VBOX_WITH_EHCI) && defined(VBOX_WITH_USB),VBOX_WITH_EHCI,) \
615 $(if $(VBOX_WITH_EXTPACK),VBOX_WITH_EXTPACK,) \
616 $(if $(VBOX_WITH_PCI_PASSTHROUGH),VBOX_WITH_PCI_PASSTHROUGH,) \
617 $(if $(VBOX_WITH_VPX),VBOX_WITH_VPX,)
618ifdef VBOX_WITH_CRHGSMI
619 VBoxC_DEFS += VBOX_WITH_CRHGSMI
620endif
621ifdef VBOX_WITH_NETSHAPER
622 VBoxC_DEFS += VBOX_WITH_NETSHAPER
623endif
624VBoxC_DEFS.darwin.x86 = VBOX_WITH_2X_4GB_ADDR_SPACE
625VBoxC_DEFS.win.x86 += _WIN32_WINNT=0x0500
626VBoxC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
627
628VBoxC_SDKS = VBOX_LIBPNG VBOX_ZLIB
629ifdef VBOX_WITH_VPX
630 VBoxC_SDKS += VBOX_VPX
631endif
632
633VBoxC_INCS = \
634 include \
635 $(VBoxC_0_OUTDIR) \
636 $(VBOX_MAIN_APIWRAPPER_INCS) \
637 $(dir $(VBOX_XML_SCHEMADEFS_H))
638VBoxC_INCS.win = \
639 $(VBoxCOM_0_OUTDIR) \
640 .
641
642VBoxC_LDFLAGS.darwin = \
643 -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxC.dylib \
644 -exported_symbols_list $(VBoxC_0_OUTDIR)/VBoxC.def \
645 -framework IOKit
646VBoxC_LDFLAGS.win += /MANIFEST
647
648VBoxC_LIBS += \
649 $(PATH_STAGE_LIB)/VBoxAPIWrap$(VBOX_SUFF_LIB) \
650 $(if-expr "$(LIB_VMM)" == "$(VBOX_LIB_VMM_LAZY)",$(LIB_REM),) \
651 $(VBOX_LIB_VMM_LAZY)
652ifdef VBOX_WITH_NETFLT
653 VBoxC_LIBS.win += \
654 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
655 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/Newdev.lib \
656 $(PATH_STAGE_LIB)/WinNetConfig$(VBOX_SUFF_LIB) \
657 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
658 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib \
659 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib
660endif
661
662ifdef VBOX_WITH_CROGL
663 VBoxC_LIBS += $(PATH_STAGE_LIB)/VBoxOGLTest$(VBOX_SUFF_LIB)
664 VBoxC_LDFLAGS.darwin += -framework OpenGL
665endif
666
667ifdef VBOX_WITH_DRAG_AND_DROP
668 VBoxC_LIBS += $(PATH_STAGE_LIB)/VBoxDnDHostR3Lib$(VBOX_SUFF_LIB)
669endif
670
671VBoxC_INTERMEDIATES = \
672 $(VBOX_MAIN_PREREQS) \
673 $(VBOX_XML_SCHEMADEFS_H) \
674 $(VBOX_AUTOGEN_EVENT_H) \
675 $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
676
677VBoxC_SOURCES = \
678 src-all/DisplayPNGUtil.cpp \
679 src-all/DisplayResampleImage.cpp \
680 src-all/DisplayUtils.cpp \
681 src-all/EventImpl.cpp \
682 src-all/Global.cpp \
683 src-all/HashedPw.cpp \
684 src-all/Logging.cpp \
685 src-all/PCIDeviceAttachmentImpl.cpp \
686 src-all/ProgressImpl.cpp \
687 src-all/SharedFolderImpl.cpp \
688 src-all/VirtualBoxBase.cpp \
689 src-all/VirtualBoxErrorInfoImpl.cpp \
690 $(if $(VBOX_WITH_EXTPACK),src-all/ExtPackManagerImpl.cpp src-all/ExtPackUtil.cpp,) \
691 src-client/UsbWebcamInterface.cpp \
692 $(if $(VBOX_WITH_USB_CARDREADER),src-client/UsbCardReader.cpp,) \
693 src-client/Nvram.cpp \
694 src-client/AdditionsFacilityImpl.cpp \
695 src-client/AudioSnifferInterface.cpp \
696 src-client/BusAssignmentManager.cpp \
697 $(if $(VBOX_WITH_PCI_PASSTHROUGH),src-client/PCIRawDevImpl.cpp,) \
698 src-client/ClientTokenHolder.cpp \
699 src-client/ConsoleImpl.cpp \
700 src-client/ConsoleImpl2.cpp \
701 src-client/ConsoleImplTeleporter.cpp \
702 src-client/ConsoleVRDPServer.cpp \
703 src-client/DisplayImpl.cpp \
704 src-client/EmulatedUSBImpl.cpp \
705 src-client/GuestImpl.cpp \
706 src-client/GuestDirectoryImpl.cpp \
707 src-client/GuestFileImpl.cpp \
708 src-client/GuestFsObjInfoImpl.cpp \
709 src-client/GuestProcessImpl.cpp \
710 src-client/GuestSessionImpl.cpp \
711 src-client/GuestCtrlImpl.cpp \
712 src-client/KeyboardImpl.cpp \
713 src-client/MachineDebuggerImpl.cpp \
714 src-client/MouseImpl.cpp \
715 src-client/RemoteUSBDeviceImpl.cpp \
716 src-client/SessionImpl.cpp \
717 src-client/USBDeviceImpl.cpp \
718 src-client/VBoxDriversRegister.cpp \
719 src-client/VirtualBoxClientImpl.cpp \
720 src-client/VMMDevInterface.cpp \
721 $(VBOX_AUTOGEN_EVENT_CPP) \
722 $(VBOX_XML_SCHEMADEFS_CPP)
723VBoxC_SOURCES.win = \
724 src-client/win/dllmain.cpp \
725 src-client/win/VBoxC.def \
726 src-client/win/VBoxC.rc
727ifdef VBOX_WITH_GUEST_CONTROL
728 VBoxC_SOURCES += \
729 src-client/GuestSessionImplTasks.cpp \
730 src-client/GuestCtrlPrivate.cpp
731endif
732ifdef VBOX_WITH_DRAG_AND_DROP
733 VBoxC_SOURCES += \
734 src-client/GuestDnDImpl.cpp
735endif
736ifdef VBOX_WITH_XPCOM
737 VBoxC_SOURCES += \
738 src-client/xpcom/module.cpp
739endif
740ifdef VBOX_WITH_HGCM
741 VBoxC_SOURCES += \
742 src-client/HGCMObjects.cpp \
743 src-client/HGCMThread.cpp \
744 src-client/HGCM.cpp
745endif
746ifdef VBOX_WITH_USB
747 VBoxC_SOURCES += \
748 src-client/RemoteUSBBackend.cpp
749endif
750ifdef VBOX_WITH_VPX
751 VBoxC_SOURCES += \
752 src-client/EbmlWriter.cpp \
753 src-client/VideoRec.cpp
754endif
755
756ifeq ($(KBUILD_TARGET),darwin)
757VBoxC_ORDERDEPS += $(VBoxC_0_OUTDIR)/VBoxC.def
758VBoxC_CLEAN += $(VBoxC_0_OUTDIR)/VBoxC.def
759$$(VBoxC_0_OUTDIR)/VBoxC.def: $(MAKEFILE_CURRENT)
760 $(RM) -f $@
761 $(APPEND) $@ _NSGetModule
762 $(APPEND) $@ _VBoxDriversRegister
763endif
764
765src-client/ConsoleImpl.cpp_DEFS = \
766 $(if $(VBOX_BLEEDING_EDGE),VBOX_BLEEDING_EDGE=\"$(VBOX_BLEEDING_EDGE)\",)
767
768
769src-client/win/VBoxC.rc_DEPS = $(VBoxC_0_OUTDIR)/VBoxC.rgs $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb
770VBoxC_CLEAN.win += $(VBoxC_0_OUTDIR)/VBoxC.rgs
771
772$$(VBoxC_0_OUTDIR)/VBoxC.rgs: $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
773 $(VBOX_XSLTPROC) --stringparam Module VBoxC -o $@ $< $(VBOX_XIDL_FILE)
774
775ifdef VBOX_WITH_32_ON_64_MAIN_API
776 #
777 # 32-bit VBox API Client In-Process module.
778 #
779 # This is currently just a 32-bit version of VBoxC. It might be desirable to
780 # split up VBoxC into a simple client and a VM client part later, in which
781 # case this module will be a simple client.
782 #
783 # Note! One important thing is that the typelib for this DLL must be build
784 # with the /env win32 switch and the VBoxC typelib with /env amd64, if
785 # not they will overwrite each others typelib module entry.
786 #
787 DLLS += VBoxClient-x86
788 VBoxClient-x86_TEMPLATE = VBoxMainComp-x86
789 VBoxClient-x86_EXTENDS = VBoxC
790 VBoxClient-x86_DEFS = VBOX_COM_INPROC_API_CLIENT $(VBoxC_DEFS)
791 VBoxClient-x86_INST.win = $(INST_DLL)x86/
792 VBoxClient-x86_INCS.win = \
793 $(VBoxClient-x86_0_OUTDIR) \
794 $(VBoxCOM-x86_0_OUTDIR) \
795 $(VBoxC_INCS.win)
796 VBoxClient-x86_SOURCES = \
797 src-all/EventImpl.cpp \
798 src-all/Global.cpp \
799 src-all/VirtualBoxBase.cpp \
800 src-all/VirtualBoxErrorInfoImpl.cpp \
801 src-client/ClientTokenHolder.cpp \
802 src-client/SessionImpl.cpp \
803 src-client/VirtualBoxClientImpl.cpp \
804 $(VBOX_AUTOGEN_EVENT_CPP) \
805 $(VBOX_XML_SCHEMADEFS_CPP)
806 VBoxClient-x86_SOURCES.win = \
807 src-client/win/dllmain.cpp \
808 src-client/win/VBoxClient-x86.def \
809 src-client/win/VBoxClient-x86.rc
810 ifdef VBOX_WITH_XPCOM
811 VBoxClient-x86_SOURCES += \
812 src-client/xpcom/module.cpp
813 endif
814 VBoxClient-x86_LIBS = $(NO_SUCH_VARIABLE)
815 VBoxClient-x86_LIBS.win = $(NO_SUCH_VARIABLE)
816 VBoxClient-x86_CLEAN.win += $(VBoxClient-x86_0_OUTDIR)/VBoxClient-x86.rgs
817 src-client/win/VBoxClient-x86.rc_DEPS = \
818 $(VBoxClient-x86_0_OUTDIR)/VBoxClient-x86.rgs \
819 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox-x86.tlb
820
821 $$(VBoxClient-x86_0_OUTDIR)/VBoxClient-x86.rgs: \
822 $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl \
823 $(VBOX_XIDL_FILE) | $$(dir $$@)
824 $(VBOX_XSLTPROC) --stringparam Module VBoxC -o $@ $< $(VBOX_XIDL_FILE)
825
826endif
827
828
829#
830# VBoxCOM - COM Abstraction Layer library
831#
832LIBRARIES += VBoxCOM
833VBoxCOM_TEMPLATE = VBoxMainLib
834VBoxCOM_INTERMEDIATES = $(VBOX_MAIN_PREREQS)
835VBoxCOM_SOURCES = \
836 glue/com.cpp \
837 glue/initterm.cpp \
838 glue/string.cpp \
839 glue/AutoLock.cpp \
840 glue/EventQueue.cpp \
841 glue/NativeEventQueue.cpp \
842 glue/ErrorInfo.cpp \
843 glue/errorprint.cpp
844VBoxCOM_INCS += \
845 include
846ifeq ($(KBUILD_TARGET),win)
847 VBoxCOM_DEFS.x86 = _WIN32_WINNT=0x0500
848 VBoxCOM_DEFS.amd64 = _WIN32_WINNT=0x0510
849 VBoxCOM_SOURCES += \
850 $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c
851else # !win
852 VBoxCOM_SOURCES += \
853 $(VBoxCOM_0_OUTDIR)/VirtualBox_XPCOM_i.c \
854 glue/xpcom/helpers.cpp
855endif # !win
856
857glue/com.cpp_DEFS = \
858 $(if $(VBOX_BLEEDING_EDGE),VBOX_BLEEDING_EDGE=\"$(VBOX_BLEEDING_EDGE)\",) \
859 KBUILD_TYPE=\"$(KBUILD_TYPE)\"
860
861# 32-bit version of VBoxCOM.
862ifdef VBOX_WITH_32_ON_64_MAIN_API
863 LIBRARIES += VBoxCOM-x86
864 VBoxCOM-x86_TEMPLATE = VBoxMainLib-x86
865 VBoxCOM-x86_EXTENDS = VBoxCOM
866endif
867
868
869
870#
871# The VBoxExtPackHelperApp.
872#
873ifdef VBOX_WITH_EXTPACK
874 PROGRAMS += VBoxExtPackHelperApp
875 VBoxExtPackHelperApp_TEMPLATE = VBoxR3SetUidToRoot
876 VBoxExtPackHelperApp_LDFLAGS.darwin = -framework Security
877 VBoxExtPackHelperApp_LDFLAGS.win = /SUBSYSTEM:windows
878 VBoxExtPackHelperApp_SOURCES = \
879 src-helper-apps/VBoxExtPackHelperApp.cpp \
880 src-all/ExtPackUtil.cpp
881 VBoxExtPackHelperApp_LIBS = \
882 $(LIB_RUNTIME)
883endif # VBOX_WITH_EXTPACK
884
885#
886# VolInfo
887#
888ifdef VBOX_WITH_DEVMAPPER
889 PROGRAMS.linux += VBoxVolInfo
890 VBoxVolInfo_TEMPLATE = VBoxR3SetUidToRoot
891 VBoxVolInfo_SOURCES = src-helper-apps/VBoxVolInfo.cpp
892 VBoxVolInfo_LIBS = devmapper
893endif
894
895endif # !VBOX_ONLY_SDK (the ifndef is far above)
896
897
898#
899# Installs com related thing(s) to bin.
900#
901INSTALLS.win += VBoxMain-com-inst
902VBoxMain-com-inst_INST = $(INST_BIN)
903VBoxMain-com-inst_MODE = a+r,u+w
904VBoxMain-com-inst_SOURCES = src-all/win/comregister.cmd
905
906
907if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "linux"
908 #
909 # Installs linux/hardening related things to components.
910 #
911 INSTALLS.linux += VBoxMain-hardening-inst
912 VBoxMain-hardening-inst_INST = $(INST_BIN)components/
913 VBoxMain-hardening-inst_SYMLINKS = \
914 VBoxDDU.so=>../VBoxDDU.so \
915 VBoxREM.so=>../VBoxREM.so \
916 VBoxRT.so=>../VBoxRT.so \
917 VBoxVMM.so=>../VBoxVMM.so \
918 VBoxXPCOM.so=>../VBoxXPCOM.so
919endif
920
921
922if defined(VBOX_WITH_MIDL_PROXY_STUB) && "$(KBUILD_TARGET)" == "win"
923 #
924 # Experimental COM proxy + stub DLL.
925 #
926 DLLS += VBoxProxyStub
927 VBoxProxyStub_TEMPLATE = VBOXMAINCOMP
928 VBoxProxyStub_DEFS = REGISTER_PROXY_DLL
929 VBoxProxyStub_DEFS.win.x86 = WIN32
930 VBoxProxyStub_SOURCES = \
931 $(VBoxCOM_0_OUTDIR)/dlldata.c \
932 $(VBoxCOM_0_OUTDIR)/VirtualBox_p.c \
933 $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
934 src-all/win/VBoxProxyStub.def
935
936 ifdef VBOX_WITH_32_ON_64_MAIN_API
937 DLLS += VBoxProxyStub-x86
938 VBoxProxyStub-x86_TEMPLATE = VBoxMainComp-x86
939 VBoxProxyStub-x86_DEFS = REGISTER_PROXY_DLL
940 VBoxProxyStub-x86_DEFS.win.x86 = WIN32
941 VBoxProxyStub-x86_SOURCES = \
942 $(VBoxCOM-x86_0_OUTDIR)/dlldata.c \
943 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_p.c \
944 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c \
945 src-all/win/VBoxProxyStub.def
946 endif
947endif
948
949
950
951# generate rules
952include $(FILE_KBUILD_SUB_FOOTER)
953
954
955
956#
957# Additions rules.
958#
959
960## @todo this hack ain't cutting it any longer. (the file name is abspath'ed since ages now.)
961glue/xpcom/helpers.cpp: $(VBOX_IDL_TYPELIB.XPCOM)
962
963$(VBOX_IDL_FILE.XPCOM): $(VBOX_PATH_MAIN_SRC)/idl/xpidl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
964 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
965 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
966
967$(VBOX_IDL_TYPELIB.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
968 $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
969 $(QUIET)$(VBOX_XPIDL_ENV)$(VBOX_XPIDL) -m typelib -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
970 $(CHMOD) 0644 $@
971## @todo ^^^^^^^^^^^^ fix horrible hack
972
973$(VBOX_IDL_HEADER.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
974 $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
975 $(QUIET)$(VBOX_XPIDL_ENV)$(VBOX_XPIDL) -m header -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
976
977$(VBOX_IDL_FILE.MSCOM): $(VBOX_PATH_MAIN_SRC)/idl/midl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
978 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
979 $(QUIET)$(VBOX_XSLTPROC) -o $@ $(if $(VBOX_WITH_MIDL_PROXY_STUB),-stringparam g_fGenProxy yes,) $< $(VBOX_XIDL_FILE)
980
981# Aliases for testing purposes.
982ifdef VBOX_WITH_XPCOM
983testidl: $(VBOX_IDL_FILE.XPCOM) $(VBOX_IDL_TYPELIB.XPCOM) $(VBoxCOM_0_OUTDIR)/VirtualBox_XPCOM_i.c
984testidlhdr: $(VBOX_IDL_HEADER.XPCOM)
985else
986testidl: $(VBOX_IDL_FILE.MSCOM) $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
987 $(if $(VBOX_WITH_32_ON_64_MAIN_API),$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c,)
988endif
989
990
991$(VBoxCOM_0_OUTDIR)/VirtualBox_XPCOM_i.c: $(VBOX_PATH_MAIN_SRC)/idl/xpidl_iid.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
992 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
993 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
994
995$(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
996+ $(VBoxCOM_0_OUTDIR)/VirtualBox.h \
997$(if $(VBOX_WITH_MIDL_PROXY_STUB),+ $(VBoxCOM_0_OUTDIR)/VirtualBox_p.c + $(VBoxCOM_0_OUTDIR)/dlldata.c,) \
998+ $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb: $(VBOX_IDL_FILE.MSCOM) | $$(dir $$@)
999 $(VBOX_WIN_MIDL) /nologo \
1000 $(if-expr "$(KBUILD_TARGET_ARCH)" == "amd64" && "$(KBUILD_HOST)" == "win",/env amd64,/env win32) \
1001 /robust /protocol all /target NT51 \
1002 /out $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxCOM_0_OUTDIR)) \
1003 /cpp_cmd $(subst $(EXEC_X86_WIN32),,$(call VBOX_FN_MAKE_WIN_PATH,$(TOOL_$(VBOX_VCC_TOOL)_CC))) \
1004 /I $(call VBOX_FN_MAKE_WIN_PATH,$(PATH_SDK_$(VBOX_WINPSDK)_INC)) \
1005 /I idl \
1006 $(call VBOX_FN_MAKE_WIN_PATH,$<)
1007
1008$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c \
1009+ $(VBoxCOM-x86_0_OUTDIR)/VirtualBox.h \
1010$(if $(VBOX_WITH_MIDL_PROXY_STUB),+ $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_p.c + $(VBoxCOM-x86_0_OUTDIR)/dlldata.c,) \
1011+ $(VBoxCOM-x86_0_OUTDIR)/VirtualBox-x86.tlb: $(VBOX_IDL_FILE.MSCOM) | $$(dir $$@)
1012 $(VBOX_WIN_MIDL) /nologo /env win32 /target NT51 \
1013 /robust /protocol all \
1014 /out $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxCOM-x86_0_OUTDIR)) \
1015 /tlb $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox-x86.tlb) \
1016 /cpp_cmd $(subst $(EXEC_X86_WIN32),,$(call VBOX_FN_MAKE_WIN_PATH,$(TOOL_$(VBOX_VCC_TOOL_STEM)X86_CC))) \
1017 /I $(call VBOX_FN_MAKE_WIN_PATH,$(PATH_SDK_$(VBOX_WINPSDK)_INC)) \
1018 /I idl \
1019 $(call VBOX_FN_MAKE_WIN_PATH,$<)
1020
1021#
1022# Translation stuff
1023#
1024VBoxSVC_VBOX_HEADERS = \
1025 include/collection.h \
1026 include/MachineImpl.h
1027VBoxSVC_VBOX_TRANSLATIONS = \
1028 nls/VBoxSVC_de.ts
1029
1030VBoxC_VBOX_HEADERS = \
1031 include/ConsoleImpl.h
1032
1033ifdef VBOX_WITH_GUEST_CONTROL
1034VBoxC_VBOX_INTERMEDIATES = $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
1035VBoxC_VBOX_HEADERS += $(VBOX_MAIN_APIWRAPPER_INCS)
1036endif # VBOX_WITH_GUEST_CONTROL
1037
1038VBoxC_VBOX_TRANSLATIONS = \
1039 nls/VBoxC_de.ts
1040
1041ifdef VBOX_WITH_JMSCOM
1042
1043#
1044# Java glue JAR files
1045#
1046VBOX_JMSCOM_JAR = $(VBoxJMscom-inst-jar_0_OUTDIR)/vboxjmscom.jar
1047VBOX_JMSCOM_TARGET := $(PATH_TARGET)/vboxjmscom-gen
1048VBOX_JMSCOM_GEN = $(VBOX_JMSCOM_TARGET)/jmscomgen
1049VBOX_JMSCOM_JDEST := $(VBOX_JMSCOM_TARGET)/jdest
1050VBOX_GLUE_XSLT_DIR := $(PATH_ROOT)/src/VBox/Main/glue
1051VBOX_JACOB_DIR := $(PATH_ROOT)/src/libs/jacob-1.15-M3
1052
1053INSTALLS += VBoxJMscom-inst-jar
1054VBoxJMscom-inst-jar_INST = $(INST_SDK)bindings/mscom/java/
1055VBoxJMscom-inst-jar_MODE = a+r,u+w
1056VBoxJMscom-inst-jar_SOURCES = \
1057 $(VBOX_JMSCOM_JAR)
1058VBoxJMscom-inst-jar_CLEAN = \
1059 $(VBOX_JMSCOM_JAR) \
1060 $(VBOX_JMSCOM_GEN)/jmscomglue.list \
1061 $(wildcard \
1062 $(VBOX_JMSCOM_GEN)/java/*.java \
1063 $(VBOX_JMSCOM_JDEST)/*.class \
1064 $(VBOX_JMSCOM_JDEST)/*/*.class \
1065 $(VBOX_JMSCOM_JDEST)/*/*/*.class \
1066 $(VBOX_JMSCOM_JDEST)/*/*/*/*.class \
1067 )
1068VBoxJMscom-inst-jar_BLDDIRS += $(VBOX_JMSCOM_GEN)/java
1069
1070$(VBOX_JMSCOM_GEN)/jmscomglue.list: \
1071 $(VBOX_XIDL_FILE) \
1072 $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl \
1073 $(VBOX_FILESPLIT) \
1074 | $(VBOX_JMSCOM_GEN)/java/
1075 $(call MSG_L1,Generating Java MSCOM glue files from XIDL)
1076 $(QUIET)$(RM) -f $(wildcard $(VBOX_JMSCOM_GEN)/java/*.java)
1077 $(QUIET)$(VBOX_XSLTPROC) \
1078 --stringparam G_vboxApiSuffix $(VBOX_API_SUFFIX) \
1079 --stringparam G_vboxGlueStyle mscom \
1080 --stringparam G_vboxDirPrefix "" \
1081 -o $(VBOX_JMSCOM_GEN)/java/merged.file $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl $<
1082 $(QUIET)$(VBOX_FILESPLIT) $(VBOX_JMSCOM_GEN)/java/merged.file $(VBOX_JMSCOM_GEN)/java
1083 $(QUIET)echo $(VBOX_JMSCOM_GEN)/java/*.java > $@
1084
1085$$(VBOX_JMSCOM_JAR): $(VBOX_JMSCOM_GEN)/jmscomglue.list | $$(dir $$@)
1086 $(call MSG_TOOL,javac,$(notdir $@),jmscomgen.list,)
1087 $(QUIET)$(RM) -Rf $(VBOX_JMSCOM_JDEST)
1088 $(QUIET)$(MKDIR) -p $(VBOX_JMSCOM_JDEST)
1089 $(call MSG_TOOL,javac,$(notdir $@),...,)
1090 $(VBOX_JAVAC) $(VBOX_JAVAC_OPTS) \
1091 @$(VBOX_JMSCOM_GEN)/jmscomglue.list \
1092 -d $(VBOX_JMSCOM_JDEST) -classpath "$(VBOX_JMSCOM_JDEST)$(VBOX_SEP)$(VBOX_JACOB_DIR)/jacob.jar"
1093 $(call MSG_LINK,$(notdir $@),$@)
1094 $(VBOX_JAR) cf $@ -C $(VBOX_JMSCOM_JDEST) .
1095
1096## @todo compile TestVBox.java (see below) to have sanity checking
1097
1098endif # VBOX_WITH_JMSCOM
1099
1100#
1101# Install Java glue sample code.
1102#
1103INSTALLS += javagluesample
1104javagluesample_INST = $(INST_SDK)bindings/glue/java/
1105javagluesample_MODE = a+r,u+w
1106javagluesample_SOURCES = \
1107 $(VBOX_PATH_MAIN_SRC)/glue/tests/TestVBox.java=>TestVBox.java \
1108 $(VBOX_PATH_MAIN_SRC)/glue/tests/Makefile=>Makefile
1109
1110# Moved those rules to the end so that VBoxAPIWrap_0_OUTDIR can be expanded without $$ trickery.
1111$(VBoxAPIWrap_VBOX_RAWSRC) \
1112+| $(VBOX_MAIN_APIWRAPPER_GEN_FILES): \
1113 $(VBOX_XIDL_FILE) \
1114 $(VBoxAPIWrap_VBOX_XSLT) \
1115 $(VBOX_FILESPLIT) \
1116 | $$(dir $$@)
1117 $(call MSG_L1,Generating C++ Server API wrapper files from XIDL)
1118 $(QUIET)$(RM) -f $(filter-out $(VBOX_MAIN_APIWRAPPER_GEN_FILES),$(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.cpp) $(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.h))
1119 $(QUIET)$(VBOX_XSLTPROC) --stringparam filelistonly "" -o $@ $(VBoxAPIWrap_VBOX_XSLT) $<
1120 $(QUIET)$(VBOX_FILESPLIT) $@ $(VBoxAPIWrap_0_OUTDIR)
1121
1122$(VBoxAPIWrap_VBOX_KMK_FILE).ts +| $(VBoxAPIWrap_VBOX_KMK_FILE): $(VBOX_XIDL_FILE) $(VBoxAPIWrap_VBOX_XSLT) $(VBOX_PATH_MAIN_SRC)/Makefile.kmk
1123 $(call MSG_GENERATE,,$(VBoxAPIWrap_VBOX_KMK_FILE))
1124 $(QUIET)$(RM) -f $@
1125 $(QUIET)$(MKDIR) -p $(@D)
1126 $(QUIET)$(VBOX_XSLTPROC) --stringparam filelistonly VBOX_MAIN_APIWRAPPER_GEN_FILES -o $@ $(VBoxAPIWrap_VBOX_XSLT) $<
1127 $(QUIET)$(APPEND) -n "$@" "" "" \
1128 'VBOX_MAIN_APIWRAPPER_GEN_FILES := $$(addprefix $$(VBOX_MAIN_APIWRAPPER_DIR)/,$$(VBOX_MAIN_APIWRAPPER_GEN_FILES))' \
1129 'VBOX_MAIN_APIWRAPPER_GEN_HDRS = $$(filter %.h,$$(VBOX_MAIN_APIWRAPPER_GEN_FILES))'
1130 $(QUIET)$(CP) --changed -fv $@ $(VBoxAPIWrap_VBOX_KMK_FILE)
1131
1132updatenls::
1133 $(VBOX_LUPDATE) $(VBoxSVC_SOURCES) $(VBoxSVC_VBOX_HEADERS) -ts $(VBoxSVC_VBOX_TRANSLATIONS)
1134 $(VBOX_LUPDATE) $(VBoxC_SOURCES) $(VBoxC_VBOX_HEADERS) -ts $(VBoxC_VBOX_TRANSLATIONS)
1135
1136testconverter:: $(VBOX_USER_HOME)/VirtualBox.xml
1137 $(call MSG_TOOL,xsltproc,Test Settings Converter,$<,$(VBOX_USER_HOME)/VirtualBox.xml.test)
1138 $(QUIET)$(VBOX_XSLTPROC) -o $(VBOX_USER_HOME)/VirtualBox.xml.test xml/SettingsConverter.xsl $<
1139
1140testconverter2:: $(VBOX_USER_HOME)/Machines/dos/dos.xml
1141 $(call MSG_TOOL,xsltproc,Test Settings Converter,$<,$<.test)
1142 $(QUIET)$(VBOX_XSLTPROC) -o $<.test xml/SettingsConverter.xsl $<
1143
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