VirtualBox

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

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

depend build fix, 2nd try.

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