VirtualBox

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

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

depend build fix

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