VirtualBox

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

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

wine build fix.

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