VirtualBox

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

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

Devices/Graphics: VMware SVGA II compatible graphics emulation (2D only), including the associated small API and VBoxManage changes, contributed by trivirt AG.

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