VirtualBox

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

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

Main: build fixes.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 36.9 KB
Line 
1# $Id: Makefile.kmk 49797 2013-12-05 23:25:05Z 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 = $(VBoxAPIWrap_GENERATEDCPP)
177VBoxAPIWrap_GENERATEDCPP = $(filter %.cpp,$(VBoxAPIWrap_GENERATEDSOURCES))
178VBoxAPIWrap_GENERATEDSOURCES = $(addprefix $(VBoxAPIWrap_0_OUTDIR)/,$(VBoxAPIWrap_VBOX_APIWRAPPERFILES))
179VBoxAPIWrap_RAWSRC = \
180 $(VBoxAPIWrap_0_OUTDIR)/apiwrappers
181VBoxAPIWrap_XSLT = \
182 $(VBOX_PATH_MAIN_SRC)/idl/apiwrap-server.xsl
183VBoxAPIWrap_DEFS.win.x86 += _WIN32_WINNT=0x0500
184VBoxAPIWrap_DEFS.win.amd64 += _WIN32_WINNT=0x0510
185VBoxAPIWrap_INCS += \
186 include
187VBoxAPIWrap_CLEAN = \
188 $(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.cpp) \
189 $(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.h) \
190 $(VBoxAPIWrap_RAWSRC)
191VBoxAPIWrap_KMK = $(PATH_OUT)/vboxapiwrap.kmk
192include $(VBoxAPIWrap_KMK)
193
194ifdef VBOX_WITH_32_ON_64_MAIN_API
195LIBRARIES += VBoxAPIWrap-x86
196VBoxAPIWrap-x86_TEMPLATE = VBoxMainLib-x86
197VBoxAPIWrap-x86_EXTENDS = VBoxAPIWrap
198endif
199
200endif # !VBOX_ONLY_SDK
201
202#
203# Some SDK bit.
204#
205INSTALLS += VBox-main-xidl
206VBox-main-xidl_INST = $(INST_SDK)bindings/
207VBox-main-xidl_MODE = a+r,u+w
208VBox-main-xidl_SOURCES = $(VBOX_XIDL_FILE_SRC)
209
210ifdef VBOX_WITH_PYTHON
211INSTALLS += VBox-python-glue
212VBox-python-glue_INST = $(INST_SDK)installer/vboxapi/
213VBox-python-glue_MODE = a+r,u+w
214VBox-python-glue_SOURCES = \
215 glue/vboxapi.py=>__init__.py \
216 $(VBox-python-glue_0_OUTDIR)/VirtualBox_constants.py
217VBox-python-glue_CLEAN = \
218 $(VBox-python-glue_0_OUTDIR)/VirtualBox_constants.py
219
220$$(VBox-python-glue_0_OUTDIR)/VirtualBox_constants.py: \
221 $(VBOX_PATH_MAIN_SRC)/glue/constants-python.xsl \
222 $(VBOX_XIDL_FILE) \
223 | $$(dir $$@)
224 $(call MSG_TOOL,xsltproc,Python constants,$<,$@)
225 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
226
227endif # VBOX_WITH_PYTHON
228
229ifndef VBOX_ONLY_SDK # Note this goes on for *very* long
230
231#
232# Generate SchemaDefs.h and SchemaDefs.cpp from XML Schema
233# These two files are used by both VBoxC and VBoxSVC.
234#
235BLDDIRS += $(PATH_TARGET)/Main
236VBOX_XML_SCHEMADEFS_H = $(PATH_TARGET)/Main/SchemaDefs.h
237VBOX_XML_SCHEMADEFS_CPP = $(PATH_TARGET)/Main/SchemaDefs.cpp
238VBOX_XML_SCHEMADEFS_XSL = $(VBOX_PATH_MAIN_SRC)/xml/SchemaDefs.xsl
239
240VBOX_AUTOGEN_EVENT_H = $(PATH_TARGET)/Main/VBoxEvents.h
241VBOX_AUTOGEN_EVENT_CPP = $(PATH_TARGET)/Main/VBoxEvents.cpp
242
243testschemadefs: $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP)
244
245
246#
247# VBoxSVC executable
248#
249PROGRAMS += VBoxSVC
250VBoxSVC_TEMPLATE = VBOXMAINEXE
251VBoxSVC_DEFS = \
252 VBOX_MAIN_SETTINGS_ADDONS \
253 IN_VMM_STATIC \
254 $(VBOX_MAIN_DEFS) \
255 $(if $(VBOX_WITH_VBOXSDL),VBOX_WITH_VBOXSDL,) \
256 $(if $(VBOX_WITH_HEADLESS),VBOX_WITH_HEADLESS,) \
257 $(if $(VBOX_WITH_QTGUI),VBOX_WITH_QTGUI,) \
258 $(if $(VBOX_WITH_HGCM),VBOX_WITH_HGCM,) \
259 $(if $(VBOX_WITH_ALSA),VBOX_WITH_ALSA,) \
260 $(if $(VBOX_WITH_PULSE),VBOX_WITH_PULSE,) \
261 $(if $(VBOX_WITH_WINMM),VBOX_WITH_WINMM,) \
262 $(if $(VBOX_WITH_SOLARIS_OSS),VBOX_WITH_SOLARIS_OSS,) \
263 $(if $(VBOX_WITH_E1000),VBOX_WITH_E1000,) \
264 $(if $(VBOX_WITH_VIRTIO),VBOX_WITH_VIRTIO,) \
265 $(if $(VBOX_WITH_AHCI),VBOX_WITH_AHCI,) \
266 $(if $(VBOX_WITH_LSILOGIC),VBOX_WITH_LSILOGIC,) \
267 $(if $(VBOX_WITH_LINUX_COMPILER_H),VBOX_WITH_LINUX_COMPILER_H,) \
268 $(if $(VBOX_WITH_RESOURCE_USAGE_API),VBOX_WITH_RESOURCE_USAGE_API,) \
269 $(if $(VBOX_WITH_PDM_ASYNC_COMPLETION),VBOX_WITH_PDM_ASYNC_COMPLETION,) \
270 $(if $(VBOX_WITH_DBUS),$(if $(VBOX_USB_WITH_DBUS),VBOX_USB_WITH_DBUS,),) \
271 $(if $(VBOX_USB_WITH_SYSFS),VBOX_USB_WITH_SYSFS,) \
272 $(if $(VBOX_USB_WITH_INOTIFY),VBOX_USB_WITH_INOTIFY,) \
273 $(if $(VBOX_WITH_LIVE_MIGRATION),VBOX_WITH_LIVE_MIGRATION,) \
274 $(if $(VBOX_WITH_EXTPACK),VBOX_WITH_EXTPACK,) \
275 $(if $(VBOX_WITH_VUSB),VBOX_WITH_VUSB,) \
276 $(if $(VBOX_WITH_S3),VBOX_WITH_S3,) \
277 $(if $(VBOX_WITH_PCI_PASSTHROUGH),VBOX_WITH_PCI_PASSTHROUGH,) \
278 $(if $(VBOX_WITH_NAT_SERVICE),VBOX_WITH_NAT_SERVICE,)
279ifdef VBOX_WITH_USB
280 VBoxSVC_DEFS += \
281 VBOX_WITH_USB \
282 $(if $(VBOX_WITH_EHCI),VBOX_WITH_EHCI,) \
283 $(if $(VBOX_WITH_NEW_USB_CODE_ON_DARWIN),VBOX_WITH_NEW_USB_CODE_ON_DARWIN,)
284endif
285VBoxSVC_DEFS.win += VBOX_COM_OUTOFPROC_MODULE
286VBoxSVC_DEFS.win += _WIN32_WINNT=0x0510
287# Try to load and use libhal at runtime for probing removable media
288# VBoxSVC_DEFS.linux += VBOX_USE_LIBHAL
289VBoxSVC_DEFS.solaris += VBOX_USE_LIBHAL
290VBoxSVC_DEFS.freebsd += VBOX_USE_LIBHAL
291
292VBoxSVC_CXXFLAGS = $(filter-out -Wno-unused,$(TEMPLATE_VBOXMAINEXE_CXXFLAGS))
293
294VBoxSVC_DEPS = $(filter %.h,$(VBoxAPIWrap_GENERATEDSOURCES))
295
296VBoxSVC_INCS = \
297 include \
298 $(VBoxSVC_0_OUTDIR) \
299 $(dir $(VBOX_XML_SCHEMADEFS_H)) \
300 $(VBOX_MAIN_APIWRAPPER_INCS) \
301 .
302VBoxSVC_INCS.win = \
303 $(VBoxCOM_0_OUTDIR)
304ifdef VBOX_WITH_USB
305 VBoxSVC_INCS.os2 = \
306 $(PATH_ROOT)/src/VBox/HostDrivers/VBoxUSB/os2
307endif
308
309VBoxSVC_LIBS += \
310 $(PATH_STAGE_LIB)/VBoxAPIWrap$(VBOX_SUFF_LIB) \
311 $(PATH_STAGE_LIB)/SSMStandalone$(VBOX_SUFF_LIB) \
312 $(LIB_DDU)
313VBoxSVC_SDKS = VBOX_LIBPNG VBOX_ZLIB
314VBoxSVC_LIBS.solaris = \
315 adm \
316 nsl \
317 devinfo \
318 socket \
319 $(LIB_VMM)
320
321VBoxSVC_INTERMEDIATES = \
322 $(VBOX_MAIN_PREREQS) \
323 $(VBOX_XML_SCHEMADEFS_H) \
324 $(VBOX_AUTOGEN_EVENT_H)
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_DEPS = $(filter %.h,$(VBoxAPIWrap_GENERATEDSOURCES))
623
624VBoxC_INCS = \
625 include \
626 $(VBoxC_0_OUTDIR) \
627 $(VBOX_MAIN_APIWRAPPER_INCS) \
628 $(dir $(VBOX_XML_SCHEMADEFS_H))
629VBoxC_INCS.win = \
630 $(VBoxCOM_0_OUTDIR) \
631 .
632
633VBoxC_LDFLAGS.darwin = \
634 -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxC.dylib \
635 -exported_symbols_list $(VBoxC_0_OUTDIR)/VBoxC.def \
636 -framework IOKit
637VBoxC_LDFLAGS.win += /MANIFEST
638
639VBoxC_LIBS += \
640 $(PATH_STAGE_LIB)/VBoxAPIWrap$(VBOX_SUFF_LIB) \
641 $(if-expr "$(LIB_VMM)" == "$(VBOX_LIB_VMM_LAZY)",$(LIB_REM),) \
642 $(VBOX_LIB_VMM_LAZY)
643ifdef VBOX_WITH_NETFLT
644 VBoxC_LIBS.win += \
645 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
646 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/Newdev.lib \
647 $(PATH_STAGE_LIB)/WinNetConfig$(VBOX_SUFF_LIB) \
648 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
649 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib \
650 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib
651endif
652
653ifdef VBOX_WITH_CROGL
654 VBoxC_LIBS += $(PATH_STAGE_LIB)/VBoxOGLTest$(VBOX_SUFF_LIB)
655 VBoxC_LDFLAGS.darwin += -framework OpenGL
656endif
657
658VBoxC_INTERMEDIATES = \
659 $(VBOX_MAIN_PREREQS) \
660 $(VBOX_XML_SCHEMADEFS_H) \
661 $(VBOX_AUTOGEN_EVENT_H)
662
663VBoxC_SOURCES = \
664 src-all/DisplayPNGUtil.cpp \
665 src-all/DisplayResampleImage.cpp \
666 src-all/DisplayUtils.cpp \
667 src-all/EventImpl.cpp \
668 src-all/Global.cpp \
669 src-all/HashedPw.cpp \
670 src-all/Logging.cpp \
671 src-all/PCIDeviceAttachmentImpl.cpp \
672 src-all/ProgressImpl.cpp \
673 src-all/SharedFolderImpl.cpp \
674 src-all/VirtualBoxBase.cpp \
675 src-all/VirtualBoxErrorInfoImpl.cpp \
676 $(if $(VBOX_WITH_EXTPACK),src-all/ExtPackManagerImpl.cpp src-all/ExtPackUtil.cpp,) \
677 src-client/UsbWebcamInterface.cpp \
678 $(if $(VBOX_WITH_USB_CARDREADER),src-client/UsbCardReader.cpp,) \
679 src-client/Nvram.cpp \
680 src-client/AdditionsFacilityImpl.cpp \
681 src-client/AudioSnifferInterface.cpp \
682 src-client/BusAssignmentManager.cpp \
683 $(if $(VBOX_WITH_PCI_PASSTHROUGH),src-client/PCIRawDevImpl.cpp,) \
684 src-client/ClientTokenHolder.cpp \
685 src-client/ConsoleImpl.cpp \
686 src-client/ConsoleImpl2.cpp \
687 src-client/ConsoleImplTeleporter.cpp \
688 src-client/ConsoleVRDPServer.cpp \
689 src-client/DisplayImpl.cpp \
690 src-client/EmulatedUSBImpl.cpp \
691 src-client/GuestImpl.cpp \
692 src-client/GuestDirectoryImpl.cpp \
693 src-client/GuestFileImpl.cpp \
694 src-client/GuestFsObjInfoImpl.cpp \
695 src-client/GuestProcessImpl.cpp \
696 src-client/GuestSessionImpl.cpp \
697 src-client/GuestCtrlImpl.cpp \
698 src-client/KeyboardImpl.cpp \
699 src-client/MachineDebuggerImpl.cpp \
700 src-client/MouseImpl.cpp \
701 src-client/RemoteUSBDeviceImpl.cpp \
702 src-client/SessionImpl.cpp \
703 src-client/USBDeviceImpl.cpp \
704 src-client/VBoxDriversRegister.cpp \
705 src-client/VirtualBoxClientImpl.cpp \
706 src-client/VMMDevInterface.cpp \
707 $(VBOX_AUTOGEN_EVENT_CPP) \
708 $(VBOX_XML_SCHEMADEFS_CPP)
709VBoxC_SOURCES.win = \
710 src-client/win/dllmain.cpp \
711 src-client/win/VBoxC.def \
712 src-client/win/VBoxC.rc
713ifdef VBOX_WITH_GUEST_CONTROL
714 VBoxC_SOURCES += \
715 src-client/GuestSessionImplTasks.cpp \
716 src-client/GuestCtrlPrivate.cpp
717endif
718ifdef VBOX_WITH_DRAG_AND_DROP
719 VBoxC_SOURCES += \
720 src-client/GuestDnDImpl.cpp
721endif
722ifdef VBOX_WITH_XPCOM
723 VBoxC_SOURCES += \
724 src-client/xpcom/module.cpp
725endif
726ifdef VBOX_WITH_HGCM
727 VBoxC_SOURCES += \
728 src-client/HGCMObjects.cpp \
729 src-client/HGCMThread.cpp \
730 src-client/HGCM.cpp
731endif
732ifdef VBOX_WITH_USB
733 VBoxC_SOURCES += \
734 src-client/RemoteUSBBackend.cpp
735endif
736ifdef VBOX_WITH_VPX
737 VBoxC_SOURCES += \
738 src-client/EbmlWriter.cpp \
739 src-client/VideoRec.cpp
740endif
741
742ifeq ($(KBUILD_TARGET),darwin)
743VBoxC_ORDERDEPS += $(VBoxC_0_OUTDIR)/VBoxC.def
744VBoxC_CLEAN += $(VBoxC_0_OUTDIR)/VBoxC.def
745$$(VBoxC_0_OUTDIR)/VBoxC.def: $(MAKEFILE_CURRENT)
746 $(RM) -f $@
747 $(APPEND) $@ _NSGetModule
748 $(APPEND) $@ _VBoxDriversRegister
749endif
750
751src-client/ConsoleImpl.cpp_DEFS = \
752 $(if $(VBOX_BLEEDING_EDGE),VBOX_BLEEDING_EDGE=\"$(VBOX_BLEEDING_EDGE)\",)
753
754
755src-client/win/VBoxC.rc_DEPS = $(VBoxC_0_OUTDIR)/VBoxC.rgs $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb
756VBoxC_CLEAN.win += $(VBoxC_0_OUTDIR)/VBoxC.rgs
757
758$$(VBoxC_0_OUTDIR)/VBoxC.rgs: $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
759 $(VBOX_XSLTPROC) --stringparam Module VBoxC -o $@ $< $(VBOX_XIDL_FILE)
760
761ifdef VBOX_WITH_32_ON_64_MAIN_API
762 #
763 # 32-bit VBox API Client In-Process module.
764 #
765 # This is currently just a 32-bit version of VBoxC. It might be desirable to
766 # split up VBoxC into a simple client and a VM client part later, in which
767 # case this module will be a simple client.
768 #
769 # Note! One important thing is that the typelib for this DLL must be build
770 # with the /env win32 switch and the VBoxC typelib with /env amd64, if
771 # not they will overwrite each others typelib module entry.
772 #
773 DLLS += VBoxClient-x86
774 VBoxClient-x86_TEMPLATE = VBoxMainComp-x86
775 VBoxClient-x86_EXTENDS = VBoxC
776 VBoxClient-x86_DEFS = VBOX_COM_INPROC_API_CLIENT $(VBoxC_DEFS)
777 VBoxClient-x86_INST.win = $(INST_DLL)x86/
778 VBoxClient-x86_INCS.win = \
779 $(VBoxClient-x86_0_OUTDIR) \
780 $(VBoxCOM-x86_0_OUTDIR) \
781 $(VBoxC_INCS.win)
782 VBoxClient-x86_SOURCES = \
783 src-all/EventImpl.cpp \
784 src-all/Global.cpp \
785 src-all/VirtualBoxBase.cpp \
786 src-all/VirtualBoxErrorInfoImpl.cpp \
787 src-client/ClientTokenHolder.cpp \
788 src-client/SessionImpl.cpp \
789 src-client/VirtualBoxClientImpl.cpp \
790 $(VBOX_AUTOGEN_EVENT_CPP) \
791 $(VBOX_XML_SCHEMADEFS_CPP)
792 VBoxClient-x86_SOURCES.win = \
793 src-client/win/dllmain.cpp \
794 src-client/win/VBoxClient-x86.def \
795 src-client/win/VBoxClient-x86.rc
796 ifdef VBOX_WITH_XPCOM
797 VBoxClient-x86_SOURCES += \
798 src-client/xpcom/module.cpp
799 endif
800 VBoxClient-x86_LIBS = $(NO_SUCH_VARIABLE)
801 VBoxClient-x86_LIBS.win = $(NO_SUCH_VARIABLE)
802 VBoxClient-x86_CLEAN.win += $$(VBoxClient-x86_0_OUTDIR)/VBoxClient-x86.rgs
803 src-client/win/VBoxClient-x86.rc_DEPS = \
804 $(VBoxClient-x86_0_OUTDIR)/VBoxClient-x86.rgs \
805 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox-x86.tlb
806
807 $$(VBoxClient-x86_0_OUTDIR)/VBoxClient-x86.rgs: \
808 $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl \
809 $(VBOX_XIDL_FILE) | $$(dir $$@)
810 $(VBOX_XSLTPROC) --stringparam Module VBoxC -o $@ $< $(VBOX_XIDL_FILE)
811
812endif
813
814
815#
816# VBoxCOM - COM Abstraction Layer library
817#
818LIBRARIES += VBoxCOM
819VBoxCOM_TEMPLATE = VBoxMainLib
820VBoxCOM_INTERMEDIATES = $(VBOX_MAIN_PREREQS)
821VBoxCOM_SOURCES = \
822 glue/com.cpp \
823 glue/initterm.cpp \
824 glue/string.cpp \
825 glue/AutoLock.cpp \
826 glue/EventQueue.cpp \
827 glue/NativeEventQueue.cpp \
828 glue/ErrorInfo.cpp \
829 glue/errorprint.cpp
830VBoxCOM_INCS += \
831 include
832ifeq ($(KBUILD_TARGET),win)
833 VBoxCOM_DEFS.x86 = _WIN32_WINNT=0x0500
834 VBoxCOM_DEFS.amd64 = _WIN32_WINNT=0x0510
835 VBoxCOM_SOURCES.win = \
836 $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c
837else # !win
838 VBoxCOM_SOURCES += \
839 glue/xpcom/helpers.cpp
840endif # !win
841
842glue/com.cpp_DEFS = \
843 $(if $(VBOX_BLEEDING_EDGE),VBOX_BLEEDING_EDGE=\"$(VBOX_BLEEDING_EDGE)\",) \
844 KBUILD_TYPE=\"$(KBUILD_TYPE)\"
845
846# 32-bit version of VBoxCOM.
847ifdef VBOX_WITH_32_ON_64_MAIN_API
848 LIBRARIES += VBoxCOM-x86
849 VBoxCOM-x86_TEMPLATE = VBoxMainLib-x86
850 VBoxCOM-x86_EXTENDS = VBoxCOM
851 VBoxCOM-x86_SOURCES.win = \
852 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c
853endif
854
855
856
857#
858# The VBoxExtPackHelperApp.
859#
860ifdef VBOX_WITH_EXTPACK
861 PROGRAMS += VBoxExtPackHelperApp
862 VBoxExtPackHelperApp_TEMPLATE = VBoxR3SetUidToRoot
863 VBoxExtPackHelperApp_LDFLAGS.darwin = -framework Security
864 VBoxExtPackHelperApp_LDFLAGS.win = /SUBSYSTEM:windows
865 VBoxExtPackHelperApp_SOURCES = \
866 src-helper-apps/VBoxExtPackHelperApp.cpp \
867 src-all/ExtPackUtil.cpp
868 VBoxExtPackHelperApp_LIBS = \
869 $(LIB_RUNTIME)
870endif # VBOX_WITH_EXTPACK
871
872#
873# VolInfo
874#
875ifdef VBOX_WITH_DEVMAPPER
876 PROGRAMS.linux += VBoxVolInfo
877 VBoxVolInfo_TEMPLATE = VBoxR3SetUidToRoot
878 VBoxVolInfo_SOURCES = src-helper-apps/VBoxVolInfo.cpp
879 VBoxVolInfo_LIBS = devmapper
880endif
881
882endif # !VBOX_ONLY_SDK (the ifndef is far above)
883
884
885#
886# Installs com related thing(s) to bin.
887#
888INSTALLS.win += VBoxMain-com-inst
889VBoxMain-com-inst_INST = $(INST_BIN)
890VBoxMain-com-inst_MODE = a+r,u+w
891VBoxMain-com-inst_SOURCES = src-all/win/comregister.cmd
892
893
894if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "linux"
895 #
896 # Installs linux/hardening related things to components.
897 #
898 INSTALLS.linux += VBoxMain-hardening-inst
899 VBoxMain-hardening-inst_INST = $(INST_BIN)components/
900 VBoxMain-hardening-inst_SYMLINKS = \
901 VBoxDDU.so=>../VBoxDDU.so \
902 VBoxREM.so=>../VBoxREM.so \
903 VBoxRT.so=>../VBoxRT.so \
904 VBoxVMM.so=>../VBoxVMM.so \
905 VBoxXPCOM.so=>../VBoxXPCOM.so
906endif
907
908
909# generate rules
910include $(FILE_KBUILD_SUB_FOOTER)
911
912
913
914#
915# Additions rules.
916#
917
918## @todo this hack ain't cutting it any longer. (the file name is abspath'ed since ages now.)
919glue/xpcom/helpers.cpp: $(VBOX_IDL_TYPELIB.XPCOM)
920
921$(VBOX_IDL_FILE.XPCOM): $(VBOX_PATH_MAIN_SRC)/idl/xpidl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
922 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
923 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
924
925$(VBOX_IDL_TYPELIB.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
926 $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
927 $(QUIET)$(VBOX_XPIDL_ENV)$(VBOX_XPIDL) -m typelib -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
928 $(CHMOD) 0644 $@
929## @todo ^^^^^^^^^^^^ fix horrible hack
930
931$(VBOX_IDL_HEADER.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
932 $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
933 $(QUIET)$(VBOX_XPIDL_ENV)$(VBOX_XPIDL) -m header -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
934
935$(VBOX_IDL_FILE.MSCOM): $(VBOX_PATH_MAIN_SRC)/idl/midl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
936 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
937 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
938
939# Aliases for testing purposes.
940ifdef VBOX_WITH_XPCOM
941testidl: $(VBOX_IDL_FILE.XPCOM) $(VBOX_IDL_TYPELIB.XPCOM)
942testidlhdr: $(VBOX_IDL_HEADER.XPCOM)
943else
944testidl: $(VBOX_IDL_FILE.MSCOM) $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
945 $(if $(VBOX_WITH_32_ON_64_MAIN_API),$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c,)
946endif
947
948
949$(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
950+ $(VBoxCOM_0_OUTDIR)/VirtualBox.h \
951+ $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb: $(VBOX_IDL_FILE.MSCOM) | $$(dir $$@)
952 $(VBOX_WIN_MIDL) /nologo \
953 $(if-expr "$(KBUILD_TARGET_ARCH)" == "amd64" && "$(KBUILD_HOST)" == "win",/env amd64,/env win32) /target NT51 \
954 /out $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxCOM_0_OUTDIR)) \
955 /cpp_cmd $(subst $(EXEC_X86_WIN32),,$(call VBOX_FN_MAKE_WIN_PATH,$(TOOL_$(VBOX_VCC_TOOL)_CC))) \
956 /I $(call VBOX_FN_MAKE_WIN_PATH,$(PATH_SDK_$(VBOX_WINPSDK)_INC)) \
957 /I idl \
958 $(call VBOX_FN_MAKE_WIN_PATH,$<)
959
960$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c \
961+ $(VBoxCOM-x86_0_OUTDIR)/VirtualBox.h \
962+ $(VBoxCOM-x86_0_OUTDIR)/VirtualBox-x86.tlb: $(VBOX_IDL_FILE.MSCOM) | $$(dir $$@)
963 $(VBOX_WIN_MIDL) /nologo /env win32 /target NT51 \
964 /out $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxCOM-x86_0_OUTDIR)) \
965 /tlb $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox-x86.tlb) \
966 /cpp_cmd $(subst $(EXEC_X86_WIN32),,$(call VBOX_FN_MAKE_WIN_PATH,$(TOOL_$(VBOX_VCC_TOOL_STEM)X86_CC))) \
967 /I $(call VBOX_FN_MAKE_WIN_PATH,$(PATH_SDK_$(VBOX_WINPSDK)_INC)) \
968 /I idl \
969 $(call VBOX_FN_MAKE_WIN_PATH,$<)
970
971#
972# Translation stuff
973#
974VBoxSVC_VBOX_HEADERS = \
975 include/collection.h \
976 include/MachineImpl.h
977VBoxSVC_VBOX_TRANSLATIONS = \
978 nls/VBoxSVC_de.ts
979
980VBoxC_VBOX_HEADERS = \
981 include/ConsoleImpl.h
982VBoxC_VBOX_TRANSLATIONS = \
983 nls/VBoxC_de.ts
984
985ifdef VBOX_WITH_JMSCOM
986
987#
988# Java glue JAR files
989#
990VBOX_JMSCOM_JAR = $(VBoxJMscom-inst-jar_0_OUTDIR)/vboxjmscom.jar
991VBOX_JMSCOM_TARGET := $(PATH_TARGET)/vboxjmscom-gen
992VBOX_JMSCOM_GEN = $(VBOX_JMSCOM_TARGET)/jmscomgen
993VBOX_JMSCOM_JDEST := $(VBOX_JMSCOM_TARGET)/jdest
994VBOX_GLUE_XSLT_DIR := $(PATH_ROOT)/src/VBox/Main/glue
995VBOX_JACOB_DIR := $(PATH_ROOT)/src/libs/jacob-1.15-M3
996
997INSTALLS += VBoxJMscom-inst-jar
998VBoxJMscom-inst-jar_INST = $(INST_SDK)bindings/mscom/java/
999VBoxJMscom-inst-jar_MODE = a+r,u+w
1000VBoxJMscom-inst-jar_SOURCES = \
1001 $(VBOX_JMSCOM_JAR)
1002VBoxJMscom-inst-jar_CLEAN = \
1003 $(VBOX_JMSCOM_JAR) \
1004 $(VBOX_JMSCOM_GEN)/jmscomglue.list \
1005 $(wildcard \
1006 $(VBOX_JMSCOM_GEN)/java/*.java \
1007 $(VBOX_JMSCOM_JDEST)/*.class \
1008 $(VBOX_JMSCOM_JDEST)/*/*.class \
1009 $(VBOX_JMSCOM_JDEST)/*/*/*.class \
1010 $(VBOX_JMSCOM_JDEST)/*/*/*/*.class \
1011 )
1012VBoxJMscom-inst-jar_BLDDIRS += $(VBOX_JMSCOM_GEN)/java
1013
1014$(VBOX_JMSCOM_GEN)/jmscomglue.list: \
1015 $(VBOX_XIDL_FILE) \
1016 $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl \
1017 $(VBOX_FILESPLIT) \
1018 | $(VBOX_JMSCOM_GEN)/java/
1019 $(call MSG_L1,Generating Java MSCOM glue files from XIDL)
1020 $(QUIET)$(RM) -f $(wildcard $(VBOX_JMSCOM_GEN)/java/*.java)
1021 $(QUIET)$(VBOX_XSLTPROC) \
1022 --stringparam G_vboxApiSuffix $(VBOX_API_SUFFIX) \
1023 --stringparam G_vboxGlueStyle mscom \
1024 --stringparam G_vboxDirPrefix "" \
1025 -o $(VBOX_JMSCOM_GEN)/java/merged.file $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl $<
1026 $(QUIET)$(VBOX_FILESPLIT) $(VBOX_JMSCOM_GEN)/java/merged.file $(VBOX_JMSCOM_GEN)/java
1027 $(QUIET)echo $(VBOX_JMSCOM_GEN)/java/*.java > $@
1028
1029$$(VBOX_JMSCOM_JAR): $(VBOX_JMSCOM_GEN)/jmscomglue.list | $$(dir $$@)
1030 $(call MSG_TOOL,javac,$(notdir $@),jmscomgen.list,)
1031 $(QUIET)$(RM) -Rf $(VBOX_JMSCOM_JDEST)
1032 $(QUIET)$(MKDIR) -p $(VBOX_JMSCOM_JDEST)
1033 $(call MSG_TOOL,javac,$(notdir $@),...,)
1034 $(VBOX_JAVAC) $(VBOX_JAVAC_OPTS) \
1035 @$(VBOX_JMSCOM_GEN)/jmscomglue.list \
1036 -d $(VBOX_JMSCOM_JDEST) -classpath "$(VBOX_JMSCOM_JDEST)$(VBOX_SEP)$(VBOX_JACOB_DIR)/jacob.jar"
1037 $(call MSG_LINK,$(notdir $@),$@)
1038 $(VBOX_JAR) cf $@ -C $(VBOX_JMSCOM_JDEST) .
1039
1040## @todo compile TestVBox.java (see below) to have sanity checking
1041
1042endif # VBOX_WITH_JMSCOM
1043
1044#
1045# Install Java glue sample code.
1046#
1047INSTALLS += javagluesample
1048javagluesample_INST = $(INST_SDK)bindings/glue/java/
1049javagluesample_MODE = a+r,u+w
1050javagluesample_SOURCES = \
1051 $(VBOX_PATH_MAIN_SRC)/glue/tests/TestVBox.java=>TestVBox.java \
1052 $(VBOX_PATH_MAIN_SRC)/glue/tests/Makefile=>Makefile
1053
1054# Moved those rules to the end so that VBoxAPIWrap_0_OUTDIR can be expanded without $$ trickery.
1055$(VBoxAPIWrap_RAWSRC) \
1056+| $(VBoxAPIWrap_GENERATEDSOURCES): \
1057 $(VBOX_XIDL_FILE) \
1058 $(VBoxAPIWrap_XSLT) \
1059 $(VBOX_FILESPLIT) \
1060 | $$(dir $$@)
1061 $(call MSG_L1,Generating C++ Server API wrapper files from XIDL)
1062 $(QUIET)$(RM) -f $(filter-out $(VBoxAPIWrap_GENERATEDSOURCES),$(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.cpp) $(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.h))
1063 $(QUIET)$(VBOX_XSLTPROC) --stringparam filelistonly "" -o $@ $(VBoxAPIWrap_XSLT) $<
1064 $(QUIET)$(VBOX_FILESPLIT) $@ $(VBoxAPIWrap_0_OUTDIR)
1065
1066$(VBoxAPIWrap_KMK).ts +| $(VBoxAPIWrap_KMK): $(VBOX_XIDL_FILE) $(VBoxAPIWrap_XSLT)
1067 $(call MSG_GENERATE,,$(VBoxAPIWrap_KMK))
1068 $(QUIET)$(RM) -f $@
1069 $(QUIET)$(MKDIR) -p $(@D)
1070 $(QUIET)$(VBOX_XSLTPROC) --stringparam filelistonly VBoxAPIWrap_VBOX_APIWRAPPERFILES -o $@ $(VBoxAPIWrap_XSLT) $<
1071 $(QUIET)$(CP) --changed -fv $@ $(VBoxAPIWrap_KMK)
1072
1073updatenls::
1074 $(VBOX_LUPDATE) $(VBoxSVC_SOURCES) $(VBoxSVC_VBOX_HEADERS) -ts $(VBoxSVC_VBOX_TRANSLATIONS)
1075 $(VBOX_LUPDATE) $(VBoxC_SOURCES) $(VBoxC_VBOX_HEADERS) -ts $(VBoxC_VBOX_TRANSLATIONS)
1076
1077testconverter:: $(VBOX_USER_HOME)/VirtualBox.xml
1078 $(call MSG_TOOL,xsltproc,Test Settings Converter,$<,$(VBOX_USER_HOME)/VirtualBox.xml.test)
1079 $(QUIET)$(VBOX_XSLTPROC) -o $(VBOX_USER_HOME)/VirtualBox.xml.test xml/SettingsConverter.xsl $<
1080
1081testconverter2:: $(VBOX_USER_HOME)/Machines/dos/dos.xml
1082 $(call MSG_TOOL,xsltproc,Test Settings Converter,$<,$<.test)
1083 $(QUIET)$(VBOX_XSLTPROC) -o $<.test xml/SettingsConverter.xsl $<
1084
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