VirtualBox

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

Last change on this file since 64664 was 64511, checked in by vboxsync, 8 years ago

Tabs.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 51.1 KB
Line 
1# $Id: Makefile.kmk 64511 2016-11-01 15:13:05Z vboxsync $
2## @file
3# Makefile for the VBox Main module.
4#
5
6#
7# Copyright (C) 2004-2016 Oracle Corporation
8#
9# This file is part of VirtualBox Open Source Edition (OSE), as
10# available from http://www.virtualbox.org. This file is free software;
11# you can redistribute it and/or modify it under the terms of the GNU
12# General Public License (GPL) as published by the Free Software
13# Foundation, in version 2 as it comes in the "COPYING" file of the
14# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16#
17
18SUB_DEPTH = ../../..
19include $(KBUILD_PATH)/subheader.kmk
20
21#
22# Make sure our Config.kmk is included.
23#
24ifndef VBOX_MAIN_CONFIG_KMK_INCLUDED
25 include $(PATH_SUB_CURRENT)/Config.kmk
26endif
27
28#
29# Include sub-makefile(s).
30#
31ifdef VBOX_WITH_WEBSERVICES
32 include $(PATH_SUB_CURRENT)/webservice/Makefile.kmk
33endif
34include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
35include $(PATH_SUB_CURRENT)/cbinding/Makefile.kmk
36
37
38#
39# Targets and globals (bit of a mess...)
40#
41VBOX_PATH_MAIN_SRC := $(PATH_SUB_CURRENT)
42
43ifdef VBOX_ONLY_SDK
44 # I'm Evil! Dr. Evil.
45 VBoxCOM_0_OUTDIR = $(PATH_TARGET)/VBoxCOM
46 BLDDIRS += $(VBoxCOM_0_OUTDIR) $(PATH_STAGE_BIN)/components
47 include $(KBUILD_PATH)/tools/$(VBOX_VCC_TOOL).kmk # For the idl /cpp statement.
48 include $(KBUILD_PATH)/sdks/$(VBOX_WINPSDK).kmk
49endif # !VBOX_ONLY_SDK
50
51
52# Construct VBOX_MAIN_DEFS
53## @todo eliminate or expand VBOX_MAIN_DEFS.
54VBOX_MAIN_DEFS =
55ifneq ($(KBUILD_TARGET),win)
56 ifndef VBOX_WITH_XPCOM
57 $(error "VBox: VBOX_WITH_XPCOM isn't defined")
58 endif
59 VBOX_MAIN_DEFS += VBOX_WITH_GENERIC_SESSION_WATCHER
60endif
61VBOX_MAIN_DEFS += \
62 $(if $(VBOX_WITH_RAW_MODE),VBOX_WITH_RAW_MODE,) \
63 $(if $(VBOX_WITH_RAW_RING1),VBOX_WITH_RAW_RING1,) \
64 $(if $(VBOX_WITH_VMSVGA),VBOX_WITH_VMSVGA,) \
65 $(if $(VBOX_WITH_VMSVGA3D),VBOX_WITH_VMSVGA3D,) \
66 $(if $(VBOX_WITH_NETFLT),VBOX_WITH_NETFLT,) \
67 $(if $(VBOX_WITH_COPYTOGUEST),VBOX_WITH_COPYTOGUEST,) \
68 $(if $(VBOX_WITH_CROGL),VBOX_WITH_CROGL,) \
69 $(if $(VBOX_WITH_CRHGSMI),VBOX_WITH_CRHGSMI,) \
70 $(if $(VBOX_WITH_GUEST_PROPS),VBOX_WITH_GUEST_PROPS,) \
71 $(if $(VBOX_WITH_GUEST_PROPS_RDONLY_GUEST),VBOX_WITH_GUEST_PROPS_RDONLY_GUEST,) \
72 $(if $(VBOX_WITH_GUEST_CONTROL),VBOX_WITH_GUEST_CONTROL,) \
73 $(if $(VBOX_WITH_USB_CARDREADER),VBOX_WITH_USB_CARDREADER,) \
74 $(if $(VBOX_WITH_USB_CARDREADER_TEST),VBOX_WITH_USB_CARDREADER_TEST,) \
75 $(if $(VBOX_WITH_HOSTNETIF_API),VBOX_WITH_HOSTNETIF_API,) \
76 $(if $(VBOX_WITH_MIDL_PROXY_STUB),VBOX_WITH_MIDL_PROXY_STUB,) \
77
78# Unconditionally enable the new semaphore key generation code
79VBOX_MAIN_DEFS += VBOX_WITH_NEW_SYS_V_KEYGEN
80
81VBOX_IDL_FILE.MSCOM = $(VBOX_PATH_SDK)/bindings/mscom/idl/VirtualBox.idl
82VBOX_IDL_FILE.XPCOM = $(VBOX_PATH_SDK)/bindings/xpcom/idl/VirtualBox_XPCOM.idl
83
84VBOX_IDL_TYPELIB.XPCOM = $(PATH_STAGE_BIN)/components/VirtualBox_XPCOM.xpt
85VBOX_IDL_HEADER.XPCOM = $(VBOX_PATH_SDK)/bindings/xpcom/include/VirtualBox_XPCOM.h
86
87# The MS COM specific stuff.
88if defined(VBOX_ONLY_SDK) || "$(KBUILD_TARGET)" == "win"
89 OTHERS += \
90 $(VBOX_IDL_FILE.MSCOM)
91 OTHER_CLEAN += \
92 $(VBOX_IDL_FILE.MSCOM)
93
94 INSTALLS += VBox-mscom-bindings-include VBox-mscom-bindings-lib
95 VBox-mscom-bindings-include_INST = $(INST_SDK)bindings/mscom/include/
96 VBox-mscom-bindings-include_MODE = a+r,u+w
97 VBox-mscom-bindings-include_SOURCES = $(VBoxCOM_0_OUTDIR)/VirtualBox.h
98 VBox-mscom-bindings-include_CLEAN = $(VBoxCOM_0_OUTDIR)/VirtualBox.h
99 VBox-mscom-bindings-lib_INST = $(INST_SDK)bindings/mscom/lib/
100 VBox-mscom-bindings-lib_MODE = a+r,u+w
101 VBox-mscom-bindings-lib_SOURCES = $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
102 $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb
103 VBox-mscom-bindings-lib_CLEAN = $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
104 $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb
105
106 BLDDIRS += $(VBOX_PATH_SDK)/bindings/mscom/idl
107endif
108
109# The XPCOM specific stuff.
110# if defined(VBOX_ONLY_SDK) || "$(KBUILD_TARGET)" != "win" -- does not build on Windows
111if "$(KBUILD_TARGET)" != "win"
112 OTHERS += $(VBOX_IDL_FILE.XPCOM) $(VBOX_IDL_TYPELIB.XPCOM) $(VBOX_IDL_HEADER.XPCOM)
113 OTHER_CLEAN += \
114 $(VBOX_IDL_FILE.XPCOM) \
115 $(VBOX_IDL_HEADER.XPCOM) \
116 $(VBOX_IDL_TYPELIB.XPCOM)
117
118 INSTALLS += VBox-xpcom-bindings-lib
119 VBox-xpcom-bindings-lib_INST = $(INST_SDK)bindings/xpcom/lib/
120 VBox-xpcom-bindings-lib_MODE = a+r,u+w
121 VBox-xpcom-bindings-lib_SOURCES = $(VBoxCOM_0_OUTDIR)/VirtualBox_XPCOM_i.c=>VirtualBox_i.c
122 VBox-xpcom-bindings-lib_CLEAN = $(VBoxCOM_0_OUTDIR)/VirtualBox_XPCOM_i.c
123
124 VBOX_MAIN_PREREQS += $(VBOX_IDL_TYPELIB.XPCOM) $(VBOX_IDL_HEADER.XPCOM)
125 BLDDIRS += \
126 $(VBOX_PATH_SDK)/bindings/xpcom/idl \
127 $(VBOX_PATH_SDK)/bindings/xpcom/include
128endif # xpcom
129
130
131#
132# Strip documentation from source XIDL so that we don't get a full
133# recompile every time a comma in the documentation is changed.
134#
135$(VBOX_XIDL_FILE).ts +| $(VBOX_XIDL_FILE): \
136 $(VBOX_XIDL_FILE_SRC) \
137 $(VBOX_PATH_MAIN_SRC)/idl/docstrip.xsl \
138 | $$(dir $$@)
139# $(CP) -fv $< $(VBOX_XIDL_FILE).ts
140 $(QUIET)$(VBOX_XSLTPROC) -o $(VBOX_XIDL_FILE).ts $(VBOX_PATH_MAIN_SRC)/idl/docstrip.xsl $<
141 $(QUIET)$(CP) --changed -fv $(VBOX_XIDL_FILE).ts $(VBOX_XIDL_FILE)
142
143OTHER_CLEAN += $(VBOX_XIDL_FILE) $(VBOX_XIDL_FILE).ts
144
145#
146# The Main API documentation
147#
148VBOX_MAIN_DOC_DIR = $(VBOX_PATH_SDK)/docs
149BLDDIRS += $(VBOX_MAIN_DOC_DIR)
150
151$(PATH_TARGET)/docs.Main: \
152 $(VBOX_PATH_MAIN_SRC)/Doxyfile.Main \
153 $(VBOX_PATH_MAIN_SRC)/idl/doxygen.xsl \
154 $(VBOX_XIDL_FILE_SRC) \
155 | $(PATH_TARGET)/ \
156 $(VBOX_MAIN_DOC_DIR)/
157 $(call MSG_TOOL,xsltproc,doxygen input,$<,$@)
158 $(QUIET)$(RM) -f $(wildcard $(VBOX_MAIN_DOC_DIR)/html/*) $(PATH_TARGET)/docs.Main
159 $(QUIET)$(VBOX_XSLTPROC) -o $(PATH_TARGET)/VirtualBox.idl $(VBOX_PATH_MAIN_SRC)/idl/doxygen.xsl $(VBOX_XIDL_FILE_SRC)
160 $(QUIET)$(REDIRECT) -E 'DOCDIR=$(VBOX_MAIN_DOC_DIR)' -E 'PATH_TARGET=$(PATH_TARGET)' -E 'PATH_CHM=$(subst /,\,$(VBOX_MAIN_DOC_DIR)/VirtualBoxAPI.chm)' \
161 -- doxygen $(VBOX_PATH_MAIN_SRC)/Doxyfile.Main
162 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) ">>>>>>>>>>>>>>>>>>>> Main.err: >>>>>>>>>>>>>>>>>>>>>>>>"
163 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(CAT) "$(PATH_TARGET)/Main.err"
164 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "<<<<<<<<<<<<<<<<<<<< Main.err <<<<<<<<<<<<<<<<<<<<<<<<<"
165 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "===> **************************************************"
166 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "===> Please fix above doxygen errors/warnings listed in"
167 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "===> $(PATH_TARGET)/Main.err"
168 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "===> **************************************************"
169 -$(EXEC_X86_WIN32) $(VBOX_PATH_HTML_HELP_WORKSHOP)/hhc.exe $(subst /,\\,$(VBOX_MAIN_DOC_DIR)/html/index.hhp)
170 $(APPEND) $(PATH_TARGET)/docs.Main
171# aliases
172docs.main docs.Main: $(PATH_TARGET)/docs.Main
173if !defined(VBOX_ONLY_DOCS) && defined(VBOX_WITH_ALL_DOXYGEN_TARGETS)
174docs: $(PATH_TARGET)/docs.Main
175else
176docs:
177endif
178
179
180ifndef VBOX_ONLY_SDK
181 #
182 # Generate library with API class wrappers from the XIDL file.
183 #
184 LIBRARIES += VBoxAPIWrap
185 VBoxAPIWrap_TEMPLATE = VBoxMainLib
186 ifeq ($(KBUILD_TARGET),win)
187 VBoxAPIWrap_USES = vccprecomp
188 VBoxAPIWrap_PCH_HDR := $(PATH_SUB_CURRENT)/src-all/win/VBoxAPIWrap-precomp_vcc.h
189 endif
190 VBoxAPIWrap_SOURCES = \
191 $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d \
192 $(VBOX_MAIN_APIWRAPPER_GEN_SRCS)
193 VBoxAPIWrap_INTERMEDIATES = $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
194 VBoxAPIWrap_DEFS.win.x86 += _WIN32_WINNT=0x0500
195 VBoxAPIWrap_DEFS.win.amd64 += _WIN32_WINNT=0x0510
196 VBoxAPIWrap_INCS += \
197 include
198 VBoxAPIWrap_CLEAN = \
199 $(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.cpp) \
200 $(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.h) \
201 $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d.ts \
202 $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d \
203 $(VBoxAPIWrap_0_OUTDIR)/apiwrappers-headers \
204 $(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-even \
205 $(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-odd
206
207 # Two VBox variables used here and/or in the rules generating wrappers.
208 VBoxAPIWrap_VBOX_XSLT = \
209 $(VBOX_PATH_MAIN_SRC)/idl/apiwrap-server.xsl
210
211
212 # This include file (generated at the bottom of this file), defines
213 # VBOX_MAIN_APIWRAPPER_GEN_SRCS and VBOX_MAIN_APIWRAPPER_GEN_HDRS.
214 VBoxAPIWrap_VBOX_KMK_FILE = $(PATH_OUT)/vboxapiwrap.kmk
215 include $(VBoxAPIWrap_VBOX_KMK_FILE)
216
217 ifdef VBOX_WITH_32_ON_64_MAIN_API
218 LIBRARIES += VBoxAPIWrap-x86
219 VBoxAPIWrap-x86_TEMPLATE = VBoxMainLib-x86
220 VBoxAPIWrap-x86_EXTENDS = VBoxAPIWrap
221 VBoxAPIWrap-x86_DTRACE_HDR_FLAGS = -32 # ugly, should be fixed in the tool in Config.kmk
222 ifeq ($(KBUILD_TARGET),win) ## @todo fix inheritance
223 VBoxAPIWrap-x86_USES = vccprecomp
224 VBoxAPIWrap-x86_PCH_HDR := $(PATH_SUB_CURRENT)/src-all/win/VBoxAPIWrap-precomp_vcc.h
225 endif
226 endif
227
228endif # !VBOX_ONLY_SDK
229
230#
231# Some SDK bit.
232#
233INSTALLS += VBox-main-xidl
234VBox-main-xidl_INST = $(INST_SDK)bindings/
235VBox-main-xidl_MODE = a+r,u+w
236VBox-main-xidl_SOURCES = $(VBOX_XIDL_FILE_SRC)
237
238ifdef VBOX_WITH_PYTHON
239INSTALLS += VBox-python-glue
240VBox-python-glue_INST = $(INST_SDK)installer/vboxapi/
241VBox-python-glue_MODE = a+r,u+w
242VBox-python-glue_SOURCES = \
243 glue/vboxapi.py=>__init__.py \
244 $(VBox-python-glue_0_OUTDIR)/VirtualBox_constants.py
245VBox-python-glue_CLEAN = \
246 $(VBox-python-glue_0_OUTDIR)/VirtualBox_constants.py
247
248$$(VBox-python-glue_0_OUTDIR)/VirtualBox_constants.py: \
249 $(VBOX_PATH_MAIN_SRC)/glue/constants-python.xsl \
250 $(VBOX_XIDL_FILE) \
251 | $$(dir $$@)
252 $(call MSG_TOOL,xsltproc,Python constants,$<,$@)
253 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
254
255endif # VBOX_WITH_PYTHON
256
257ifndef VBOX_ONLY_SDK # Note this goes on for *very* long
258
259#
260# Generate SchemaDefs.h and SchemaDefs.cpp from XML Schema
261# These two files are used by both VBoxC and VBoxSVC.
262#
263BLDDIRS += $(PATH_TARGET)/Main
264
265testschemadefs: $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP)
266
267
268#
269# VBoxSVC executable
270#
271PROGRAMS += VBoxSVC
272VBoxSVC_TEMPLATE = VBOXMAINEXE
273if defined(VBOX_WITH_PRECOMPILED_HEADERS) && "$(KBUILD_TARGET)" == "win"
274 VBoxSVC_USES += vccprecomp
275 VBoxSVC_PCH_HDR := $(PATH_SUB_CURRENT)/src-server/win/precomp_vcc.h
276endif
277VBoxSVC_DEFS = \
278 VBOX_MAIN_SETTINGS_ADDONS \
279 IN_VMM_STATIC \
280 $(VBOX_MAIN_DEFS) \
281 $(if $(VBOX_WITH_VBOXSDL),VBOX_WITH_VBOXSDL,) \
282 $(if $(VBOX_WITH_HEADLESS),VBOX_WITH_HEADLESS,) \
283 $(if $(VBOX_WITH_QTGUI),VBOX_WITH_QTGUI,) \
284 $(if $(VBOX_WITH_HGCM),VBOX_WITH_HGCM,) \
285 $(if $(VBOX_WITH_AUDIO_OSS),VBOX_WITH_AUDIO_OSS,) \
286 $(if $(VBOX_WITH_AUDIO_ALSA),VBOX_WITH_AUDIO_ALSA,) \
287 $(if $(VBOX_WITH_AUDIO_PULSE),VBOX_WITH_AUDIO_PULSE,) \
288 $(if $(VBOX_WITH_AUDIO_DEBUG),VBOX_WITH_AUDIO_DEBUG,) \
289 $(if $(VBOX_WITH_AUDIO_VALIDATIONKIT),VBOX_WITH_AUDIO_VALIDATIONKIT,) \
290 $(if $(VBOX_WITH_VRDE_AUDIO),VBOX_WITH_VRDE_AUDIO,) \
291 $(if $(VBOX_WITH_E1000),VBOX_WITH_E1000,) \
292 $(if $(VBOX_WITH_VIRTIO),VBOX_WITH_VIRTIO,) \
293 $(if $(VBOX_WITH_AHCI),VBOX_WITH_AHCI,) \
294 $(if $(VBOX_WITH_LSILOGIC),VBOX_WITH_LSILOGIC,) \
295 $(if $(VBOX_WITH_LINUX_COMPILER_H),VBOX_WITH_LINUX_COMPILER_H,) \
296 $(if $(VBOX_WITH_RESOURCE_USAGE_API),VBOX_WITH_RESOURCE_USAGE_API,) \
297 $(if $(VBOX_WITH_PDM_ASYNC_COMPLETION),VBOX_WITH_PDM_ASYNC_COMPLETION,) \
298 $(if $(VBOX_WITH_DBUS),VBOX_WITH_DBUS,) \
299 $(if $(VBOX_WITH_DBUS),$(if $(VBOX_USB_WITH_DBUS),VBOX_USB_WITH_DBUS,),) \
300 $(if $(VBOX_USB_WITH_SYSFS),VBOX_USB_WITH_SYSFS,) \
301 $(if $(VBOX_USB_WITH_INOTIFY),VBOX_USB_WITH_INOTIFY,) \
302 $(if $(VBOX_WITH_LIVE_MIGRATION),VBOX_WITH_LIVE_MIGRATION,) \
303 $(if $(VBOX_WITH_EXTPACK),VBOX_WITH_EXTPACK,) \
304 $(if $(VBOX_WITH_VUSB),VBOX_WITH_VUSB,) \
305 $(if $(VBOX_WITH_PCI_PASSTHROUGH),VBOX_WITH_PCI_PASSTHROUGH,) \
306 $(if $(VBOX_WITH_NAT_SERVICE),VBOX_WITH_NAT_SERVICE,) \
307 $(if $(VBOX_WITH_CROGL),VBOX_WITH_CROGL,) \
308 $(if $(VBOX_WITH_CRHGSMI),VBOX_WITH_CRHGSMI,)
309ifdef VBOX_WITH_USB
310 VBoxSVC_DEFS += \
311 VBOX_WITH_USB \
312 $(if $(VBOX_WITH_EHCI),VBOX_WITH_EHCI,) \
313 $(if $(VBOX_WITH_NEW_USB_CODE_ON_DARWIN),VBOX_WITH_NEW_USB_CODE_ON_DARWIN,)
314endif
315VBoxSVC_DEFS.win += VBOX_COM_OUTOFPROC_MODULE
316VBoxSVC_DEFS.win += _WIN32_WINNT=0x0510
317# Try to load and use libhal at runtime for probing removable media
318# VBoxSVC_DEFS.linux += VBOX_USE_LIBHAL
319VBoxSVC_DEFS.solaris += VBOX_USE_LIBHAL
320
321if $(KBUILD_TARGET) != "win" && $(VBOX_GCC_VERSION_CXX) >= 40900 # gcc 4.9.x (4.8.x is causing endless RT_ELEMENT trouble)
322 VBoxSVC_CXXFLAGS = -Wunused -Wconversion
323endif
324
325VBoxSVC_INCS = \
326 include \
327 $(VBoxSVC_0_OUTDIR) \
328 $(dir $(VBOX_XML_SCHEMADEFS_H)) \
329 $(VBOX_MAIN_APIWRAPPER_INCS) \
330 .
331VBoxSVC_INCS.win = \
332 $(VBoxCOM_0_OUTDIR)
333ifdef VBOX_WITH_USB
334 VBoxSVC_INCS.os2 = \
335 $(PATH_ROOT)/src/VBox/HostDrivers/VBoxUSB/os2
336endif
337
338VBoxSVC_LIBS += \
339 $(PATH_STAGE_LIB)/VBoxAPIWrap$(VBOX_SUFF_LIB) \
340 $(PATH_STAGE_LIB)/SSMStandalone$(VBOX_SUFF_LIB) \
341 $(LIB_DDU)
342
343VBoxSVC_SDKS = VBOX_LIBPNG VBOX_ZLIB
344VBoxSVC_LIBS.solaris = \
345 adm \
346 nsl \
347 devinfo \
348 socket \
349 $(LIB_VMM)
350
351VBoxSVC_LIBS.win += \
352 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/dnsapi.lib
353
354VBoxSVC_INTERMEDIATES = \
355 $(VBOX_MAIN_PREREQS) \
356 $(VBOX_XML_SCHEMADEFS_H) \
357 $(VBOX_AUTOGEN_EVENT_H) \
358 $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
359
360VBoxSVC_SOURCES = \
361 $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d \
362 src-all/AuthLibrary.cpp \
363 src-all/DisplayPNGUtil.cpp \
364 src-all/DisplayResampleImage.cpp \
365 src-all/DisplayUtils.cpp \
366 src-all/EventImpl.cpp \
367 src-all/Global.cpp \
368 src-all/HashedPw.cpp \
369 src-all/Logging.cpp \
370 src-all/PCIDeviceAttachmentImpl.cpp \
371 src-all/ProgressImpl.cpp \
372 src-all/QMTranslatorImpl.cpp \
373 src-all/SecretKeyStore.cpp \
374 src-all/SharedFolderImpl.cpp \
375 src-all/AutoCaller.cpp \
376 src-all/ThreadTask.cpp \
377 src-all/VirtualBoxBase.cpp \
378 src-all/VirtualBoxErrorInfoImpl.cpp \
379 $(if $(VBOX_WITH_EXTPACK),src-all/ExtPackManagerImpl.cpp src-all/ExtPackUtil.cpp,) \
380 src-server/CertificateImpl.cpp \
381 src-server/ApplianceImpl.cpp \
382 src-server/ApplianceImplExport.cpp \
383 src-server/ApplianceImplImport.cpp \
384 src-server/ApplianceImplIO.cpp \
385 src-server/AudioAdapterImpl.cpp \
386 src-server/BandwidthControlImpl.cpp \
387 src-server/BandwidthGroupImpl.cpp \
388 src-server/BIOSSettingsImpl.cpp \
389 src-server/ClientWatcher.cpp \
390 src-server/ClientToken.cpp \
391 src-server/DHCPServerImpl.cpp \
392 src-server/NetworkServiceRunner.cpp \
393 src-server/NATNetworkImpl.cpp \
394 src-server/GuestOSTypeImpl.cpp \
395 src-server/HostDnsService.cpp \
396 src-server/HostImpl.cpp \
397 src-server/HostNetworkInterfaceImpl.cpp \
398 src-server/HostPower.cpp \
399 src-server/HostVideoInputDeviceImpl.cpp \
400 src-server/MachineImpl.cpp \
401 src-server/MachineImplCloneVM.cpp \
402 src-server/Matching.cpp \
403 src-server/MediumAttachmentImpl.cpp \
404 src-server/MediumFormatImpl.cpp \
405 src-server/MediumImpl.cpp \
406 src-server/MediumLock.cpp \
407 src-server/NATEngineImpl.cpp \
408 src-server/NetworkAdapterImpl.cpp \
409 src-server/ParallelPortImpl.cpp \
410 src-server/ProgressProxyImpl.cpp \
411 src-server/SerialPortImpl.cpp \
412 src-server/SnapshotImpl.cpp \
413 src-server/StorageControllerImpl.cpp \
414 src-server/SystemPropertiesImpl.cpp \
415 src-server/TokenImpl.cpp \
416 src-server/USBControllerImpl.cpp \
417 src-server/USBDeviceFiltersImpl.cpp \
418 src-server/VFSExplorerImpl.cpp \
419 src-server/VirtualBoxImpl.cpp \
420 src-server/VRDEServerImpl.cpp \
421 src-server/generic/AutostartDb-generic.cpp \
422 xml/ovfreader.cpp \
423 xml/Settings.cpp \
424 $(VBOX_XML_SCHEMADEFS_CPP) \
425 $(VBOX_AUTOGEN_EVENT_CPP) \
426 $(if $(VBOX_WITH_XPCOM),src-server/xpcom/server.cpp,)
427
428ifn1of ($(KBUILD_TARGET), win darwin)
429 VBoxSVC_SOURCES += $(PATH_ROOT)/src/VBox/Devices/Network/slirp/resolv_conf_parser.c
430# $(PATH_ROOT)/src/VBox/Devices/Network/slirp/resolv_conf_parser.c_DEFS += LOG_GROUP=LOG_GROUP_MAIN
431endif
432
433VBoxSVC_SOURCES.darwin = \
434 src-server/darwin/iokit.cpp \
435 src-server/darwin/HostPowerDarwin.cpp \
436 src-server/darwin/HostDnsServiceDarwin.cpp
437
438VBoxSVC_SOURCES.win = \
439 src-server/win/svcmain.cpp \
440 src-server/win/svchlp.cpp \
441 src-server/win/HostPowerWin.cpp \
442 src-server/win/VBoxSVC.rc \
443 src-server/win/HostDnsServiceWin.cpp
444
445VBoxSVC_SOURCES.linux = \
446 src-server/linux/HostHardwareLinux.cpp \
447 src-server/linux/HostDnsServiceLinux.cpp \
448 $(if $(VBOX_WITH_DBUS),src-server/linux/HostPowerLinux.cpp) \
449 src-server/HostDnsServiceResolvConf.cpp
450
451VBoxSVC_SOURCES.solaris = \
452 src-server/linux/vbox-libhal.cpp \
453 src-server/solaris/DynLoadLibSolaris.cpp \
454 src-server/HostDnsServiceResolvConf.cpp
455
456VBoxSVC_SOURCES.os2 = \
457 src-server/HostDnsServiceResolvConf.cpp
458
459VBoxSVC_SOURCES.freebsd = \
460 src-server/freebsd/HostHardwareFreeBSD.cpp \
461 src-server/HostDnsServiceResolvConf.cpp
462
463
464ifdef VBOX_WITH_USB
465 ifdef VBOX_WITH_SYSFS_BY_DEFAULT
466 src-server/linux/USBProxyBackendLinux.cpp_DEFS += VBOX_WITH_SYSFS_BY_DEFAULT
467 endif
468 VBoxSVC_SOURCES += \
469 src-server/USBDeviceFilterImpl.cpp \
470 src-server/USBProxyService.cpp \
471 src-server/USBProxyBackend.cpp \
472 src-server/generic/USBProxyBackendUsbIp.cpp \
473 src-server/HostUSBDeviceImpl.cpp
474 VBoxSVC_SOURCES.darwin += src-server/darwin/USBProxyBackendDarwin.cpp
475 VBoxSVC_SOURCES.linux += src-server/linux/USBProxyBackendLinux.cpp
476 VBoxSVC_SOURCES.linux += src-server/linux/USBGetDevices.cpp
477 VBoxSVC_SOURCES.os2 += src-server/os2/USBProxyBackendOs2.cpp
478 VBoxSVC_SOURCES.solaris += src-server/solaris/USBProxyBackendSolaris.cpp
479 VBoxSVC_SOURCES.win += src-server/win/USBProxyBackendWindows.cpp
480 VBoxSVC_SOURCES.freebsd += src-server/freebsd/USBProxyBackendFreeBSD.cpp
481endif
482
483ifdef VBOX_WITH_NETFLT
484 VBoxSVC_LIBS.win += \
485 $(PATH_STAGE_LIB)/WinNetConfig$(VBOX_SUFF_LIB) \
486 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
487 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/newdev.lib \
488 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
489 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
490endif
491VBoxSVC_LDFLAGS.darwin = -framework IOKit -framework SystemConfiguration
492
493ifdef VBOX_WITH_CROGL
494 VBoxSVC_LIBS += $(PATH_STAGE_LIB)/VBoxOGLTest$(VBOX_SUFF_LIB)
495 VBoxSVC_LDFLAGS.darwin += -framework OpenGL
496endif
497
498ifeq ($(KBUILD_TYPE),debug)
499 VBoxSVC_LDFLAGS.linux += -rdynamic # for backtrace_symbols()
500endif
501
502ifdef VBOX_WITH_RESOURCE_USAGE_API
503 VBoxSVC_SOURCES += \
504 src-server/PerformanceImpl.cpp \
505 src-server/Performance.cpp
506 VBoxSVC_SOURCES.darwin += src-server/darwin/PerformanceDarwin.cpp
507 VBoxSVC_SOURCES.freebsd += src-server/freebsd/PerformanceFreeBSD.cpp
508 VBoxSVC_SOURCES.linux += src-server/linux/PerformanceLinux.cpp
509 VBoxSVC_SOURCES.os2 += src-server/os2/PerformanceOs2.cpp
510 VBoxSVC_SOURCES.solaris += src-server/solaris/PerformanceSolaris.cpp
511 VBoxSVC_SOURCES.win += src-server/win/PerformanceWin.cpp
512 VBoxSVC_LDFLAGS.darwin += -lproc
513 VBoxSVC_LDFLAGS.solaris += -lkstat -lnvpair
514 VBoxSVC_LDFLAGS.win += psapi.lib powrprof.lib
515endif
516
517ifdef VBOX_WITH_HOSTNETIF_API
518 VBoxSVC_SOURCES.win += src-server/win/NetIf-win.cpp
519 VBoxSVC_SOURCES.linux += src-server/linux/NetIf-linux.cpp
520 VBoxSVC_SOURCES.os2 += src-server/os2/NetIf-os2.cpp
521 VBoxSVC_SOURCES.darwin += src-server/darwin/NetIf-darwin.cpp
522 VBoxSVC_SOURCES.solaris += src-server/solaris/NetIf-solaris.cpp
523 VBoxSVC_SOURCES.freebsd += src-server/freebsd/NetIf-freebsd.cpp
524 VBoxSVC_DEFS += VBOX_WITH_HOSTNETIF_API
525 if1of ($(KBUILD_TARGET), linux darwin solaris freebsd)
526 VBoxSVC_SOURCES += src-server/generic/NetIf-generic.cpp
527 endif
528endif
529
530ifdef VBOX_WITH_MAIN_USB_ID_DATABASE # Generate a database of USB vendor IDs and device IDs.
531 VBoxSVC_DEFS += VBOX_WITH_MAIN_USB_ID_DATABASE
532 VBoxSVC_SOURCES += $(VBoxSVC_0_OUTDIR)/USBIdDatabase.cpp
533 VBoxSVC_CLEAN += $(VBoxSVC_0_OUTDIR)/USBIdDatabase.cpp
534
535 $$(VBoxSVC_0_OUTDIR)/USBIdDatabase.cpp: $$(USBIdDatabaseGenerator_1_TARGET) \
536 $(PATH_SUB_CURRENT)/src-server/usb.ids $(PATH_SUB_CURRENT)/src-server/custom.ids | $$(dir $$@)
537 $(call MSG_GENERATE,USBIdDatabase,$@,$<)
538 $(QUIET)$(USBIdDatabaseGenerator_1_TARGET) -o "$@" $(filter %.ids,$^)
539
540 BLDPROGS += USBIdDatabaseGenerator
541 USBIdDatabaseGenerator_TEMPLATE = VBoxAdvBldProg
542 USBIdDatabaseGenerator_SOURCES = src-server/USBIdDatabaseGenerator.cpp
543else
544 VBoxSVC_SOURCES += src-server/USBIdDatabaseStub.cpp
545endif
546
547src-server/win/VBoxSVC.rc_INCS = $(VBoxSVC_0_OUTDIR)
548src-server/win/VBoxSVC.rc_DEPS = $(VBoxSVC_0_OUTDIR)/VBoxSVC-icon.rc
549src-server/win/VBoxSVC.rc_CLEAN = $(VBoxSVC_0_OUTDIR)/VBoxSVC-icon.rc
550$$(VBoxSVC_0_OUTDIR)/VBoxSVC-icon.rc: $(MAKEFILE_CURRENT) $(VBOX_WINDOWS_ICON_FILE) | $$(dir $$(@D))
551 $(APPEND) -t $@ '1 ICON DISCARDABLE "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
552
553ifndef VBOX_WITH_MIDL_PROXY_STUB
554src-server/win/VBoxSVC.rc_DEPS += $(VBoxSVC_0_OUTDIR)/VBoxSVC.rgs
555src-server/win/VBoxSVC.rc_CLEAN += $(VBoxSVC_0_OUTDIR)/VBoxSVC.rgs
556$$(VBoxSVC_0_OUTDIR)/VBoxSVC.rgs: $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(dir $$(@D))
557 $(VBOX_XSLTPROC) --stringparam Module VBoxSVC -o $@ $< $(VBOX_XIDL_FILE)
558endif
559
560## @todo r=klaus unfortunately we don't have xmllint everywhere, would be
561# good to check the validity for every VirtualBox.xidl change.
562#$(VBOX_XIDL_FILE).validated.ts: $(VBOX_XIDL_FILE_SRC)
563# xmllint --dtdvalid $(VBOX_PATH_MAIN_SRC)/idl/VirtualBox.dtd --noout $<
564# $(QUIET)$(CP) --changed -fv $< $(VBOX_XIDL_FILE).validated.ts
565#
566#OTHERS += $(VBOX_XIDL_FILE).validated.ts
567#OTHER_CLEAN += $(VBOX_XIDL_FILE).validated.ts
568
569testvalidxidl: $(VBOX_XIDL_FILE_SRC)
570 xmllint --dtdvalid $(VBOX_PATH_MAIN_SRC)/idl/VirtualBox.dtd --noout $<
571
572
573#
574# Embed some constraints from XML Schema file into VBoxSVC
575#
576VBOX_XML_SCHEMA = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings.xsd
577
578$(VBOX_XML_SCHEMADEFS_H): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA) | $$(dir $$@)
579 $(call MSG_GENERATE,SchemaDefs,$@,$<)
580 $(QUIET)$(VBOX_XSLTPROC) --stringparam mode declare -o $@ $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA)
581
582$(VBOX_XML_SCHEMADEFS_CPP): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA) | $$(dir $$@)
583 $(call MSG_GENERATE,SchemaDefs,$@,$<)
584 $(QUIET)$(VBOX_XSLTPROC) --stringparam mode define -o $@ $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA)
585
586testvalidsettings: $(VBOX_XML_SCHEMA)
587 xmllint --schema $< --noout $(HOME)/.VirtualBox/VirtualBox.xml
588 xmllint --schema $< --noout $(HOME)/.VirtualBox/Machines/*/*.xml
589 xmllint --schema $< --noout $(HOME)/.VirtualBox/Machines/*/*.vbox
590 xmllint --schema $< --noout $(HOME)/VirtualBox\ VMs/*/*.vbox
591
592OTHER_CLEAN += $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP)
593
594
595#
596# Generate some event stuff for VBoxSVC and VBoxC.
597#
598$(VBOX_AUTOGEN_EVENT_H): $(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
599 $(call MSG_TOOL,xsltproc,autogen events,$<,$@)
600 $(QUIET)$(VBOX_XSLTPROC) --stringparam G_kind VBoxEventHeader -o $@ $< $(VBOX_XIDL_FILE)
601
602$(VBOX_AUTOGEN_EVENT_CPP): $(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
603 $(call MSG_TOOL,xsltproc,autogen events,$<,$@)
604 $(QUIET)$(VBOX_XSLTPROC) --stringparam G_kind VBoxEvent -o $@ $< $(VBOX_XIDL_FILE)
605
606OTHER_CLEAN += $(VBOX_AUTOGEN_EVENT_H) $(VBOX_AUTOGEN_EVENT_CPP)
607
608ifdef VBOX_WITH_XPCOM
609#
610# VBoxSVCM - VBoxSVC wrapper module
611#
612DLLS += VBoxSVCM
613VBoxSVCM_TEMPLATE = VBOXMAINCOMP
614VBoxSVCM_DEFS = IN_RING3 $(VBOX_MAIN_DEFS)
615ifdef VBOX_WITH_HARDENING
616 VBoxSVCM_DEFS += VBOX_WITH_HARDENING
617endif
618VBoxSVCM_INCS = \
619 include \
620 $(VBoxC_0_OUTDIR) \
621 .
622VBoxSVCM_INTERMEDIATES = $(VBOX_MAIN_PREREQS)
623VBoxSVCM_SOURCES = \
624 src-server/xpcom/server_module.cpp
625VBoxSVCM_LDFLAGS.darwin = \
626 -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxSVCM.dylib \
627 -exported_symbols_list $(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def
628 ifeq ($(KBUILD_TARGET),darwin)
629VBoxSVCM_ORDERDEPS += $(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def
630VBoxSVCM_CLEAN += $(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def
631$$(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def:
632 $(RM) -f $@
633 $(APPEND) $@ _NSGetModule
634 endif
635VBoxSVCM_INTERMEDIATES += $(VBOX_IDL_HEADER.XPCOM)
636
637 # 32-bit version of the module.
638 ifdef VBOX_WITH_32_ON_64_MAIN_API
639DLLS += VBoxSVCM-x86
640VBoxSVCM-x86_TEMPLATE = VBoxMainComp-x86
641VBoxSVCM-x86_EXTENDS = VBoxSVCM
642 endif
643
644endif # VBOX_WITH_XPCOM
645
646
647#
648# VBoxC module
649#
650DLLS += VBoxC
651VBoxC_TEMPLATE = VBOXMAINCOMP
652if defined(VBOX_WITH_PRECOMPILED_HEADERS) && "$(KBUILD_TARGET)" == "win"
653 VBoxC_USES = vccprecomp
654 VBoxC_PCH_HDR := $(PATH_SUB_CURRENT)/src-client/win/precomp_vcc.h
655endif
656VBoxC_DEFS = \
657 IN_RING3 \
658 $(VBOX_MAIN_DEFS) \
659 VBOX_COM_INPROC \
660 $(if $(VBOX_WITH_HGCM),VBOX_WITH_HGCM,) \
661 $(if $(VBOX_WITH_AUDIO_OSS),VBOX_WITH_AUDIO_OSS,) \
662 $(if $(VBOX_WITH_AUDIO_ALSA),VBOX_WITH_AUDIO_ALSA,) \
663 $(if $(VBOX_WITH_AUDIO_PULSE),VBOX_WITH_AUDIO_PULSE,) \
664 $(if $(VBOX_WITH_AUDIO_DEBUG),VBOX_WITH_AUDIO_DEBUG,) \
665 $(if $(VBOX_WITH_AUDIO_VALIDATIONKIT),VBOX_WITH_AUDIO_VALIDATIONKIT,) \
666 $(if $(VBOX_WITH_VRDE_AUDIO),VBOX_WITH_VRDE_AUDIO,) \
667 $(if $(VBOX_WITH_E1000),VBOX_WITH_E1000,) \
668 $(if $(VBOX_WITH_VIRTIO),VBOX_WITH_VIRTIO,) \
669 $(if $(VBOX_WITH_EFI),VBOX_WITH_EFI,) \
670 $(if $(VBOX_WITH_PDM_ASYNC_COMPLETION),VBOX_WITH_PDM_ASYNC_COMPLETION,) \
671 $(if $(VBOX_WITH_LIVE_MIGRATION),VBOX_WITH_LIVE_MIGRATION,) \
672 $(if $(VBOX_WITH_VUSB),VBOX_WITH_VUSB,) \
673 $(if $(VBOX_WITH_HGSMI),VBOX_WITH_HGSMI,) \
674 $(if $(VBOX_WITH_VIDEOHWACCEL),VBOX_WITH_VIDEOHWACCEL,) \
675 $(if $(VBOX_WITH_DRAG_AND_DROP),VBOX_WITH_DRAG_AND_DROP,) \
676 $(if $(VBOX_WITH_DRAG_AND_DROP_GH),VBOX_WITH_DRAG_AND_DROP_GH,) \
677 $(if $(VBOX_WITH_USB),VBOX_WITH_USB,) \
678 $(if-expr defined(VBOX_WITH_EHCI) && defined(VBOX_WITH_USB),VBOX_WITH_EHCI,) \
679 $(if $(VBOX_WITH_EXTPACK),VBOX_WITH_EXTPACK,) \
680 $(if $(VBOX_WITH_PCI_PASSTHROUGH),VBOX_WITH_PCI_PASSTHROUGH,) \
681 $(if $(VBOX_WITH_VRDEAUTH_IN_VBOXSVC),VBOX_WITH_VRDEAUTH_IN_VBOXSVC,) \
682 $(if $(VBOX_WITH_VPX),VBOX_WITH_VPX,)
683ifdef VBOX_WITH_CRHGSMI
684 VBoxC_DEFS += VBOX_WITH_CRHGSMI
685endif
686ifdef VBOX_WITH_NETSHAPER
687 VBoxC_DEFS += VBOX_WITH_NETSHAPER
688endif
689VBoxC_DEFS.darwin.x86 = VBOX_WITH_2X_4GB_ADDR_SPACE
690VBoxC_DEFS.win.x86 += _WIN32_WINNT=0x0500
691VBoxC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
692
693if $(KBUILD_TARGET) != "win" && $(VBOX_GCC_VERSION_CXX) >= 40900 # gcc 4.9.x (4.8.x is causing endless RT_ELEMENT trouble)
694# VBoxC_CXXFLAGS = -Wunused -Wconversion
695endif
696
697VBoxC_SDKS = VBOX_LIBPNG VBOX_ZLIB
698ifdef VBOX_WITH_VPX
699 VBoxC_SDKS += VBOX_VPX
700endif
701ifdef VBOX_WITH_OPENSSL_FIPS
702 VBoxC_SDKS += VBOX_OPENSSL2
703endif
704
705VBoxC_INCS = \
706 include \
707 $(VBoxC_0_OUTDIR) \
708 $(VBOX_MAIN_APIWRAPPER_INCS) \
709 $(dir $(VBOX_XML_SCHEMADEFS_H)) \
710 $(VBOX_MAIN_APIWRAPPER_DIR)/dtrace
711VBoxC_INCS.win = \
712 $(VBoxCOM_0_OUTDIR) \
713 .
714
715VBoxC_LDFLAGS.darwin = \
716 -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxC.dylib \
717 -exported_symbols_list $(VBoxC_0_OUTDIR)/VBoxC.def \
718 -framework IOKit
719VBoxC_LDFLAGS.win += /MANIFEST \
720 /DELAYLOAD:user32.dll
721
722
723VBoxC_LIBS += \
724 $(PATH_STAGE_LIB)/VBoxAPIWrap$(VBOX_SUFF_LIB) \
725 $(if-expr "$(LIB_VMM)" == "$(VBOX_LIB_VMM_LAZY)",$(LIB_REM),) \
726 $(VBOX_LIB_VMM_LAZY)
727VBoxC_LIBS.win += \
728 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/psapi.lib \
729 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib
730ifdef VBOX_WITH_NETFLT
731 VBoxC_LIBS.win += \
732 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
733 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/newdev.lib \
734 $(PATH_STAGE_LIB)/WinNetConfig$(VBOX_SUFF_LIB) \
735 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
736 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
737 VBoxC_LDFLAGS.win += \
738 /DELAYLOAD:newdev.dll \
739 /DELAYLOAD:setupapi.dll \
740 /DELAYLOAD:iphlpapi.dll
741endif
742
743ifdef VBOX_WITH_CROGL
744 VBoxC_LIBS += $(PATH_STAGE_LIB)/VBoxOGLTest$(VBOX_SUFF_LIB)
745 VBoxC_LDFLAGS.darwin += -framework OpenGL
746endif
747
748ifdef VBOX_WITH_DRAG_AND_DROP
749 VBoxC_LIBS += $(PATH_STAGE_LIB)/VBoxDnDHostR3Lib$(VBOX_SUFF_LIB)
750endif
751
752VBoxC_INTERMEDIATES = \
753 $(VBOX_MAIN_PREREQS) \
754 $(VBOX_XML_SCHEMADEFS_H) \
755 $(VBOX_AUTOGEN_EVENT_H) \
756 $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
757
758VBoxC_SOURCES = \
759 $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d \
760 src-all/DisplayPNGUtil.cpp \
761 src-all/DisplayResampleImage.cpp \
762 src-all/DisplayUtils.cpp \
763 src-all/EventImpl.cpp \
764 src-all/Global.cpp \
765 src-all/HashedPw.cpp \
766 src-all/Logging.cpp \
767 src-all/PCIDeviceAttachmentImpl.cpp \
768 src-all/ProgressImpl.cpp \
769 src-all/SecretKeyStore.cpp \
770 src-all/SharedFolderImpl.cpp \
771 src-all/AutoCaller.cpp \
772 src-all/ThreadTask.cpp \
773 src-all/VirtualBoxBase.cpp \
774 src-all/VirtualBoxErrorInfoImpl.cpp \
775 $(if $(VBOX_WITH_EXTPACK),src-all/ExtPackManagerImpl.cpp src-all/ExtPackUtil.cpp,) \
776 src-client/UsbWebcamInterface.cpp \
777 $(if $(VBOX_WITH_USB_CARDREADER),src-client/UsbCardReader.cpp,) \
778 src-client/Nvram.cpp \
779 src-client/AdditionsFacilityImpl.cpp \
780 src-client/BusAssignmentManager.cpp \
781 $(if $(VBOX_WITH_PCI_PASSTHROUGH),src-client/PCIRawDevImpl.cpp,) \
782 src-client/ClientTokenHolder.cpp \
783 src-client/ConsoleImpl.cpp \
784 src-client/ConsoleImpl2.cpp \
785 src-client/ConsoleImplTeleporter.cpp \
786 src-client/ConsoleVRDPServer.cpp \
787 src-client/DisplayImpl.cpp \
788 src-client/DisplayImplLegacy.cpp \
789 src-client/DisplaySourceBitmapImpl.cpp \
790 src-client/EmulatedUSBImpl.cpp \
791 src-client/GuestImpl.cpp \
792 src-client/GuestCtrlImpl.cpp \
793 src-client/KeyboardImpl.cpp \
794 src-client/MachineDebuggerImpl.cpp \
795 src-client/MouseImpl.cpp \
796 src-client/RemoteUSBDeviceImpl.cpp \
797 src-client/SessionImpl.cpp \
798 src-client/USBDeviceImpl.cpp \
799 src-client/VBoxDriversRegister.cpp \
800 src-client/VirtualBoxClientImpl.cpp \
801 src-client/VMMDevInterface.cpp \
802 $(VBOX_AUTOGEN_EVENT_CPP) \
803 $(VBOX_XML_SCHEMADEFS_CPP)
804
805# Audio bits.
806VBoxC_SOURCES += \
807 ../Devices/Audio/AudioMixBuffer.cpp \
808 ../Devices/Audio/DrvAudioCommon.cpp \
809 $(if $(VBOX_WITH_VRDE_AUDIO),src-client/DrvAudioVRDE$(VBOX_AUDIO_FILE_SUFFIX).cpp,)
810
811VBoxC_SOURCES.win = \
812 src-client/win/dllmain.cpp \
813 src-client/win/VBoxC.def \
814 src-client/win/VBoxC.rc
815ifdef VBOX_WITH_GUEST_CONTROL
816 VBoxC_SOURCES += \
817 src-client/GuestSessionImplTasks.cpp \
818 src-client/GuestCtrlPrivate.cpp \
819 src-client/GuestDirectoryImpl.cpp \
820 src-client/GuestFileImpl.cpp \
821 src-client/GuestFsObjInfoImpl.cpp \
822 src-client/GuestProcessImpl.cpp \
823 src-client/GuestSessionImpl.cpp
824endif
825ifdef VBOX_WITH_DRAG_AND_DROP
826 VBoxC_SOURCES += \
827 src-client/GuestDnDPrivate.cpp \
828 src-client/GuestDnDSourceImpl.cpp \
829 src-client/GuestDnDTargetImpl.cpp
830endif
831ifdef VBOX_WITH_XPCOM
832 VBoxC_SOURCES += \
833 src-client/xpcom/module.cpp
834endif
835ifdef VBOX_WITH_HGCM
836 VBoxC_SOURCES += \
837 src-client/HGCMObjects.cpp \
838 src-client/HGCMThread.cpp \
839 src-client/HGCM.cpp
840endif
841ifdef VBOX_WITH_USB
842 VBoxC_SOURCES += \
843 src-client/RemoteUSBBackend.cpp
844endif
845ifdef VBOX_WITH_VPX
846 VBoxC_SOURCES += \
847 src-client/EbmlWriter.cpp \
848 src-client/VideoRec.cpp
849endif
850ifndef VBOX_WITH_VRDEAUTH_IN_VBOXSVC
851 VBoxC_SOURCES += \
852 src-all/AuthLibrary.cpp
853endif
854
855ifeq ($(KBUILD_TARGET),darwin)
856VBoxC_ORDERDEPS += $(VBoxC_0_OUTDIR)/VBoxC.def
857VBoxC_CLEAN += $(VBoxC_0_OUTDIR)/VBoxC.def
858$$(VBoxC_0_OUTDIR)/VBoxC.def: $(MAKEFILE_CURRENT)
859 $(RM) -f $@
860 $(APPEND) $@ _NSGetModule
861 $(APPEND) $@ _VBoxDriversRegister
862endif
863
864src-client/ConsoleImpl.cpp_DEFS = \
865 $(if $(VBOX_WITH_OPENSSL_FIPS), VBOX_OPENSSL_FIPS,)
866
867
868src-client/win/VBoxC.rc_DEPS = $(VBoxC_0_OUTDIR)/VBoxC.rgs $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb
869VBoxC_CLEAN.win += $(VBoxC_0_OUTDIR)/VBoxC.rgs
870
871$$(VBoxC_0_OUTDIR)/VBoxC.rgs: $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
872 $(VBOX_XSLTPROC) --stringparam Module VBoxC -o $@ $< $(VBOX_XIDL_FILE)
873
874ifdef VBOX_WITH_32_ON_64_MAIN_API
875 #
876 # 32-bit VBox API Client In-Process module.
877 #
878 # This is currently just a 32-bit version of VBoxC. It might be desirable to
879 # split up VBoxC into a simple client and a VM client part later, in which
880 # case this module will be a simple client.
881 #
882 # Note! One important thing is that the typelib for this DLL must be build
883 # with the /env win32 switch and the VBoxC typelib with /env amd64, if
884 # not they will overwrite each others typelib module entry.
885 #
886 DLLS += VBoxClient-x86
887 VBoxClient-x86_TEMPLATE = VBoxMainComp-x86
888 VBoxClient-x86_EXTENDS = VBoxC
889if defined(VBOX_WITH_PRECOMPILED_HEADERS) && "$(KBUILD_TARGET)" == "win" ## @todo fix inheritance
890 VBoxClient-x86_USES = vccprecomp
891 VBoxClient-x86_PCH_HDR := $(PATH_SUB_CURRENT)/src-client/win/precomp_vcc.h
892endif
893 VBoxClient-x86_DEFS = VBOX_COM_INPROC_API_CLIENT $(VBoxC_DEFS)
894 VBoxClient-x86_INCS.win = \
895 $(VBoxClient-x86_0_OUTDIR) \
896 $(VBoxCOM-x86_0_OUTDIR) \
897 $(VBoxC_INCS.win)
898 VBoxClient-x86_SOURCES = \
899 src-all/EventImpl.cpp \
900 src-all/Global.cpp \
901 src-all/AutoCaller.cpp \
902 src-all/ThreadTask.cpp \
903 src-all/VirtualBoxBase.cpp \
904 src-all/VirtualBoxErrorInfoImpl.cpp \
905 src-client/ClientTokenHolder.cpp \
906 src-client/SessionImpl.cpp \
907 src-client/VirtualBoxClientImpl.cpp \
908 $(VBOX_AUTOGEN_EVENT_CPP) \
909 $(VBOX_XML_SCHEMADEFS_CPP)
910 VBoxClient-x86_SOURCES.win = \
911 src-client/win/dllmain.cpp \
912 src-client/win/VBoxClient-x86.def \
913 src-client/win/VBoxClient-x86.rc
914 ifdef VBOX_WITH_XPCOM
915 VBoxClient-x86_SOURCES += \
916 src-client/xpcom/module.cpp
917 endif
918 VBoxClient-x86_LIBS = \
919 $(PATH_STAGE_LIB)/VBoxAPIWrap-x86$(VBOX_SUFF_LIB)
920 VBoxClient-x86_LIBS.win = $(NO_SUCH_VARIABLE)
921 VBoxClient-x86_LIBS.win.x86 = $(PATH_TOOL_$(VBOX_VCC_TOOL_STEM)X86_LIB)/delayimp.lib
922 VBoxClient-x86_CLEAN.win += $(VBoxClient-x86_0_OUTDIR)/VBoxClient-x86.rgs
923 src-client/win/VBoxClient-x86.rc_DEPS = \
924 $(VBoxClient-x86_0_OUTDIR)/VBoxClient-x86.rgs \
925 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox-x86.tlb
926
927 $$(VBoxClient-x86_0_OUTDIR)/VBoxClient-x86.rgs: \
928 $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl \
929 $(VBOX_XIDL_FILE) | $$(dir $$@)
930 $(VBOX_XSLTPROC) --stringparam Module VBoxC -o $@ $< $(VBOX_XIDL_FILE)
931
932endif
933
934
935#
936# VBoxCOM - COM Abstraction Layer library
937#
938LIBRARIES += VBoxCOM
939VBoxCOM_TEMPLATE = VBoxMainLib
940VBoxCOM_INTERMEDIATES = $(VBOX_MAIN_PREREQS) \
941 $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
942VBoxCOM_SOURCES = \
943 glue/com.cpp \
944 glue/initterm.cpp \
945 glue/string.cpp \
946 glue/AutoLock.cpp \
947 glue/EventQueue.cpp \
948 glue/NativeEventQueue.cpp \
949 glue/ErrorInfo.cpp \
950 glue/errorprint.cpp
951VBoxCOM_INCS += $(VBOX_MAIN_APIWRAPPER_INCS) \
952 include
953ifeq ($(KBUILD_TARGET),win)
954 ifdef VBOX_WITH_MIDL_PROXY_STUB
955 VBoxCOM_DEFS.win = VBOX_WITH_AUTO_COM_REG_UPDATE
956 endif
957 VBoxCOM_DEFS.x86 = _WIN32_WINNT=0x0500
958 VBoxCOM_DEFS.amd64 = _WIN32_WINNT=0x0510
959 VBoxCOM_SOURCES += \
960 $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c
961 VBoxCOM_CLEAN = \
962 $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
963 $(VBoxCOM_0_OUTDIR)/VirtualBox_p.c \
964 $(VBoxCOM_0_OUTDIR)/dlldata.c \
965 $(VBoxCOM_0_OUTDIR)/VirtualBox.h \
966 $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb
967 VBoxCOM_CLEAN += \
968 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_i.c \
969 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_p.c \
970 $(VBoxCOM_0_OUTDIR)/legacy/dlldata.c \
971 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.h \
972 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.tlb
973 VBoxCOM_BLDDIRS = $(VBoxCOM_0_OUTDIR)/legacy/
974else # !win
975 VBoxCOM_SOURCES += \
976 $(VBoxCOM_0_OUTDIR)/VirtualBox_XPCOM_i.c \
977 glue/xpcom/helpers.cpp
978endif # !win
979
980glue/com.cpp_DEFS = \
981 KBUILD_TYPE=\"$(KBUILD_TYPE)\"
982
983# 32-bit version of VBoxCOM.
984ifdef VBOX_WITH_32_ON_64_MAIN_API
985 LIBRARIES += VBoxCOM-x86
986 VBoxCOM-x86_TEMPLATE = VBoxMainLib-x86
987 VBoxCOM-x86_EXTENDS = VBoxCOM
988 ifeq ($(KBUILD_TARGET),win)
989 VBoxCOM-x86_CLEAN = \
990 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c \
991 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_p.c \
992 $(VBoxCOM-x86_0_OUTDIR)/dlldata.c \
993 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox.h \
994 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox.tlb
995 endif
996endif
997
998# -MD version for the GUI in -MDd builds.
999ifeq ($(KBUILD_TARGET).$(VBOX_VCC_CRT_TYPE),win.d)
1000 LIBRARIES += VBoxCOM-GUI
1001 ifndef VBOX_WITH_QTGUI_V5
1002 USES += qt4
1003 else # VBOX_WITH_QTGUI_V5
1004 USES += qt5
1005 endif # VBOX_WITH_QTGUI_V5
1006 VBoxCOM-GUI_TEMPLATE = VBOXQTGUI$(if-expr defined(VBOX_WITH_HARDENING),,EXE)
1007 VBoxCOM-GUI_EXTENDS = VBoxCOM
1008endif
1009
1010
1011
1012#
1013# The VBoxExtPackHelperApp.
1014#
1015ifdef VBOX_WITH_EXTPACK
1016 PROGRAMS += VBoxExtPackHelperApp
1017 VBoxExtPackHelperApp_TEMPLATE = VBoxR3SetUidToRoot
1018 VBoxExtPackHelperApp_LDFLAGS.darwin = -framework Security
1019 VBoxExtPackHelperApp_LDFLAGS.win = /SUBSYSTEM:windows
1020 VBoxExtPackHelperApp_SOURCES = \
1021 src-helper-apps/VBoxExtPackHelperApp.cpp \
1022 src-all/ExtPackUtil.cpp
1023 VBoxExtPackHelperApp_SOURCES.win = \
1024 src-helper-apps/VBoxExtPackHelperApp.rc
1025 VBoxExtPackHelperApp_LIBS = \
1026 $(LIB_RUNTIME)
1027endif # VBOX_WITH_EXTPACK
1028
1029#
1030# VolInfo
1031#
1032ifdef VBOX_WITH_DEVMAPPER
1033 PROGRAMS.linux += VBoxVolInfo
1034 VBoxVolInfo_TEMPLATE = VBoxR3SetUidToRoot
1035 VBoxVolInfo_SOURCES = src-helper-apps/VBoxVolInfo.cpp
1036 VBoxVolInfo_LIBS = devmapper
1037endif
1038
1039endif # !VBOX_ONLY_SDK (the ifndef is far above)
1040
1041
1042#
1043# Installs com related thing(s) to bin.
1044#
1045INSTALLS.win += VBoxMain-com-inst
1046VBoxMain-com-inst_INST = $(INST_BIN)
1047VBoxMain-com-inst_MODE = a+r,u+w
1048VBoxMain-com-inst_SOURCES = src-all/win/comregister.cmd
1049
1050
1051if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "linux"
1052 #
1053 # Installs linux/hardening related things to components.
1054 #
1055 INSTALLS.linux += VBoxMain-hardening-inst
1056 VBoxMain-hardening-inst_INST = $(INST_BIN)components/
1057 VBoxMain-hardening-inst_SYMLINKS = \
1058 VBoxDDU.so=>../VBoxDDU.so \
1059 VBoxREM.so=>../VBoxREM.so \
1060 VBoxRT.so=>../VBoxRT.so \
1061 VBoxVMM.so=>../VBoxVMM.so \
1062 VBoxXPCOM.so=>../VBoxXPCOM.so
1063endif
1064
1065
1066if defined(VBOX_WITH_MIDL_PROXY_STUB) && "$(KBUILD_TARGET)" == "win"
1067 #
1068 # Experimental COM proxy + stub DLL w/ automatic registration updating.
1069 #
1070 # The Legacy stub is for older 64-bit windows versions (pre Windows 7) as we
1071 # were having various problems on windows server 2003 and 2008 with the code
1072 # MIDL generated. Also, in windows 7 there are some potentially interesting
1073 # changes in the generated code where it uses new helpers from OLE32.
1074 #
1075 DLLS += VBoxProxyStub
1076 VBoxProxyStub_TEMPLATE = VBOXMAINCOMP
1077 VBoxProxyStub_DEFS = REGISTER_PROXY_DLL PROXY_CLSID_IS="$(VBOX_MIDL_PROXY_CLSID_IS)"
1078 VBoxProxyStub_DEFS.win.x86 = WIN32
1079 VBoxProxyStub_SDKS = VBOX_NTDLL
1080 VBoxProxyStub_DEFPATH = $(VBoxCOM_0_OUTDIR)/# Hack to workaround drive letter in $(VBoxCOM_0_OUTDIR)/ for CFLAGS hack below.
1081 VBoxProxyStub_INCS = $(VBoxCOM_0_OUTDIR)/
1082 VBoxProxyStub_SOURCES := \
1083 VirtualBox_p.c \
1084 VirtualBox_i.c \
1085 $(PATH_SUB_CURRENT)/src-all/win/VBoxProxyStub.def \
1086 $(PATH_SUB_CURRENT)/src-all/win/VBoxProxyStub.rc \
1087 $(PATH_SUB_CURRENT)/src-all/win/VBoxProxyStub.c
1088 src-all/win/VBoxProxyStub.rc_DEPS = $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb
1089 VBoxProxyStub_VirtualBox_p.c_CFLAGS.x86 = /Gz # Workaround for incorrect ObjectStublessClient* prototypes in SDK v7.1.
1090
1091 DLLS += VBoxProxyStubLegacy
1092 VBoxProxyStubLegacy_TEMPLATE = VBOXMAINCOMP
1093 VBoxProxyStubLegacy_EXTENDS = VBoxProxyStub
1094 VBoxProxyStubLegacy_DEFS = $(VBoxProxyStub_DEFS) VBOX_IN_PROXY_STUB_LEGACY
1095 VBoxProxyStubLegacy_INCS = $(VBoxCOM_0_OUTDIR)/legacy/
1096 VBoxProxyStubLegacy_SOURCES = \
1097 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_p.c \
1098 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_i.c \
1099 src-all/win/VBoxProxyStub.def \
1100 src-all/win/VBoxProxyStubLegacy.rc \
1101 src-all/win/VBoxProxyStub.c
1102 src-all/win/VBoxProxyStubLegacy.rc_DEPS = $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.tlb
1103
1104 ifdef VBOX_WITH_32_ON_64_MAIN_API
1105 DLLS += VBoxProxyStub-x86
1106 VBoxProxyStub-x86_TEMPLATE = VBoxMainComp-x86
1107 VBoxProxyStub-x86_SDKS = VBOX_NTDLL
1108 VBoxProxyStub-x86_DEFS = $(VBoxProxyStub_DEFS) VBOX_PROXY_STUB_32_ON_64 WIN32
1109 VBoxProxyStub-x86_INCS = $(VBoxCOM-x86_0_OUTDIR)/
1110 VBoxProxyStub-x86_SOURCES = \
1111 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_p.c \
1112 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c \
1113 src-all/win/VBoxProxyStub.c \
1114 src-all/win/VBoxProxyStub-x86.rc \
1115 src-all/win/VBoxProxyStub.def
1116 src-all/win/VBoxProxyStub-x86.rc_DEPS = $(VBoxCOM-x86_0_OUTDIR)/VirtualBox-x86.tlb
1117 endif
1118endif
1119
1120
1121
1122# generate rules
1123include $(FILE_KBUILD_SUB_FOOTER)
1124
1125
1126
1127#
1128# Additions rules.
1129#
1130
1131## @todo this hack ain't cutting it any longer. (the file name is abspath'ed since ages now.)
1132glue/xpcom/helpers.cpp: $(VBOX_IDL_TYPELIB.XPCOM)
1133
1134$(VBOX_IDL_FILE.XPCOM): $(VBOX_PATH_MAIN_SRC)/idl/xpidl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
1135 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
1136 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
1137
1138$(VBOX_IDL_TYPELIB.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
1139 $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
1140 $(QUIET)$(VBOX_XPIDL_ENV)$(VBOX_XPIDL) -m typelib -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
1141 $(CHMOD) 0644 $@
1142## @todo ^^^^^^^^^^^^ fix horrible hack
1143
1144$(VBOX_IDL_HEADER.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
1145 $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
1146 $(QUIET)$(VBOX_XPIDL_ENV)$(VBOX_XPIDL) -m header -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
1147
1148$(VBOX_IDL_FILE.MSCOM): $(VBOX_PATH_MAIN_SRC)/idl/midl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
1149 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
1150 $(QUIET)$(VBOX_XSLTPROC) -o $@ $(if $(VBOX_WITH_MIDL_PROXY_STUB),-stringparam g_fGenProxy yes,) $< $(VBOX_XIDL_FILE)
1151
1152# Aliases for testing purposes.
1153ifdef VBOX_WITH_XPCOM
1154testidl: $(VBOX_IDL_FILE.XPCOM) $(VBOX_IDL_TYPELIB.XPCOM) $(VBoxCOM_0_OUTDIR)/VirtualBox_XPCOM_i.c
1155testidlhdr: $(VBOX_IDL_HEADER.XPCOM)
1156else
1157testidl: $(VBOX_IDL_FILE.MSCOM) $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
1158 $(if $(VBOX_WITH_32_ON_64_MAIN_API),$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c,)
1159endif
1160
1161
1162$(VBoxCOM_0_OUTDIR)/VirtualBox_XPCOM_i.c: $(VBOX_PATH_MAIN_SRC)/idl/xpidl_iid.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
1163 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
1164 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
1165
1166##
1167# Edits $1 and adding #pragma directives for disabling warnings windows.h causes.
1168# @param 1 The name of the file to edit.
1169define def_VBoxMainDisableMscWarnings
1170 $(QUIET)$(MV) -f "$1" "$1.tmp"
1171 $(QUIET)$(APPEND) -nt "$1" \
1172 '#pragma warning(push) /* -Wall and windows.h */' \
1173 '#pragma warning(disable:4668 4255)' \
1174 ''
1175 $(QUIET)$(CAT_EXT) "$1.tmp" >> "$1"
1176 $(QUIET)$(APPEND) -n "$1" \
1177 '' \
1178 '#pragma warning(pop)' \
1179 ''
1180 $(QUIET)$(RM) -f "$1.tmp"
1181
1182endef
1183
1184# Note! Because we've got a different proxy stub DLL for pre windows 7 64-bit hosts, we target windows 7 for AMD64.
1185# The output is different and hopefully more efficient, at least memory wise (using more helpers in OLE32).
1186# Note! We're checking for win.amd64 below when setting the target because of the SDK build which happens on linux.amd64
1187# but with a 32-bit Wine.
1188$(if $(VBOX_WITH_MIDL_PROXY_STUB),$(VBoxCOM_0_OUTDIR)/VirtualBox_p.c + $(VBoxCOM_0_OUTDIR)/dlldata.c +,) \
1189$(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
1190+ $(VBoxCOM_0_OUTDIR)/VirtualBox.h \
1191+ $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb: $(VBOX_IDL_FILE.MSCOM) | $$(dir $$@)
1192 $(VBOX_WIN_MIDL) /nologo /W4 \
1193 /env $(if-expr "$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)" == "win.amd64" ,amd64,win32) \
1194 /robust /protocol all /target $(if-expr defined(VBOX_WITH_MIDL_PROXY_STUB),NT61,NT51) \
1195 /out $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxCOM_0_OUTDIR)) \
1196 /cpp_cmd $(subst $(EXEC_X86_WIN32),,$(call VBOX_FN_MAKE_WIN_PATH,$(TOOL_$(VBOX_VCC_TOOL)_CC))) \
1197 /I $(call VBOX_FN_MAKE_WIN_PATH,$(PATH_SDK_$(VBOX_WINPSDK)_INC)) \
1198 /I idl \
1199 $(call VBOX_FN_MAKE_WIN_PATH,$<)
1200 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/VirtualBox.h)
1201 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/VirtualBox_i.c)
1202 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/VirtualBox_p.c)
1203
1204if defined(VBOX_WITH_MIDL_PROXY_STUB)
1205# -Windows Server 2003 AMD64 SP1 does not like the result when using '/protocol all' and '/target NT51'.
1206# -Vista AMD64 SP1 and Windows Server 2008 AMD64 seems to have some objections as well, but it seemed
1207# that using an older MIDL compiler (v7.00.0499 instead of v7.00.0555) helps. But the W2K3 fix also works.
1208# To avoid 32-bit vs. 64-bit differences, we do the same for 32-bit windows versions.
1209$(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_i.c \
1210+ $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_p.c\
1211+ $(VBoxCOM_0_OUTDIR)/legacy/dlldata.c \
1212+ $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.h \
1213+ $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.tlb: $(VBOX_IDL_FILE.MSCOM) | $$(dir $$@)
1214 $(VBOX_WIN_MIDL) /nologo /W4 \
1215 $(if-expr "$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)" == "win.amd64" \
1216 ,/env amd64 /x64 /target NT50 /robust \
1217 ,/env win32 /target NT51 /robust /protocol all ) \
1218 /out $(call VBOX_FN_MAKE_WIN_PATH,$(dir $@)) \
1219 /cpp_cmd $(subst $(EXEC_X86_WIN32),,$(call VBOX_FN_MAKE_WIN_PATH,$(TOOL_$(VBOX_VCC_TOOL)_CC))) \
1220 /I $(call VBOX_FN_MAKE_WIN_PATH,$(PATH_SDK_$(VBOX_WINPSDK)_INC)) \
1221 /I idl \
1222 $(call VBOX_FN_MAKE_WIN_PATH,$<)
1223 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.h)
1224 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_i.c)
1225 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_p.c)
1226endif
1227
1228# The XP targetted 32-bit proxy stub works with all versions of windows (the
1229# issues leading to the VBoxProxyStubLegacy.dll are only on 64-bit windows).
1230$(if $(VBOX_WITH_MIDL_PROXY_STUB),$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_p.c + $(VBoxCOM-x86_0_OUTDIR)/dlldata.c +,) \
1231$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c \
1232+ $(VBoxCOM-x86_0_OUTDIR)/VirtualBox.h \
1233+ $(VBoxCOM-x86_0_OUTDIR)/VirtualBox-x86.tlb: $(VBOX_IDL_FILE.MSCOM) | $$(dir $$@)
1234 $(VBOX_WIN_MIDL) /nologo /W4 \
1235 /env win32 /target NT51 /robust /protocol all \
1236 /out $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxCOM-x86_0_OUTDIR)) \
1237 /tlb $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox-x86.tlb) \
1238 /cpp_cmd $(subst $(EXEC_X86_WIN32),,$(call VBOX_FN_MAKE_WIN_PATH,$(TOOL_$(VBOX_VCC_TOOL_STEM)X86_CC))) \
1239 /I $(call VBOX_FN_MAKE_WIN_PATH,$(PATH_SDK_$(VBOX_WINPSDK)_INC)) \
1240 /I idl \
1241 $(call VBOX_FN_MAKE_WIN_PATH,$<)
1242 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox.h)
1243 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c)
1244 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_p.c)
1245
1246#
1247# Translation stuff
1248#
1249VBoxSVC_VBOX_HEADERS = \
1250 include/collection.h \
1251 include/MachineImpl.h
1252VBoxSVC_VBOX_TRANSLATIONS = \
1253 nls/VBoxSVC_de.ts
1254
1255VBoxC_VBOX_HEADERS = \
1256 include/ConsoleImpl.h
1257
1258VBoxC_VBOX_INTERMEDIATES = $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
1259VBoxC_VBOX_HEADERS += $(VBOX_MAIN_APIWRAPPER_INCS)
1260
1261VBoxC_VBOX_TRANSLATIONS = \
1262 nls/VBoxC_de.ts
1263
1264ifdef VBOX_WITH_JMSCOM
1265
1266#
1267# Java glue JAR files
1268#
1269VBOX_JMSCOM_JAR = $(VBoxJMscom-inst-jar_0_OUTDIR)/vboxjmscom.jar
1270VBOX_JMSCOM_TARGET := $(PATH_TARGET)/vboxjmscom-gen
1271VBOX_JMSCOM_GEN = $(VBOX_JMSCOM_TARGET)/jmscomgen
1272VBOX_JMSCOM_JDEST := $(VBOX_JMSCOM_TARGET)/jdest
1273VBOX_GLUE_XSLT_DIR := $(PATH_ROOT)/src/VBox/Main/glue
1274VBOX_JACOB_DIR := $(PATH_ROOT)/src/libs/jacob-1.17
1275
1276INSTALLS += VBoxJMscom-inst-jar
1277VBoxJMscom-inst-jar_INST = $(INST_SDK)bindings/mscom/java/
1278VBoxJMscom-inst-jar_MODE = a+r,u+w
1279VBoxJMscom-inst-jar_SOURCES = \
1280 $(VBOX_JMSCOM_JAR)
1281VBoxJMscom-inst-jar_CLEAN = \
1282 $(VBOX_JMSCOM_JAR) \
1283 $(VBOX_JMSCOM_GEN)/jmscomglue.list \
1284 $(wildcard \
1285 $(VBOX_JMSCOM_GEN)/java/*.java \
1286 $(VBOX_JMSCOM_JDEST)/*.class \
1287 $(VBOX_JMSCOM_JDEST)/*/*.class \
1288 $(VBOX_JMSCOM_JDEST)/*/*/*.class \
1289 $(VBOX_JMSCOM_JDEST)/*/*/*/*.class \
1290 )
1291VBoxJMscom-inst-jar_BLDDIRS += $(VBOX_JMSCOM_GEN)/java
1292
1293$(VBOX_JMSCOM_GEN)/jmscomglue.list: \
1294 $(VBOX_XIDL_FILE) \
1295 $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl \
1296 $(VBOX_FILESPLIT) \
1297 | $(VBOX_JMSCOM_GEN)/java/
1298 $(call MSG_L1,Generating Java MSCOM glue files from XIDL)
1299 $(QUIET)$(RM) -f $(wildcard $(VBOX_JMSCOM_GEN)/java/*.java)
1300 $(QUIET)$(VBOX_XSLTPROC) \
1301 --stringparam filelistonly "" \
1302 --stringparam G_vboxApiSuffix $(VBOX_API_SUFFIX) \
1303 --stringparam G_vboxGlueStyle mscom \
1304 --stringparam G_vboxDirPrefix "" \
1305 -o $(VBOX_JMSCOM_GEN)/java/merged.file $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl $<
1306 $(QUIET)$(VBOX_FILESPLIT) $(VBOX_JMSCOM_GEN)/java/merged.file $(VBOX_JMSCOM_GEN)/java
1307 $(QUIET)echo $(VBOX_JMSCOM_GEN)/java/*.java > $@
1308
1309$$(VBOX_JMSCOM_JAR): $(VBOX_JMSCOM_GEN)/jmscomglue.list | $$(dir $$@)
1310 $(call MSG_TOOL,javac,$(notdir $@),jmscomglue.list,)
1311 $(QUIET)$(RM) -Rf $(VBOX_JMSCOM_JDEST)
1312 $(QUIET)$(MKDIR) -p $(VBOX_JMSCOM_JDEST)
1313 $(call MSG_TOOL,javac,$(notdir $@),...,)
1314 $(QUIET)$(VBOX_JAVAC) $(VBOX_JAVAC_OPTS) @$(VBOX_JMSCOM_GEN)/jmscomglue.list \
1315 -d $(VBOX_JMSCOM_JDEST) -classpath "$(VBOX_JMSCOM_JDEST)$(VBOX_SEP)$(VBOX_JACOB_DIR)/jacob.jar"
1316 $(call MSG_LINK,$(notdir $@),$@)
1317 $(QUIET)$(VBOX_JAR) cf $@ -C $(VBOX_JMSCOM_JDEST) .
1318
1319## @todo compile TestVBox.java (see below) to have sanity checking
1320
1321endif # VBOX_WITH_JMSCOM
1322
1323#
1324# Install Java glue sample code.
1325#
1326INSTALLS += javagluesample
1327javagluesample_INST = $(INST_SDK)bindings/glue/java/
1328javagluesample_MODE = a+r,u+w
1329javagluesample_SOURCES = \
1330 $(VBOX_PATH_MAIN_SRC)/glue/tests/TestVBox.java=>TestVBox.java \
1331 $(VBOX_PATH_MAIN_SRC)/glue/tests/Makefile=>Makefile
1332
1333#
1334# Rules associated with VBoxAPIWrap (in typical invocation order).
1335# We keep them down here to simplify the use of VBoxAPIWrap_0_OUTDIR.
1336#
1337
1338# Generate a make include file which lists the wrapper header and source files.
1339$(VBoxAPIWrap_VBOX_KMK_FILE).ts \
1340+| $(VBoxAPIWrap_VBOX_KMK_FILE): \
1341 $(VBOX_XIDL_FILE) \
1342 $(VBOX_PATH_MAIN_SRC)/idl/apiwrap-server-filelist.xsl \
1343 $(VBOX_PATH_MAIN_SRC)/Makefile.kmk
1344 $(call MSG_GENERATE,,$(VBoxAPIWrap_VBOX_KMK_FILE))
1345 $(QUIET)$(RM) -f $@
1346 $(QUIET)$(MKDIR) -p $(@D)
1347 $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
1348 -o $@ $(VBOX_PATH_MAIN_SRC)/idl/apiwrap-server-filelist.xsl $<
1349 $(QUIET)$(CP) --changed -fv $@ $(VBoxAPIWrap_VBOX_KMK_FILE)
1350
1351# Generate the header files for the wrappers.
1352$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-headers \
1353+| $(VBOX_MAIN_APIWRAPPER_GEN_HDRS): \
1354 $(VBOX_XIDL_FILE) \
1355 $(VBOX_PATH_MAIN_SRC)/idl/typemap-shared.inc.xsl \
1356 $(VBoxAPIWrap_VBOX_XSLT) \
1357 $(VBOX_FILESPLIT) \
1358 | $$(dir $$@)
1359 $(call MSG_L1,Generating C++ Server API wrapper header files from XIDL)
1360 $(QUIET)$(RM) -f -- $(filter-out $(VBOX_MAIN_APIWRAPPER_GEN_HDRS), $(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.h))
1361 $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
1362 --stringparam generating "headers" \
1363 -o $@ $(VBoxAPIWrap_VBOX_XSLT) $<
1364 $(QUIET)$(VBOX_FILESPLIT) $@ $(VBoxAPIWrap_0_OUTDIR)
1365
1366# Generate the DTrace probes for the wrappers and combine them with handcoded probes.
1367$(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d.ts \
1368+| $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d: \
1369 $(VBOX_XIDL_FILE) \
1370 $(VBOX_PATH_MAIN_SRC)/idl/typemap-shared.inc.xsl \
1371 $(VBoxAPIWrap_VBOX_XSLT) \
1372 $(VBOX_FILESPLIT) \
1373 | $$(dir $$@)
1374 $(call MSG_L1,Generating DTrace Provider for the VBox API (from XIDL))
1375 $(QUIET)$(RM) -f -- "$@" "[email protected]"
1376 $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
1377 --stringparam generating "dtrace-probes" \
1378 -o "$@" $(VBoxAPIWrap_VBOX_XSLT) $<
1379 $(QUIET)$(SED) -e '' -o "[email protected]" \
1380 "$(VBOX_PATH_MAIN_SRC)/src-all/VBoxAPI-start.d" \
1381 "$@" \
1382 "$(VBOX_PATH_MAIN_SRC)/src-all/VBoxAPI-end.d"
1383 $(QUIET)$(MV) -- "[email protected]" "$@"
1384 $(QUIET)$(CP) --changed -fv -- "$@" "$(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d"
1385
1386# Generate the wrapper source files - split in two due to long processing time
1387$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-even \
1388+| $(VBOX_MAIN_APIWRAPPER_GEN_SRCS_EVEN): \
1389 $(VBOX_XIDL_FILE) \
1390 $(VBOX_PATH_MAIN_SRC)/idl/typemap-shared.inc.xsl \
1391 $(VBoxAPIWrap_VBOX_XSLT) \
1392 $(VBOX_FILESPLIT) \
1393 | $$(dir $$@)
1394 $(call MSG_L1,Generating C++ Server API wrapper files from XIDL - part 1)
1395 $(QUIET)$(RM) -f -- $(filter-out $(VBOX_MAIN_APIWRAPPER_GEN_SRCS), $(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.cpp))
1396 $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
1397 --stringparam generating "sources" \
1398 --param reminder 0 \
1399 -o $@ $(VBoxAPIWrap_VBOX_XSLT) $<
1400 $(QUIET)$(VBOX_FILESPLIT) $@ $(VBoxAPIWrap_0_OUTDIR)
1401
1402$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-odd \
1403+| $(VBOX_MAIN_APIWRAPPER_GEN_SRCS_ODD): \
1404 $(VBOX_XIDL_FILE) \
1405 $(VBOX_PATH_MAIN_SRC)/idl/typemap-shared.inc.xsl \
1406 $(VBoxAPIWrap_VBOX_XSLT) \
1407 $(VBOX_FILESPLIT) \
1408 | $$(dir $$@)
1409 $(call MSG_L1,Generating C++ Server API wrapper files from XIDL - part 2)
1410 $(QUIET)$(RM) -f -- $(filter-out $(VBOX_MAIN_APIWRAPPER_GEN_SRCS), $(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.cpp))
1411 $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
1412 --stringparam generating "sources" \
1413 --param reminder 1 \
1414 -o $@ $(VBoxAPIWrap_VBOX_XSLT) $<
1415 $(QUIET)$(VBOX_FILESPLIT) $@ $(VBoxAPIWrap_0_OUTDIR)
1416
1417testapiwrappers:: \
1418 $(VBoxAPIWrap_0_OUTDIR)/apiwrappers-headers \
1419 $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d.ts \
1420 $(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-odd \
1421 $(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-even
1422
1423
1424#
1425# NLS stuff.
1426#
1427updatenls::
1428 $(VBOX_LUPDATE) $(VBoxSVC_SOURCES) $(VBoxSVC_VBOX_HEADERS) -ts $(VBoxSVC_VBOX_TRANSLATIONS)
1429 $(VBOX_LUPDATE) $(VBoxC_SOURCES) $(VBoxC_VBOX_HEADERS) -ts $(VBoxC_VBOX_TRANSLATIONS)
1430
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