VirtualBox

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

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

Main: don't build VBoxAPIWrap for SDK

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