VirtualBox

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

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

32-bit on 64-bit proxy dll (still disabled), made comregister.cmd register the proxy stuff when present.

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