VirtualBox

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

Last change on this file since 98715 was 98526, checked in by vboxsync, 22 months ago

Guest Control: Initial commit (work in progress, disabled by default). bugref:9783

IGuestDirectory:

Added new attributes id + status + an own event source. Also added for rewind support via rewind().

New event types for guest directory [un]registration, state changes and entry reads.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 70.7 KB
Line 
1# $Id: Makefile.kmk 98526 2023-02-10 15:10:50Z vboxsync $
2## @file
3# Makefile for the VBox Main module.
4#
5
6#
7# Copyright (C) 2004-2023 Oracle and/or its affiliates.
8#
9# This file is part of VirtualBox base platform packages, as
10# available from https://www.virtualbox.org.
11#
12# This program is free software; you can redistribute it and/or
13# modify it under the terms of the GNU General Public License
14# as published by the Free Software Foundation, in version 3 of the
15# License.
16#
17# This program is distributed in the hope that it will be useful, but
18# WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20# General Public License for more details.
21#
22# You should have received a copy of the GNU General Public License
23# along with this program; if not, see <https://www.gnu.org/licenses>.
24#
25# SPDX-License-Identifier: GPL-3.0-only
26#
27
28SUB_DEPTH = ../../..
29include $(KBUILD_PATH)/subheader.kmk
30
31#
32# Make sure our Config.kmk is included.
33#
34ifndef VBOX_MAIN_CONFIG_KMK_INCLUDED
35 include $(PATH_SUB_CURRENT)/Config.kmk
36endif
37
38#
39# Include sub-makefile(s).
40#
41ifndef VBOX_ONLY_EXTPACKS
42 ifdef VBOX_WITH_WEBSERVICES
43 include $(PATH_SUB_CURRENT)/webservice/Makefile.kmk
44 endif
45 include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
46 include $(PATH_SUB_CURRENT)/cbinding/Makefile.kmk
47 include $(PATH_SUB_CURRENT)/UnattendedTemplates/Makefile.kmk
48 ifndef VBOX_ONLY_SDK
49 include $(PATH_SUB_CURRENT)/src-helper-apps/OpenGLTest/Makefile.kmk
50 endif
51 if defined(VBOX_WITH_OPEN_WATCOM) && defined(VBOX_WITH_UNATTENDED)
52 include $(PATH_SUB_CURRENT)/src-helper-apps/os2/Makefile.kmk
53 endif
54endif
55
56
57#
58# Targets and globals (bit of a mess...)
59#
60VBOX_PATH_MAIN_SRC := $(PATH_SUB_CURRENT)
61
62ifdef VBOX_ONLY_SDK
63 # HACK ALERT! VBoxCOM is skipped, but its output dir is referenced a lot. So, define it.
64 VBoxCOM_0_OUTDIR := $(call TARGET_PATH,VBoxCOM)
65 BLDDIRS += $(VBoxCOM_0_OUTDIR) $(PATH_STAGE_BIN)/components
66 ifndef TOOL_$(VBOX_VCC_TOOL)
67 include $(KBUILD_PATH)/tools/$(VBOX_VCC_TOOL).kmk # For the idl /cpp statement.
68 endif
69 ifndef SDK_$(VBOX_WINPSDK)
70 include $(KBUILD_PATH)/sdks/$(VBOX_WINPSDK).kmk
71 endif
72endif # !VBOX_ONLY_SDK
73
74
75## VBOX_MAIN_DEFS is used by VBoxC, VBoxClient-x86, VBoxSVC and VBoxSVCM, making
76# sure they all have the same set of features enabled.
77VBOX_MAIN_DEFS :=
78ifneq ($(KBUILD_TARGET),win)
79 ifndef VBOX_WITH_XPCOM
80 $(error "VBox: VBOX_WITH_XPCOM isn't defined")
81 endif
82 VBOX_MAIN_DEFS += VBOX_WITH_GENERIC_SESSION_WATCHER
83endif
84ifdef VBOX_WITH_AUDIO_ALSA
85 VBOX_MAIN_DEFS += VBOX_WITH_AUDIO_ALSA
86endif
87ifdef VBOX_WITH_AUDIO_DEBUG
88 VBOX_MAIN_DEFS += VBOX_WITH_AUDIO_DEBUG
89endif
90ifdef VBOX_WITH_AUDIO_OSS
91 VBOX_MAIN_DEFS += VBOX_WITH_AUDIO_OSS
92endif
93ifdef VBOX_WITH_AUDIO_PULSE
94 VBOX_MAIN_DEFS += VBOX_WITH_AUDIO_PULSE
95endif
96ifdef VBOX_WITH_AUDIO_RECORDING
97 VBOX_MAIN_DEFS += VBOX_WITH_AUDIO_RECORDING
98endif
99ifdef VBOX_WITH_AUDIO_VALIDATIONKIT
100 VBOX_MAIN_DEFS += VBOX_WITH_AUDIO_VALIDATIONKIT
101endif
102ifdef VBOX_WITH_AUDIO_VRDE
103 VBOX_MAIN_DEFS += VBOX_WITH_AUDIO_VRDE
104endif
105ifdef VBOX_WITH_COPYTOGUEST
106 VBOX_MAIN_DEFS += VBOX_WITH_COPYTOGUEST
107endif
108ifdef VBOX_WITH_E1000
109 VBOX_MAIN_DEFS += VBOX_WITH_E1000
110endif
111ifdef VBOX_WITH_EXTPACK
112 VBOX_MAIN_DEFS += VBOX_WITH_EXTPACK
113endif
114ifdef VBOX_WITH_GUEST_CONTROL
115 VBOX_MAIN_DEFS += VBOX_WITH_GUEST_CONTROL
116endif
117ifdef VBOX_WITH_GUEST_PROPS
118 VBOX_MAIN_DEFS += VBOX_WITH_GUEST_PROPS
119 ifdef VBOX_WITH_GUEST_PROPS_RDONLY_GUEST
120 VBOX_MAIN_DEFS += VBOX_WITH_GUEST_PROPS_RDONLY_GUEST
121 endif
122endif
123ifdef VBOX_WITH_HGCM
124 VBOX_MAIN_DEFS += VBOX_WITH_HGCM
125endif
126ifdef VBOX_WITH_HOSTNETIF_API
127 VBOX_MAIN_DEFS += VBOX_WITH_HOSTNETIF_API
128endif
129ifdef VBOX_WITH_DHCPD
130 VBOX_MAIN_DEFS += VBOX_WITH_DHCPD
131endif
132ifdef VBOX_WITH_LIVE_MIGRATION
133 VBOX_MAIN_DEFS += VBOX_WITH_LIVE_MIGRATION
134endif
135ifdef VBOX_WITH_MIDL_PROXY_STUB
136 VBOX_MAIN_DEFS += VBOX_WITH_MIDL_PROXY_STUB
137endif
138ifdef VBOX_WITH_NETFLT
139 VBOX_MAIN_DEFS += VBOX_WITH_NETFLT
140endif
141if defined(VBOX_WITH_VMNET) && "$(KBUILD_TARGET)" == "darwin"
142 VBOX_MAIN_DEFS += VBOX_WITH_VMNET
143endif
144ifdef VBOX_WITH_CLOUD_NET
145 VBOX_MAIN_DEFS += VBOX_WITH_CLOUD_NET
146endif
147ifdef VBOX_WITH_PCI_PASSTHROUGH
148 VBOX_MAIN_DEFS += VBOX_WITH_PCI_PASSTHROUGH
149endif
150ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
151 VBOX_MAIN_DEFS += VBOX_WITH_PDM_ASYNC_COMPLETION
152endif
153ifdef VBOX_WITH_RECORDING
154 VBOX_MAIN_DEFS += VBOX_WITH_RECORDING
155endif
156ifdef VBOX_WITH_SDS
157 VBOX_MAIN_DEFS += VBOX_WITH_SDS
158endif
159ifdef VBOX_WITH_SHARED_CLIPBOARD
160 VBOX_MAIN_DEFS += VBOX_WITH_SHARED_CLIPBOARD
161 ifdef VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
162 VBOX_MAIN_DEFS += VBOX_WITH_SHARED_CLIPBOARD_TRANSFERS
163 endif
164endif
165if defined(VBOX_WITH_LIBCURL) && defined(VBOX_WITH_UPDATE_AGENT)
166 VBOX_MAIN_DEFS += VBOX_WITH_UPDATE_AGENT
167endif
168ifdef VBOX_WITH_USB_CARDREADER
169 VBOX_MAIN_DEFS += VBOX_WITH_USB_CARDREADER
170endif
171ifdef VBOX_WITH_USB_CARDREADER_TEST
172 VBOX_MAIN_DEFS += VBOX_WITH_USB_CARDREADER_TEST
173endif
174ifdef VBOX_WITH_VIRTIO
175 VBOX_MAIN_DEFS += VBOX_WITH_VIRTIO
176endif
177ifdef VBOX_WITH_VIRTIO_1_0
178 VBOX_MAIN_DEFS += VBOX_WITH_VIRTIO_1_0
179endif
180ifdef VBOX_WITH_VIRTIO_NET_1_0
181 VBOX_MAIN_DEFS += VBOX_WITH_VIRTIO_NET_1_0
182endif
183ifdef VBOX_WITH_VMSVGA
184 VBOX_MAIN_DEFS += VBOX_WITH_VMSVGA
185endif
186ifdef VBOX_WITH_VMSVGA3D
187 VBOX_MAIN_DEFS += VBOX_WITH_VMSVGA3D
188endif
189ifdef VBOX_WITH_VUSB
190 VBOX_MAIN_DEFS += VBOX_WITH_VUSB
191endif
192ifdef VBOX_WITH_EHCI
193 ifdef VBOX_WITH_USB
194 VBOX_MAIN_DEFS += VBOX_WITH_EHCI
195 endif
196endif
197ifdef VBOX_WITH_EFI_IN_DD2
198 VBOX_MAIN_DEFS += VBOX_WITH_EFI_IN_DD2
199endif
200ifdef VBOX_WITH_MAIN_NLS
201 VBOX_MAIN_DEFS += VBOX_WITH_MAIN_NLS
202endif
203ifdef VBOX_WITH_GSTCTL_TOOLBOX_SUPPORT
204 VBOX_MAIN_DEFS += VBOX_WITH_GSTCTL_TOOLBOX_SUPPORT
205endif
206ifdef VBOX_WITH_GSTCTL_TOOLBOX_AS_CMDS
207 VBOX_MAIN_DEFS += VBOX_WITH_GSTCTL_TOOLBOX_AS_CMDS
208endif
209# Unconditionally enable the new semaphore key generation code
210VBOX_MAIN_DEFS += VBOX_WITH_NEW_SYS_V_KEYGEN
211
212
213VBOX_IDL_FILE.MSCOM = $(VBOX_PATH_SDK)/bindings/mscom/idl/VirtualBox.idl
214VBOX_IDL_FILE.XPCOM = $(VBOX_PATH_SDK)/bindings/xpcom/idl/VirtualBox_XPCOM.idl
215
216VBOX_IDL_TYPELIB.XPCOM = $(PATH_STAGE_BIN)/components/VirtualBox_XPCOM.xpt
217VBOX_IDL_HEADER.XPCOM = $(VBOX_PATH_SDK)/bindings/xpcom/include/VirtualBox_XPCOM.h
218
219# The MS COM specific stuff.
220if defined(VBOX_ONLY_SDK) || "$(KBUILD_TARGET)" == "win"
221 OTHERS += \
222 $(VBOX_IDL_FILE.MSCOM)
223 OTHER_CLEAN += \
224 $(VBOX_IDL_FILE.MSCOM)
225
226 INSTALLS += VBox-mscom-bindings-include VBox-mscom-bindings-lib
227 VBox-mscom-bindings-include_INST = $(INST_SDK)bindings/mscom/include/
228 VBox-mscom-bindings-include_MODE = a+r,u+w
229 VBox-mscom-bindings-include_SOURCES = $(VBoxCOM_0_OUTDIR)/VirtualBox.h
230 VBox-mscom-bindings-include_CLEAN = $(VBoxCOM_0_OUTDIR)/VirtualBox.h
231 VBox-mscom-bindings-lib_INST = $(INST_SDK)bindings/mscom/lib/
232 VBox-mscom-bindings-lib_MODE = a+r,u+w
233 VBox-mscom-bindings-lib_SOURCES = $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
234 $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb
235 VBox-mscom-bindings-lib_CLEAN = $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
236 $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb
237
238 BLDDIRS += $(VBOX_PATH_SDK)/bindings/mscom/idl
239endif
240
241# The XPCOM specific stuff.
242# if defined(VBOX_ONLY_SDK) || "$(KBUILD_TARGET)" != "win" -- does not build on Windows
243if "$(KBUILD_TARGET)" != "win"
244 OTHERS += $(VBOX_IDL_FILE.XPCOM) $(VBOX_IDL_TYPELIB.XPCOM) $(VBOX_IDL_HEADER.XPCOM)
245 OTHER_CLEAN += \
246 $(VBOX_IDL_FILE.XPCOM) \
247 $(VBOX_IDL_HEADER.XPCOM) \
248 $(VBOX_IDL_TYPELIB.XPCOM)
249
250 INSTALLS += VBox-xpcom-bindings-lib
251 VBox-xpcom-bindings-lib_INST = $(INST_SDK)bindings/xpcom/lib/
252 VBox-xpcom-bindings-lib_MODE = a+r,u+w
253 VBox-xpcom-bindings-lib_SOURCES = $(VBoxCOM_0_OUTDIR)/VirtualBox_XPCOM_i.c=>VirtualBox_i.c
254 VBox-xpcom-bindings-lib_CLEAN = $(VBoxCOM_0_OUTDIR)/VirtualBox_XPCOM_i.c
255
256 VBOX_MAIN_PREREQS += $(VBOX_IDL_TYPELIB.XPCOM) $(VBOX_IDL_HEADER.XPCOM)
257 BLDDIRS += \
258 $(VBOX_PATH_SDK)/bindings/xpcom/idl \
259 $(VBOX_PATH_SDK)/bindings/xpcom/include
260 # disable VBoxSDS for XPCOM
261 override VBOX_WITH_SDS =
262endif # xpcom
263
264
265#
266# Strip documentation from source XIDL so that we don't get a full
267# recompile every time a comma in the documentation is changed.
268#
269$(call KB_FN_AUTO_CMD_DEPS,$(VBOX_XIDL_FILE).ts)
270$(VBOX_XIDL_FILE).ts +| $(VBOX_XIDL_FILE): \
271 $(VBOX_XIDL_FILE_SRC) \
272 $(VBOX_PATH_MAIN_SRC)/idl/docstrip.xsl \
273 | $$(dir $$@)
274 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
275 $(QUIET)$(VBOX_XSLTPROC) -o $(VBOX_XIDL_FILE).ts-tmp $(VBOX_PATH_MAIN_SRC)/idl/docstrip.xsl $(VBOX_XIDL_FILE_SRC)
276 $(QUIET)$(SED) -e 's/ *$(DOLLAR)//g' -e '/^$(DOLLAR)/d' --output $(VBOX_XIDL_FILE).ts $(VBOX_XIDL_FILE).ts-tmp
277 $(QUIET)$(RM) -- $(VBOX_XIDL_FILE).ts-tmp
278 $(QUIET)$(CP) --changed -fv -- $(VBOX_XIDL_FILE).ts $(VBOX_XIDL_FILE)
279
280OTHER_CLEAN += $(VBOX_XIDL_FILE) $(VBOX_XIDL_FILE).ts
281
282
283#
284# The Main API documentation
285#
286VBOX_MAIN_DOC_DIR = $(VBOX_PATH_SDK)/docs
287BLDDIRS += $(VBOX_MAIN_DOC_DIR)
288
289$(PATH_TARGET)/docs.Main: \
290 $(VBOX_PATH_MAIN_SRC)/Doxyfile.Main \
291 $(VBOX_PATH_MAIN_SRC)/idl/doxygen.xsl \
292 $(VBOX_XIDL_FILE_SRC) \
293 | $(PATH_TARGET)/ \
294 $(VBOX_MAIN_DOC_DIR)/
295 $(call MSG_TOOL,xsltproc,doxygen input,$<,$@)
296 $(QUIET)$(RM) -f $(wildcard $(VBOX_MAIN_DOC_DIR)/html/*) $(PATH_TARGET)/docs.Main
297 $(QUIET)$(VBOX_XSLTPROC) --path ".:$(PATH_ROOT)/doc/manual" -o $(PATH_TARGET)/VirtualBox.idl $(VBOX_PATH_MAIN_SRC)/idl/doxygen.xsl $(VBOX_XIDL_FILE_SRC)
298 $(QUIET)$(REDIRECT) -E 'DOCDIR=$(VBOX_MAIN_DOC_DIR)' -E 'PATH_TARGET=$(PATH_TARGET)' \
299 -- doxygen $(VBOX_PATH_MAIN_SRC)/Doxyfile.Main
300 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) ">>>>>>>>>>>>>>>>>>>> Main.err: >>>>>>>>>>>>>>>>>>>>>>>>"
301 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(CAT) "$(PATH_TARGET)/Main.err"
302 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "<<<<<<<<<<<<<<<<<<<< Main.err <<<<<<<<<<<<<<<<<<<<<<<<<"
303 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "===> **************************************************"
304 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "===> Please fix above doxygen errors/warnings listed in"
305 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "===> $(PATH_TARGET)/Main.err"
306 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "===> **************************************************"
307 $(APPEND) $(PATH_TARGET)/docs.Main
308# aliases
309docs.main docs.Main: $(PATH_TARGET)/docs.Main
310if !defined(VBOX_ONLY_DOCS) && defined(VBOX_WITH_ALL_DOXYGEN_TARGETS)
311 docs: $(PATH_TARGET)/docs.Main
312else
313 docs:
314endif
315
316
317ifndef VBOX_ONLY_SDK
318 #
319 # Generate library with API class wrappers from the XIDL file.
320 #
321 LIBRARIES += VBoxAPIWrap
322 VBoxAPIWrap_TEMPLATE = VBoxMainLib
323 ifeq ($(KBUILD_TARGET),win)
324 VBoxAPIWrap_USES = vccprecomp
325 VBoxAPIWrap_PCH_HDR := $(PATH_SUB_CURRENT)/src-all/win/VBoxAPIWrap-precomp_vcc.h
326 else if $(KBUILD_KMK_REVISION) >= 3256 && "$(KBUILD_TARGET)" != "darwin" && !defined(VBOX_WITHOUT_PRECOMPILED_HEADERS)
327 if $(VBOX_GCC_VERSION_CXX) >= 50000 # GCC 4.x runs into trouble compiling the header.
328 VBoxAPIWrap_USES = gccprecomp
329 VBoxAPIWrap_PCH_HDR := $(PATH_SUB_CURRENT)/src-all/xpcom/VBoxAPIWrap-precomp_gcc.h
330 endif
331 endif
332 VBoxAPIWrap_SOURCES = \
333 $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d \
334 $(if-expr defined(VBOX_ONLY_EXTPACKS) \
335 , $(addprefix $(VBoxAPIWrap_0_OUTDIR)/,$(filter \
336 Cloud% \
337 DataStreamWrap.cpp \
338 %FormValueWrap.cpp \
339 %FormWrap.cpp \
340 StringArrayWrap.cpp \
341 , $(notdir $(VBOX_MAIN_APIWRAPPER_GEN_SRCS)))) \
342 , $(VBOX_MAIN_APIWRAPPER_GEN_SRCS))
343 VBoxAPIWrap_INTERMEDIATES = $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
344 VBoxAPIWrap_DEFS.win.x86 += _WIN32_WINNT=0x0500
345 VBoxAPIWrap_DEFS.win.amd64 += _WIN32_WINNT=0x0510
346 VBoxAPIWrap_INCS += \
347 include
348 if ("$(KBUILD_TARGET)" == "solaris" && $(VBOX_GCC_VERSION_CXX) >= 70000)
349 # Avoid too long symbol names with Solaris 11.4 "dtrace: failed to link script .../VBoxAPI.d: failed to allocate space for probe"
350 VBoxAPIWrap_CXXFLAGS.solaris += -freorder-blocks-algorithm=simple -fno-reorder-blocks-and-partition -fno-reorder-functions
351 endif
352 VBoxAPIWrap_CLEAN = \
353 $(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.cpp) \
354 $(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.h) \
355 $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d.ts \
356 $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d \
357 $(VBoxAPIWrap_0_OUTDIR)/apiwrappers-headers \
358 $(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-even \
359 $(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-odd
360
361 # Two VBox variables used here and/or in the rules generating wrappers.
362 VBoxAPIWrap_VBOX_XSLT = \
363 $(VBOX_PATH_MAIN_SRC)/idl/apiwrap-server.xsl
364
365
366 # This include file (generated at the bottom of this file), defines
367 # VBOX_MAIN_APIWRAPPER_GEN_SRCS and VBOX_MAIN_APIWRAPPER_GEN_HDRS.
368 VBoxAPIWrap_VBOX_KMK_FILE = $(PATH_OUT)/vboxapiwrap.kmk
369 include $(VBoxAPIWrap_VBOX_KMK_FILE)
370 OTHER_CLEAN += $(VBoxAPIWrap_VBOX_KMK_FILE) $(VBoxAPIWrap_VBOX_KMK_FILE).ts
371
372 ifdef VBOX_WITH_32_ON_64_MAIN_API
373 LIBRARIES += VBoxAPIWrap-x86
374 VBoxAPIWrap-x86_TEMPLATE = VBoxMainLib-x86
375 VBoxAPIWrap-x86_EXTENDS = VBoxAPIWrap
376 VBoxAPIWrap-x86_DTRACE_HDR_FLAGS = -32 # ugly, should be fixed in the tool in Config.kmk
377 ifeq ($(KBUILD_TARGET),win) ## @todo fix inheritance (fixed in r3253)
378 VBoxAPIWrap-x86_USES = vccprecomp
379 VBoxAPIWrap-x86_PCH_HDR := $(PATH_SUB_CURRENT)/src-all/win/VBoxAPIWrap-precomp_vcc.h
380 endif
381 endif
382
383endif # !VBOX_ONLY_SDK
384
385#
386# Some SDK bit.
387#
388INSTALLS += VBox-main-xidl
389VBox-main-xidl_INST = $(INST_SDK)bindings/
390VBox-main-xidl_MODE = a+r,u+w
391VBox-main-xidl_SOURCES = $(VBOX_XIDL_FILE_SRC)
392
393if defined(VBOX_WITH_PYTHON) && !defined(VBOX_ONLY_EXTPACKS)
394 INSTALLS += VBox-python-glue
395 VBox-python-glue_INST = $(INST_SDK)installer/vboxapi/
396 VBox-python-glue_MODE = a+r,u+w
397 VBox-python-glue_SOURCES = \
398 glue/vboxapi.py=>__init__.py \
399 $(VBox-python-glue_0_OUTDIR)/VirtualBox_constants.py
400 VBox-python-glue_CLEAN = \
401 $(VBox-python-glue_0_OUTDIR)/VirtualBox_constants.py \
402 $(VBox-python-glue_0_OUTDIR)/VirtualBox_constants_err_h_1.txt
403 $(call KB_FN_DO_PASS0_ON_TARGET,VBox-python-glue)
404 $(call KB_FN_AUTO_CMD_DEPS,$(VBox-python-glue_0_OUTDIR)/VirtualBox_constants.py)
405 $(VBox-python-glue_0_OUTDIR)/VirtualBox_constants.py \
406 + $(VBox-python-glue_0_OUTDIR)/VirtualBox_constants_err_h_1.txt: \
407 $(VBOX_PATH_MAIN_SRC)/glue/constants-python.xsl \
408 $(VBOX_PATH_MAIN_SRC)/glue/vbox-err-consts.sed \
409 $(PATH_ROOT)/include/iprt/err.h \
410 $(PATH_ROOT)/include/VBox/err.h \
411 $(VBOX_XIDL_FILE) \
412 | $$(dir $$@)
413 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
414 $(call MSG_TOOL,xsltproc,Python constants,$<,$@)
415 $(SED) -f $(VBOX_PATH_MAIN_SRC)/glue/vbox-err-consts.sed \
416 --output $(VBox-python-glue_0_OUTDIR)/VirtualBox_constants_err_h_1.txt \
417 $(PATH_ROOT)/include/iprt/err.h \
418 $(PATH_ROOT)/include/VBox/err.h
419 $(QUIET)$(VBOX_XSLTPROC) -o $@ \
420 --stringparam "g_sErrHFile" "$(VBox-python-glue_0_OUTDIR)/VirtualBox_constants_err_h_1.txt" \
421 $(VBOX_PATH_MAIN_SRC)/glue/constants-python.xsl $(VBOX_XIDL_FILE)
422endif # VBOX_WITH_PYTHON && !VBOX_ONLY_EXTPACKS
423
424if !defined(VBOX_ONLY_SDK) && !defined(VBOX_ONLY_EXTPACKS) # Note this goes on for *very* long
425
426 #
427 # Generate SchemaDefs.h and SchemaDefs.cpp from XML Schema
428 # These two files are used by both VBoxC and VBoxSVC.
429 #
430 BLDDIRS += $(PATH_TARGET)/Main
431
432 testschemadefs: $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP)
433
434
435 #
436 # Trust anchors and certificates -> .cpp
437 #
438 VBOX_SVC_CERTS_FILE = $(VBoxSVC_0_OUTDIR)/TrustAnchorsAndCerts.cpp
439 VBOX_SVC_CERTS := \
440 UefiMicrosoftKek=MicCorKEKCA2011_2011-06-24.crt \
441 UefiMicrosoftCa=MicCorUEFCA2011_2011-06-27.crt \
442 UefiMicrosoftProPca=MicWinProPCA2011_2011-10-19.crt \
443 UefiOracleDefPk=OrclUefiDefPk2021_2021-09-29.crt
444
445 VBOX_SVC_CERT_NAMES := $(foreach cert,$(VBOX_SVC_CERTS),$(firstword $(subst =,$(SPACE) ,$(cert))))
446 VBOX_SVC_PATH_CERTIFICATES := $(PATH_SUB_CURRENT)/Certificates
447
448 $$(VBOX_SVC_CERTS_FILE): $(MAKEFILE_CURRENT) \
449 $(foreach cert,$(VBOX_SVC_CERTS),$(VBOX_SVC_PATH_CERTIFICATES)/$(lastword $(subst =,$(SPACE) ,$(cert)))) \
450 $(VBOX_BIN2C) \
451 | $$(dir $$@)
452 $(QUIET)$(RM) -f -- $@
453 $(QUIET)$(APPEND) -n "$@" \
454 '' \
455 '#include "TrustAnchorsAndCerts.h"' \
456 ''
457 $(foreach cert,$(VBOX_SVC_CERTS), $(NLTAB)$(VBOX_BIN2C) -ascii --append \
458 "$(firstword $(subst =,$(SP) ,$(cert)))" \
459 "$(VBOX_SVC_PATH_CERTIFICATES)/$(lastword $(subst =,$(SP) ,$(cert)))" \
460 "$@")
461
462 OTHER_CLEAN += $(VBOX_SVC_CERTS_FILE)
463
464 tst-main-certificates: $(VBOX_SVC_CERTS_FILE)
465
466
467 #
468 # VBoxSDS executable
469 #
470 if defined(VBOX_WITH_SDS) && "$(KBUILD_TARGET)" == "win"
471 PROGRAMS.win += VBoxSDS
472 VBoxSDS_TEMPLATE = VBoxMainExe
473 VBoxSDS_DEFS += VBOX_COM_OUTOFPROC_MODULE _WIN32_WINNT=0x0600
474 ifdef VBOX_WITH_VBOXSDL
475 VBoxSDS_DEFS += VBOX_WITH_VBOXSDL
476 endif
477 ifdef VBOX_WITH_HEADLESS
478 VBoxSDS_DEFS += VBOX_WITH_HEADLESS
479 endif
480 ifdef VBOX_WITH_QTGUI
481 VBoxSDS_DEFS += VBOX_WITH_QTGUI
482 endif
483 ifdef VBOX_WITH_VBOXSVC_SESSION_0
484 VBoxSDS_DEFS += VBOX_WITH_VBOXSVC_SESSION_0
485 endif
486 VBoxSDS_INCS = \
487 include \
488 $(VBoxSDS_0_OUTDIR) \
489 $(VBoxCOM_0_OUTDIR)
490 VBoxSDS_INTERMEDIATES = \
491 $(VBOX_MAIN_PREREQS)
492 VBoxSDS_SOURCES = \
493 src-global/win/VBoxSDS.cpp \
494 src-global/win/VirtualBoxSDSImpl.cpp \
495 src-global/win/VBoxSDS.rc \
496 src-all/MachineLaunchVMCommonWorker.cpp
497 $(call KB_FN_DO_PASS0_ON_TARGET,VBoxSDS) # Sets VBoxSDS_0_OUTDIR
498
499 src-global/win/VBoxSDS.rc_INCS = $(VBoxSDS_0_OUTDIR)
500 src-global/win/VBoxSDS.rc_DEPS = $(VBoxSDS_0_OUTDIR)/VBoxSDS-icon.rc #$(VBoxSDS_0_OUTDIR)/VBoxSDS.rgs
501 VBoxSDS_CLEAN = $(VBoxSDS_0_OUTDIR)/VBoxSDS-icon.rc #$(VBoxSDS_0_OUTDIR)/VBoxSDS.rgs
502
503 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxSDS_0_OUTDIR)/VBoxSDS-icon.rc)
504 $(VBoxSDS_0_OUTDIR)/VBoxSDS-icon.rc: $(VBOX_WINDOWS_ICON_FILE) | $$(dir $$@)
505 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
506 $(APPEND) -t $@ '1 ICON DISCARDABLE "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
507
508 # $(call KB_FN_AUTO_CMD_DEPS,$(VBoxSDS_0_OUTDIR)/VBoxSDS.rgs)
509 # $(VBoxSDS_0_OUTDIR)/VBoxSDS.rgs: $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
510 # $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
511 # $(VBOX_XSLTPROC) \
512 # --stringparam Application "VirtualBox System" \
513 # --stringparam Module VBoxSDS \
514 # -o $@ \
515 # $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl \
516 # $(VBOX_XIDL_FILE)
517 #
518 endif #if defined(VBOX_WITH_SDS) && "$(KBUILD_TARGET)" == "win"
519
520 #
521 # VBoxSVC executable
522 #
523 PROGRAMS += VBoxSVC
524 VBoxSVC_TEMPLATE = VBoxMainExe
525 if defined(VBOX_WITH_PRECOMPILED_HEADERS) && "$(KBUILD_TARGET)" == "win"
526 VBoxSVC_USES += vccprecomp
527 VBoxSVC_PCH_HDR := $(PATH_SUB_CURRENT)/src-server/win/precomp_vcc.h
528 else if $(KBUILD_KMK_REVISION) >= 3256 && "$(KBUILD_TARGET)" != "darwin" && !defined(VBOX_WITHOUT_PRECOMPILED_HEADERS)
529 if $(VBOX_GCC_VERSION_CXX) >= 50000 # GCC 4.x runs into trouble compiling the header.
530 VBoxSVC_USES += gccprecomp
531 VBoxSVC_PCH_HDR := $(PATH_SUB_CURRENT)/src-server/xpcom/precomp_gcc.h
532 endif
533 endif
534 VBoxSVC_DEFS = \
535 IN_VBOXSVC \
536 VBOX_MAIN_SETTINGS_ADDONS \
537 IN_VMM_STATIC \
538 $(VBOX_MAIN_DEFS) \
539 $(if $(VBOX_WITH_VBOXSDL),VBOX_WITH_VBOXSDL,) \
540 $(if $(VBOX_WITH_HEADLESS),VBOX_WITH_HEADLESS,) \
541 $(if $(VBOX_WITH_QTGUI),VBOX_WITH_QTGUI,) \
542 $(if $(VBOX_WITH_AHCI),VBOX_WITH_AHCI,) \
543 $(if $(VBOX_WITH_LSILOGIC),VBOX_WITH_LSILOGIC,) \
544 $(if $(VBOX_WITH_LINUX_COMPILER_H),VBOX_WITH_LINUX_COMPILER_H,) \
545 $(if $(VBOX_WITH_RESOURCE_USAGE_API),VBOX_WITH_RESOURCE_USAGE_API,) \
546 $(if $(VBOX_WITH_UNATTENDED),VBOX_WITH_UNATTENDED,) \
547 $(if $(VBOX_WITH_DBUS),VBOX_WITH_DBUS,) \
548 $(if $(VBOX_WITH_DBUS),$(if $(VBOX_USB_WITH_DBUS),VBOX_USB_WITH_DBUS,),) \
549 $(if $(VBOX_USB_WITH_SYSFS),VBOX_USB_WITH_SYSFS,) \
550 $(if $(VBOX_USB_WITH_INOTIFY),VBOX_USB_WITH_INOTIFY,) \
551 $(if $(VBOX_WITH_NAT_SERVICE),VBOX_WITH_NAT_SERVICE,) \
552 $(if $(VBOX_WITH_IOMMU_AMD),VBOX_WITH_IOMMU_AMD,) \
553 $(if $(VBOX_WITH_IOMMU_INTEL),VBOX_WITH_IOMMU_INTEL,) \
554 $(if $(VBOX_WITH_TPM),VBOX_WITH_TPM,) \
555 $(if $(VBOX_WITH_FULL_VM_ENCRYPTION),VBOX_WITH_FULL_VM_ENCRYPTION,) \
556 $(if-expr defined(VBOX_WITH_SDS),VBOX_WITH_SDS,)
557 ifdef VBOX_WITH_USB
558 VBoxSVC_DEFS += \
559 VBOX_WITH_USB \
560 $(if $(VBOX_WITH_EHCI),VBOX_WITH_EHCI,) \
561 $(if $(VBOX_WITH_NEW_USB_CODE_ON_DARWIN),VBOX_WITH_NEW_USB_CODE_ON_DARWIN,)
562 endif
563 VBoxSVC_DEFS.win += VBOX_COM_OUTOFPROC_MODULE _WIN32_WINNT=0x0600
564 # Try to load and use libhal at runtime for probing removable media
565 # VBoxSVC_DEFS.linux += VBOX_USE_LIBHAL
566 VBoxSVC_DEFS.solaris += VBOX_USE_LIBHAL
567
568 if $(KBUILD_TARGET) != "win" && $(VBOX_GCC_VERSION_CXX) >= 40900 # gcc 4.9.x (4.8.x is causing endless RT_ELEMENT trouble)
569 VBoxSVC_CXXFLAGS = -Wunused -Wconversion
570 endif
571
572 VBoxSVC_INCS = \
573 include \
574 $(VBoxSVC_0_OUTDIR) \
575 $(dir $(VBOX_XML_SCHEMADEFS_H)) \
576 $(VBOX_MAIN_APIWRAPPER_INCS) \
577 . \
578 $(VBOX_GRAPHICS_INCS)
579 VBoxSVC_INCS.win = \
580 $(VBoxCOM_0_OUTDIR)
581 ifdef VBOX_WITH_USB
582 VBoxSVC_INCS.os2 = \
583 $(PATH_ROOT)/src/VBox/HostDrivers/VBoxUSB/os2
584 endif
585
586 VBoxSVC_LIBS += \
587 $(PATH_STAGE_LIB)/VBoxAPIWrap$(VBOX_SUFF_LIB) \
588 $(PATH_STAGE_LIB)/SSMStandalone$(VBOX_SUFF_LIB) \
589 $(LIB_DDU)
590
591 VBoxSVC_SDKS = VBoxLibPng VBoxZlib
592 VBoxSVC_LIBS.solaris = \
593 adm \
594 nsl \
595 devinfo \
596 socket
597
598 VBoxSVC_LIBS.win += \
599 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/dnsapi.lib
600
601 VBoxSVC_INTERMEDIATES = \
602 $(VBOX_MAIN_PREREQS) \
603 $(VBOX_XML_SCHEMADEFS_H) \
604 $(VBOX_AUTOGEN_EVENT_H) \
605 $(VBOX_AUTOGEN_STRINGIFY_ENUMS_H) \
606 $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
607
608 VBoxSVC_SOURCES = \
609 $(VBOX_SVC_CERTS_FILE) \
610 $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d \
611 src-all/AuthLibrary.cpp \
612 src-all/CryptoUtils.cpp \
613 src-all/DisplayPNGUtil.cpp \
614 src-all/DisplayResampleImage.cpp \
615 src-all/DisplayUtils.cpp \
616 src-all/EventImpl.cpp \
617 src-all/Global.cpp \
618 src-all/GlobalStatusConversion.cpp \
619 src-all/HashedPw.cpp \
620 src-all/Logging.cpp \
621 src-all/NvramStoreImpl.cpp \
622 src-all/PCIDeviceAttachmentImpl.cpp \
623 src-all/ProgressImpl.cpp \
624 src-all/SecretKeyStore.cpp \
625 src-all/SharedFolderImpl.cpp \
626 src-all/AutoCaller.cpp \
627 src-all/ThreadTask.cpp \
628 src-all/VirtualBoxBase.cpp \
629 src-all/VirtualBoxErrorInfoImpl.cpp \
630 $(if $(VBOX_WITH_EXTPACK),src-all/ExtPackManagerImpl.cpp src-all/ExtPackUtil.cpp,) \
631 src-server/CertificateImpl.cpp \
632 src-server/ApplianceImpl.cpp \
633 src-server/ApplianceImplExport.cpp \
634 src-server/ApplianceImplImport.cpp \
635 src-server/AudioAdapterImpl.cpp \
636 src-server/AudioSettingsImpl.cpp \
637 src-server/BandwidthControlImpl.cpp \
638 src-server/BandwidthGroupImpl.cpp \
639 src-server/BIOSSettingsImpl.cpp \
640 src-server/RecordingSettingsImpl.cpp \
641 src-server/RecordingScreenSettingsImpl.cpp \
642 src-server/GraphicsAdapterImpl.cpp \
643 src-server/ClientWatcher.cpp \
644 src-server/ClientToken.cpp \
645 src-server/CloudProviderManagerImpl.cpp \
646 src-server/CPUProfileImpl.cpp \
647 src-server/DataStreamImpl.cpp \
648 src-server/DHCPServerImpl.cpp \
649 src-server/DHCPConfigImpl.cpp \
650 ../NetworkServices/Dhcpd/DhcpOptions.cpp \
651 src-server/NetworkServiceRunner.cpp \
652 src-server/NATNetworkImpl.cpp \
653 $(if $(VBOX_WITH_CLOUD_NET), \
654 src-server/CloudNetworkImpl.cpp \
655 ,) \
656 src-server/GuestDebugControlImpl.cpp \
657 src-server/GuestOSTypeImpl.cpp \
658 src-server/HostDnsService.cpp \
659 src-server/HostImpl.cpp \
660 src-server/HostAudioDeviceImpl.cpp \
661 src-server/HostNetworkInterfaceImpl.cpp \
662 src-server/HostPower.cpp \
663 $(if $(VBOX_WITH_LIBCURL), \
664 $(if $(VBOX_WITH_UPDATE_AGENT), \
665 src-server/UpdateAgentImpl.cpp,), \
666 ) \
667 src-server/HostVideoInputDeviceImpl.cpp \
668 src-server/HostDrivePartitionImpl.cpp \
669 src-server/HostDriveImpl.cpp \
670 src-server/MachineImpl.cpp \
671 src-all/MachineLaunchVMCommonWorker.cpp \
672 src-server/MachineImplCloneVM.cpp \
673 src-server/MachineImplMoveVM.cpp \
674 src-server/Matching.cpp \
675 src-server/MediumAttachmentImpl.cpp \
676 src-server/MediumFormatImpl.cpp \
677 src-server/MediumImpl.cpp \
678 src-server/MediumLock.cpp \
679 src-server/MediumIOImpl.cpp \
680 src-server/NATEngineImpl.cpp \
681 src-server/NetworkAdapterImpl.cpp \
682 src-server/ParallelPortImpl.cpp \
683 src-server/ProgressProxyImpl.cpp \
684 src-server/SerialPortImpl.cpp \
685 src-server/SnapshotImpl.cpp \
686 src-server/StorageControllerImpl.cpp \
687 src-server/SystemPropertiesImpl.cpp \
688 src-server/TokenImpl.cpp \
689 src-server/TrustedPlatformModuleImpl.cpp \
690 src-server/UefiVariableStoreImpl.cpp \
691 $(if $(VBOX_WITH_UNATTENDED), \
692 src-server/UnattendedImpl.cpp \
693 src-server/UnattendedInstaller.cpp \
694 src-server/UnattendedOs2Installer.cpp \
695 src-server/UnattendedScript.cpp \
696 src-all/TextScript.cpp \
697 ,) \
698 src-server/USBControllerImpl.cpp \
699 src-server/USBDeviceFiltersImpl.cpp \
700 src-server/VFSExplorerImpl.cpp \
701 src-server/VirtualBoxImpl.cpp \
702 src-server/VRDEServerImpl.cpp \
703 src-server/generic/AutostartDb-generic.cpp \
704 xml/ovfreader.cpp \
705 xml/Settings.cpp \
706 $(VBOX_XML_SCHEMADEFS_CPP) \
707 $(VBOX_AUTOGEN_EVENT_CPP) \
708 $(VBOX_AUTOGEN_STRINGIFY_ENUMS_CPP) \
709 $(if $(VBOX_WITH_XPCOM),src-server/xpcom/server.cpp,)
710
711 ifdef VBOX_WITH_MAIN_NLS
712 VBoxSVC_SOURCES += \
713 src-all/VirtualBoxTranslator.cpp \
714 src-all/QMTranslatorImpl.cpp
715 endif
716
717 ifn1of ($(KBUILD_TARGET), win darwin)
718 VBoxSVC_SOURCES += $(PATH_ROOT)/src/VBox/Devices/Network/slirp/resolv_conf_parser.c
719 #$(PATH_ROOT)/src/VBox/Devices/Network/slirp/resolv_conf_parser.c_DEFS += LOG_GROUP=LOG_GROUP_MAIN
720 endif
721
722 VBoxSVC_SOURCES.darwin = \
723 src-server/darwin/iokit.cpp \
724 src-server/darwin/HostPowerDarwin.cpp \
725 src-server/darwin/HostDnsServiceDarwin.cpp
726 ifdef VBOX_WITH_VMNET
727 VBoxSVC_SOURCES.darwin += \
728 src-server/HostOnlyNetworkImpl.cpp
729 endif
730
731 VBoxSVC_SOURCES.win = \
732 src-server/win/svcmain.cpp \
733 src-server/win/svchlp.cpp \
734 src-server/win/HostPowerWin.cpp \
735 src-server/win/VBoxSVC.rc \
736 src-server/win/HostDnsServiceWin.cpp
737
738 VBoxSVC_SOURCES.linux = \
739 src-server/linux/HostHardwareLinux.cpp \
740 src-server/linux/HostDnsServiceLinux.cpp \
741 $(if $(VBOX_WITH_DBUS),src-server/linux/HostPowerLinux.cpp) \
742 src-server/HostDnsServiceResolvConf.cpp
743
744 VBoxSVC_SOURCES.solaris = \
745 src-server/linux/vbox-libhal.cpp \
746 src-server/solaris/DynLoadLibSolaris.cpp \
747 src-server/HostDnsServiceResolvConf.cpp
748
749 VBoxSVC_SOURCES.os2 = \
750 src-server/HostDnsServiceResolvConf.cpp
751
752 VBoxSVC_SOURCES.freebsd = \
753 src-server/freebsd/HostHardwareFreeBSD.cpp \
754 src-server/HostDnsServiceResolvConf.cpp
755
756 VBoxSVC_LDFLAGS.freebsd += -lcam
757
758
759 ifdef VBOX_WITH_USB
760 ifdef VBOX_WITH_SYSFS_BY_DEFAULT
761 src-server/linux/USBProxyBackendLinux.cpp_DEFS += VBOX_WITH_SYSFS_BY_DEFAULT
762 endif
763 VBoxSVC_SOURCES += \
764 src-server/USBDeviceFilterImpl.cpp \
765 src-server/USBProxyService.cpp \
766 src-server/USBProxyBackend.cpp \
767 src-server/generic/USBProxyBackendUsbIp.cpp \
768 src-server/HostUSBDeviceImpl.cpp
769 VBoxSVC_SOURCES.darwin += src-server/darwin/USBProxyBackendDarwin.cpp
770 VBoxSVC_SOURCES.linux += src-server/linux/USBProxyBackendLinux.cpp
771 VBoxSVC_SOURCES.linux += src-server/linux/USBGetDevices.cpp
772 VBoxSVC_SOURCES.os2 += src-server/os2/USBProxyBackendOs2.cpp
773 VBoxSVC_SOURCES.solaris += src-server/solaris/USBProxyBackendSolaris.cpp
774 VBoxSVC_SOURCES.win += src-server/win/USBProxyBackendWindows.cpp
775 VBoxSVC_SOURCES.freebsd += src-server/freebsd/USBProxyBackendFreeBSD.cpp
776 endif
777
778 ifdef VBOX_WITH_NETFLT
779 VBoxSVC_SDKS.win += VBoxWinNewDevLib
780 VBoxSVC_LIBS.win += \
781 $(PATH_STAGE_LIB)/WinNetConfigDll$(VBOX_SUFF_LIB) \
782 $(PATH_STAGE_LIB)/VBoxDrvCfgDll$(VBOX_SUFF_LIB) \
783 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
784 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
785 endif
786 VBoxSVC_LDFLAGS.darwin = -framework IOKit -framework SystemConfiguration
787
788 ifdef VBOX_WITH_3D_ACCELERATION
789 VBoxSVC_DEFS += VBOX_WITH_3D_ACCELERATION
790 VBoxSVC_LIBS += $(PATH_STAGE_LIB)/VBoxOGLTest$(VBOX_SUFF_LIB)
791 VBoxSVC_LDFLAGS.darwin += -framework OpenGL
792 endif
793
794 ifeq ($(KBUILD_TYPE),debug)
795 VBoxSVC_LDFLAGS.linux += -rdynamic # for backtrace_symbols()
796 endif
797
798 ifdef VBOX_WITH_RESOURCE_USAGE_API
799 VBoxSVC_SOURCES += \
800 src-server/PerformanceImpl.cpp \
801 src-server/Performance.cpp
802 VBoxSVC_SOURCES.darwin += src-server/darwin/PerformanceDarwin.cpp
803 VBoxSVC_SOURCES.freebsd += src-server/freebsd/PerformanceFreeBSD.cpp
804 VBoxSVC_SOURCES.linux += src-server/linux/PerformanceLinux.cpp
805 VBoxSVC_SOURCES.os2 += src-server/os2/PerformanceOs2.cpp
806 VBoxSVC_SOURCES.solaris += src-server/solaris/PerformanceSolaris.cpp
807 VBoxSVC_SOURCES.win += src-server/win/PerformanceWin.cpp
808 VBoxSVC_LDFLAGS.darwin += -lproc
809 VBoxSVC_LDFLAGS.solaris += -lkstat -lnvpair
810 VBoxSVC_LDFLAGS.win += psapi.lib powrprof.lib
811 endif
812
813 ifdef VBOX_WITH_HOSTNETIF_API
814 VBoxSVC_SOURCES.win += src-server/win/NetIf-win.cpp
815 VBoxSVC_SOURCES.linux += src-server/linux/NetIf-linux.cpp
816 VBoxSVC_SOURCES.os2 += src-server/os2/NetIf-os2.cpp
817 VBoxSVC_SOURCES.darwin += src-server/darwin/NetIf-darwin.cpp
818 VBoxSVC_SOURCES.solaris += src-server/solaris/NetIf-solaris.cpp
819 VBoxSVC_SOURCES.freebsd += src-server/freebsd/NetIf-freebsd.cpp
820 VBoxSVC_DEFS += VBOX_WITH_HOSTNETIF_API
821 if1of ($(KBUILD_TARGET), linux darwin solaris freebsd)
822 VBoxSVC_SOURCES += src-server/generic/NetIf-generic.cpp
823 endif
824 endif
825
826 $(call KB_FN_DO_PASS0_ON_TARGET,VBoxSVC) # Sets VBoxSVC_0_OUTDIR
827
828 ifdef VBOX_WITH_MAIN_USB_ID_DATABASE # Generate a database of USB vendor IDs and device IDs.
829 VBoxSVC_DEFS += VBOX_WITH_MAIN_USB_ID_DATABASE
830 VBoxSVC_SOURCES += $(VBoxSVC_0_OUTDIR)/USBIdDatabase.cpp
831 VBoxSVC_CLEAN += $(VBoxSVC_0_OUTDIR)/USBIdDatabase.cpp
832
833 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxSVC_0_OUTDIR)/USBIdDatabase.cpp)
834 $(VBoxSVC_0_OUTDIR)/USBIdDatabase.cpp: $$(USBIdDatabaseGenerator_1_TARGET) \
835 $(PATH_SUB_CURRENT)/src-server/usb.ids $(PATH_SUB_CURRENT)/src-server/custom.ids | $$(dir $$@)
836 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
837 $(call MSG_GENERATE,USBIdDatabase,$@,$(USBIdDatabaseGenerator_1_TARGET))
838 $(QUIET)$(USBIdDatabaseGenerator_1_TARGET) -o "$@" $(filter %.ids,$^)
839
840 BLDPROGS += USBIdDatabaseGenerator
841 USBIdDatabaseGenerator_TEMPLATE = VBoxAdvBldProg
842 USBIdDatabaseGenerator_SOURCES = src-server/USBIdDatabaseGenerator.cpp
843 else
844 VBoxSVC_SOURCES += src-server/USBIdDatabaseStub.cpp
845 endif
846
847 src-server/win/VBoxSVC.rc_INCS = $(VBoxSVC_0_OUTDIR)
848 src-server/win/VBoxSVC.rc_DEPS = $(VBoxSVC_0_OUTDIR)/VBoxSVC-icon.rc
849 VBoxSVC_CLEAN += $(VBoxSVC_0_OUTDIR)/VBoxSVC-icon.rc
850 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxSVC_0_OUTDIR)/VBoxSVC-icon.rc)
851 $(VBoxSVC_0_OUTDIR)/VBoxSVC-icon.rc: $(VBOX_WINDOWS_ICON_FILE) | $$(dir $$@)
852 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
853 $(APPEND) -t $@ '1 ICON DISCARDABLE "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
854
855 ifndef VBOX_WITH_MIDL_PROXY_STUB
856 src-server/win/VBoxSVC.rc_DEPS += $(VBoxSVC_0_OUTDIR)/VBoxSVC.rgs
857 VBoxSVC_CLEAN += $(VBoxSVC_0_OUTDIR)/VBoxSVC.rgs
858 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxSVC_0_OUTDIR)/VBoxSVC.rgs)
859 $(VBoxSVC_0_OUTDIR)/VBoxSVC.rgs: $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
860 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
861 $(VBOX_XSLTPROC) \
862 --stringparam Application VirtualBox \
863 --stringparam Module VBoxSVC \
864 -o $@ \
865 $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl \
866 $(VBOX_XIDL_FILE)
867 endif
868
869 ## @todo r=klaus unfortunately we don't have xmllint everywhere, would be
870 # good to check the validity for every VirtualBox.xidl change.
871 #$(VBOX_XIDL_FILE).validated.ts: $(VBOX_XIDL_FILE_SRC)
872 # xmllint --dtdvalid $(VBOX_PATH_MAIN_SRC)/idl/VirtualBox.dtd --noout $<
873 # $(QUIET)$(CP) --changed -fv $< $(VBOX_XIDL_FILE).validated.ts
874 #
875 #OTHERS += $(VBOX_XIDL_FILE).validated.ts
876 #OTHER_CLEAN += $(VBOX_XIDL_FILE).validated.ts
877
878 testvalidxidl: $(VBOX_XIDL_FILE_SRC)
879 xmllint --dtdvalid $(VBOX_PATH_MAIN_SRC)/idl/VirtualBox.dtd --noout $<
880
881
882 #
883 # Embed some constraints from XML Schema file into VBoxSVC
884 #
885 VBOX_XML_SCHEMA = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings.xsd
886
887 $(VBOX_XML_SCHEMADEFS_H): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA) | $$(dir $$@)
888 $(call MSG_GENERATE,SchemaDefs,$@,$<)
889 $(QUIET)$(VBOX_XSLTPROC) --stringparam mode declare -o $@ $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA)
890
891 $(VBOX_XML_SCHEMADEFS_CPP): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA) | $$(dir $$@)
892 $(call MSG_GENERATE,SchemaDefs,$@,$<)
893 $(QUIET)$(VBOX_XSLTPROC) --stringparam mode define -o $@ $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA)
894
895 testvalidsettings: $(VBOX_XML_SCHEMA)
896 xmllint --schema $< --noout $(HOME)/.VirtualBox/VirtualBox.xml
897 xmllint --schema $< --noout $(HOME)/.VirtualBox/Machines/*/*.xml
898 xmllint --schema $< --noout $(HOME)/.VirtualBox/Machines/*/*.vbox
899 xmllint --schema $< --noout $(HOME)/VirtualBox\ VMs/*/*.vbox
900
901 OTHER_CLEAN += $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP)
902
903
904 #
905 # Generate some event stuff for VBoxSVC and VBoxC.
906 #
907
908 # Events
909 $(call KB_FN_AUTO_CMD_DEPS,$(VBOX_AUTOGEN_EVENT_H).ts)
910 $(VBOX_AUTOGEN_EVENT_H).ts +| $(VBOX_AUTOGEN_EVENT_H): $(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
911 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
912 $(call MSG_TOOL,xsltproc,autogen events,$<,$@)
913 $(QUIET)$(VBOX_XSLTPROC) --stringparam G_kind VBoxEventHeader -o "$@" "$(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl" "$(VBOX_XIDL_FILE)"
914 $(QUIET)$(CP) --changed -fv -- "$@" "$(VBOX_AUTOGEN_EVENT_H)"
915
916 $(call KB_FN_AUTO_CMD_DEPS,$(VBOX_AUTOGEN_EVENT_CPP).ts)
917 $(VBOX_AUTOGEN_EVENT_CPP).ts +| $(VBOX_AUTOGEN_EVENT_CPP): $(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
918 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
919 $(call MSG_TOOL,xsltproc,autogen events,$<,$@)
920 $(QUIET)$(VBOX_XSLTPROC) --stringparam G_kind VBoxEvent -o "$@" "$(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl" "$(VBOX_XIDL_FILE)"
921 $(QUIET)$(CP) --changed -fv -- "$@" "$(VBOX_AUTOGEN_EVENT_CPP)"
922
923 OTHER_CLEAN += $(VBOX_AUTOGEN_EVENT_H).ts $(VBOX_AUTOGEN_EVENT_H) $(VBOX_AUTOGEN_EVENT_CPP).ts $(VBOX_AUTOGEN_EVENT_CPP)
924
925 # Enum stringifiers
926 $(call KB_FN_AUTO_CMD_DEPS,$(VBOX_AUTOGEN_STRINGIFY_ENUMS_H).ts)
927 $(VBOX_AUTOGEN_STRINGIFY_ENUMS_H).ts +| $(VBOX_AUTOGEN_STRINGIFY_ENUMS_H): $(VBOX_PATH_MAIN_SRC)/idl/stringify-enums.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
928 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
929 $(call MSG_TOOL,xsltproc,autogen enum stringifiers,$<,$@)
930 $(QUIET)$(VBOX_XSLTPROC) --stringparam G_kind header -o "$@" "$(VBOX_PATH_MAIN_SRC)/idl/stringify-enums.xsl" "$(VBOX_XIDL_FILE)"
931 $(QUIET)$(CP) --changed -fv -- "$@" "$(VBOX_AUTOGEN_STRINGIFY_ENUMS_H)"
932
933 $(call KB_FN_AUTO_CMD_DEPS,$(VBOX_AUTOGEN_STRINGIFY_ENUMS_CPP).ts)
934 $(VBOX_AUTOGEN_STRINGIFY_ENUMS_CPP).ts +| $(VBOX_AUTOGEN_STRINGIFY_ENUMS_CPP): $(VBOX_PATH_MAIN_SRC)/idl/stringify-enums.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
935 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
936 $(call MSG_TOOL,xsltproc,autogen enum stringifiers,$<,$@)
937 $(QUIET)$(VBOX_XSLTPROC) --stringparam G_kind source -o "$@" "$(VBOX_PATH_MAIN_SRC)/idl/stringify-enums.xsl" "$(VBOX_XIDL_FILE)"
938 $(QUIET)$(CP) --changed -fv -- "$@" "$(VBOX_AUTOGEN_STRINGIFY_ENUMS_CPP)"
939
940 OTHER_CLEAN += $(VBOX_AUTOGEN_STRINGIFY_ENUMS_H).ts $(VBOX_AUTOGEN_STRINGIFY_ENUMS_H) $(VBOX_AUTOGEN_STRINGIFY_ENUMS_CPP).ts $(VBOX_AUTOGEN_STRINGIFY_ENUMS_CPP)
941
942 ifdef VBOX_WITH_XPCOM
943 #
944 # VBoxSVCM - VBoxSVC wrapper module
945 #
946 DLLS += VBoxSVCM
947 VBoxSVCM_TEMPLATE = VBoxMainComp
948 VBoxSVCM_DEFS = IN_RING3 $(VBOX_MAIN_DEFS)
949 ifdef VBOX_WITH_HARDENING
950 VBoxSVCM_DEFS += VBOX_WITH_HARDENING
951 endif
952 VBoxSVCM_INCS = \
953 include \
954 $(VBoxC_0_OUTDIR) \
955 .
956 VBoxSVCM_INTERMEDIATES = $(VBOX_MAIN_PREREQS)
957 VBoxSVCM_SOURCES = \
958 src-server/xpcom/server_module.cpp
959 VBoxSVCM_LDFLAGS.darwin = \
960 -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxSVCM.dylib \
961 -exported_symbols_list $(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def
962 ifeq ($(KBUILD_TARGET),darwin)
963 VBoxSVCM_ORDERDEPS += $(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def
964 VBoxSVCM_CLEAN += $(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def
965 $$(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def:
966 $(RM) -f $@
967 $(APPEND) $@ _NSGetModule
968 endif
969 VBoxSVCM_INTERMEDIATES += $(VBOX_IDL_HEADER.XPCOM)
970
971 # 32-bit version of the module.
972 ifdef VBOX_WITH_32_ON_64_MAIN_API
973 DLLS += VBoxSVCM-x86
974 VBoxSVCM-x86_TEMPLATE = VBoxMainComp-x86
975 VBoxSVCM-x86_EXTENDS = VBoxSVCM
976 endif
977
978 endif # VBOX_WITH_XPCOM
979
980
981 #
982 # VBoxC module
983 #
984 DLLS += VBoxC
985 VBoxC_TEMPLATE = VBoxMainComp
986 if defined(VBOX_WITH_PRECOMPILED_HEADERS) && "$(KBUILD_TARGET)" == "win"
987 VBoxC_USES = vccprecomp
988 VBoxC_PCH_HDR := $(PATH_SUB_CURRENT)/src-client/win/precomp_vcc.h
989 else if $(KBUILD_KMK_REVISION) >= 3256 && "$(KBUILD_TARGET)" != "darwin" && !defined(VBOX_WITHOUT_PRECOMPILED_HEADERS)
990 if $(VBOX_GCC_VERSION_CXX) >= 50000 # GCC 4.x runs into trouble compiling the header.
991 VBoxC_USES += gccprecomp
992 VBoxC_PCH_HDR := $(PATH_SUB_CURRENT)/src-client/xpcom/precomp_gcc.h
993 endif
994 endif
995 VBoxC_DEFS = \
996 IN_RING3 \
997 $(VBOX_MAIN_DEFS) \
998 VBOX_COM_INPROC \
999 $(if $(VBOX_WITH_EFI),VBOX_WITH_EFI,) \
1000 $(if $(VBOX_WITH_HGSMI),VBOX_WITH_HGSMI,) \
1001 $(if $(VBOX_WITH_VIDEOHWACCEL),VBOX_WITH_VIDEOHWACCEL,) \
1002 $(if $(VBOX_WITH_DRAG_AND_DROP),VBOX_WITH_DRAG_AND_DROP,) \
1003 $(if $(VBOX_WITH_DRAG_AND_DROP_GH),VBOX_WITH_DRAG_AND_DROP_GH,) \
1004 $(if $(VBOX_WITH_USB),VBOX_WITH_USB,) \
1005 $(if $(VBOX_WITH_VRDEAUTH_IN_VBOXSVC),VBOX_WITH_VRDEAUTH_IN_VBOXSVC,) \
1006 $(if $(VBOX_WITH_IOMMU_AMD),VBOX_WITH_IOMMU_AMD,) \
1007 $(if $(VBOX_WITH_IOMMU_INTEL),VBOX_WITH_IOMMU_INTEL,) \
1008 $(if $(VBOX_WITH_TPM),VBOX_WITH_TPM,) \
1009 $(if $(VBOX_WITH_FULL_VM_ENCRYPTION),VBOX_WITH_FULL_VM_ENCRYPTION,)
1010 ifdef VBOX_WITH_NETSHAPER
1011 VBoxC_DEFS += VBOX_WITH_NETSHAPER
1012 endif
1013 VBoxC_DEFS.darwin.x86 = VBOX_WITH_2X_4GB_ADDR_SPACE
1014 VBoxC_DEFS.win.x86 += _WIN32_WINNT=0x0500
1015 VBoxC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
1016
1017 if $(KBUILD_TARGET) != "win" && $(VBOX_GCC_VERSION_CXX) >= 40900 # gcc 4.9.x (4.8.x is causing endless RT_ELEMENT trouble)
1018 # VBoxC_CXXFLAGS = -Wunused -Wconversion
1019 endif
1020
1021 VBoxC_SDKS = VBoxLibPng VBoxZlib
1022
1023 ifdef VBOX_WITH_RECORDING
1024 ifdef VBOX_WITH_LIBVPX
1025 VBoxC_SDKS += VBoxLibVpx
1026 VBoxC_DEFS += VBOX_WITH_LIBVPX
1027 endif
1028 VBoxC_SOURCES += \
1029 src-client/EBMLWriter.cpp \
1030 src-client/WebMWriter.cpp \
1031 src-client/Recording.cpp \
1032 src-client/RecordingInternals.cpp \
1033 src-client/RecordingCodec.cpp \
1034 src-client/RecordingStream.cpp \
1035 src-client/RecordingUtils.cpp
1036
1037 ifdef VBOX_WITH_AUDIO_RECORDING
1038 VBoxC_DEFS += VBOX_WITH_AUDIO_RECORDING
1039 # Needed in VBoxSVC for ISystemProperties.
1040 src-server/SystemPropertiesImpl.cpp_DEFS += VBOX_WITH_AUDIO_RECORDING
1041 ifdef VBOX_WITH_LIBOGG
1042 VBOX_MAIN_DEFS += VBOX_WITH_LIBOGG
1043 VBoxC_SDKS += VBoxLibOgg
1044 VBoxC_DEFS += VBOX_WITH_LIBOGG
1045 ## @todo We need this for libvorbis down below. Remove once the libvorbis @todo is resolved.
1046 VBoxSVC_SDKS += VBoxLibOgg
1047 endif
1048 ifdef VBOX_WITH_LIBVORBIS
1049 VBOX_MAIN_DEFS += VBOX_WITH_LIBVORBIS
1050 VBoxC_SDKS += VBoxLibVorbis
1051 ## @todo We also need to specify this for VBoxSVC, as we need to have VBOX_WITH_LIBVORBIS defined
1052 ## for SystemProperties::getSupportedRecordingAudioCodecs().
1053 # SystemPropertiesImpl_DEFS += VBOX_WITH_LIBVORBIS didn't work for precompiled headers on Windows --
1054 # needs to be solved properly so that we can remove the following _SDKS from VBoxSVC again.
1055 VBoxSVC_SDKS += VBoxLibVorbis
1056 endif
1057 VBoxC_SOURCES += src-client/DrvAudioRec.cpp
1058 endif # VBOX_WITH_AUDIO_RECORDING
1059 endif # VBOX_WITH_RECORDING
1060
1061 ifdef VBOX_WITH_OPENSSL_FIPS
1062 VBoxC_SDKS += VBoxOpenSsl
1063 endif
1064
1065 VBoxC_INCS = \
1066 include \
1067 $(VBoxC_0_OUTDIR) \
1068 $(VBOX_MAIN_APIWRAPPER_INCS) \
1069 $(dir $(VBOX_XML_SCHEMADEFS_H)) \
1070 $(VBOX_MAIN_APIWRAPPER_DIR)/dtrace \
1071 $(VBOX_GRAPHICS_INCS)
1072 VBoxC_INCS.win = \
1073 $(VBoxCOM_0_OUTDIR) \
1074 .
1075
1076 VBoxC_LDFLAGS.darwin = \
1077 -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxC.dylib \
1078 -exported_symbols_list $(VBoxC_0_OUTDIR)/VBoxC.def \
1079 -framework IOKit
1080 VBoxC_LDFLAGS.win += /MANIFEST \
1081 /DELAYLOAD:user32.dll
1082
1083
1084 VBoxC_LIBS += \
1085 $(PATH_STAGE_LIB)/VBoxAPIWrap$(VBOX_SUFF_LIB)
1086 VBoxC_LIBS.win += \
1087 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/psapi.lib \
1088 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib
1089 ifdef VBOX_WITH_NETFLT
1090 VBoxC_SDKS.win += VBoxWinNewDevLib
1091 VBoxC_LIBS.win += \
1092 $(PATH_STAGE_LIB)/WinNetConfigDll$(VBOX_SUFF_LIB) \
1093 $(PATH_STAGE_LIB)/VBoxDrvCfgDll$(VBOX_SUFF_LIB) \
1094 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
1095 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
1096 VBoxC_LDFLAGS.win += \
1097 /DELAYLOAD:newdev.dll \
1098 /DELAYLOAD:setupapi.dll \
1099 /DELAYLOAD:iphlpapi.dll
1100 endif
1101
1102 ifdef VBOX_WITH_DRAG_AND_DROP
1103 VBoxC_LIBS += $(PATH_STAGE_LIB)/VBoxDnDHostR3Lib$(VBOX_SUFF_LIB)
1104 endif
1105
1106 VBoxC_INTERMEDIATES = \
1107 $(VBOX_MAIN_PREREQS) \
1108 $(VBOX_XML_SCHEMADEFS_H) \
1109 $(VBOX_AUTOGEN_EVENT_H) \
1110 $(VBOX_AUTOGEN_STRINGIFY_ENUMS_H) \
1111 $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
1112
1113 VBoxC_SOURCES += \
1114 $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d \
1115 src-all/CryptoUtils.cpp \
1116 src-all/ConsoleSharedFolderImpl.cpp \
1117 src-all/DisplayPNGUtil.cpp \
1118 src-all/DisplayResampleImage.cpp \
1119 src-all/EventImpl.cpp \
1120 src-all/Global.cpp \
1121 src-all/GlobalStatusConversion.cpp \
1122 src-all/HashedPw.cpp \
1123 src-all/Logging.cpp \
1124 src-all/NvramStoreImpl.cpp \
1125 src-all/PCIDeviceAttachmentImpl.cpp \
1126 src-all/ProgressImpl.cpp \
1127 src-all/SecretKeyStore.cpp \
1128 src-all/AutoCaller.cpp \
1129 src-all/ThreadTask.cpp \
1130 src-all/VirtualBoxBase.cpp \
1131 src-all/VirtualBoxErrorInfoImpl.cpp \
1132 $(if $(VBOX_WITH_EXTPACK),src-all/ExtPackManagerImpl.cpp src-all/ExtPackUtil.cpp,) \
1133 src-client/UsbWebcamInterface.cpp \
1134 $(if $(VBOX_WITH_USB_CARDREADER),src-client/UsbCardReader.cpp,) \
1135 src-client/AdditionsFacilityImpl.cpp \
1136 src-client/BusAssignmentManager.cpp \
1137 $(if $(VBOX_WITH_PCI_PASSTHROUGH),src-client/PCIRawDevImpl.cpp,) \
1138 src-client/ClientTokenHolder.cpp \
1139 src-client/ConsoleImpl.cpp \
1140 src-client/ConsoleImpl2.cpp \
1141 src-client/ConsoleImplTeleporter.cpp \
1142 src-client/ConsoleVRDPServer.cpp \
1143 src-client/DisplayImpl.cpp \
1144 src-client/DisplayImplLegacy.cpp \
1145 src-client/DisplaySourceBitmapImpl.cpp \
1146 src-client/EmulatedUSBImpl.cpp \
1147 src-client/GuestImpl.cpp \
1148 src-client/GuestCtrlImpl.cpp \
1149 src-client/KeyboardImpl.cpp \
1150 src-client/MachineDebuggerImpl.cpp \
1151 src-client/MouseImpl.cpp \
1152 src-client/RemoteUSBDeviceImpl.cpp \
1153 src-client/SessionImpl.cpp \
1154 src-client/USBDeviceImpl.cpp \
1155 src-client/VBoxDriversRegister.cpp \
1156 src-client/VirtualBoxClientImpl.cpp \
1157 src-client/VMMDevInterface.cpp \
1158 xml/Settings.cpp \
1159 $(VBOX_AUTOGEN_EVENT_CPP) \
1160 $(VBOX_AUTOGEN_STRINGIFY_ENUMS_CPP) \
1161 $(VBOX_XML_SCHEMADEFS_CPP)
1162
1163 ifdef VBOX_WITH_MAIN_NLS
1164 VBoxC_SOURCES += \
1165 src-all/VirtualBoxTranslator.cpp \
1166 src-all/QMTranslatorImpl.cpp
1167 endif
1168
1169 # Experimental cloud support
1170 if defined(VBOX_WITH_CLOUD_NET)
1171 if defined(VBOX_WITH_LIBSSH)
1172 VBoxC_SDKS += VBoxLibSsh VBoxOpenSsl
1173 VBoxC_DEFS += VBOX_WITH_LIBSSH
1174 endif
1175 VBoxC_SOURCES += src-client/CloudGateway.cpp
1176
1177 VBoxC_SOURCES += \
1178 $(VBoxC_0_OUTDIR)/VBoxLibSshLazyLoad.asm
1179 VBoxC_CLEAN += $(VBoxC_0_OUTDIR)/VBoxLibSshLazyLoad.asm
1180 $$(VBoxC_0_OUTDIR)/VBoxLibSshLazyLoad.asm: $(PATH_SUB_CURRENT)/src-all/VBoxLibSsh.def $(VBOX_DEF_2_LAZY_LOAD) | $$(dir $$@)
1181 $(call MSG_TOOL,VBoxDef2LazyLoad,VBoxC,$(filter %.def, $^),$@)
1182 $(QUIET)$(RM) -f -- "$@"
1183 $(VBOX_DEF_2_LAZY_LOAD) --explicit-load-function --library VBoxLibSsh --output "$@" $(filter %.def, $^)
1184
1185 endif
1186
1187 # Audio bits.
1188 VBoxC_SOURCES += \
1189 src-client/AudioDriver.cpp \
1190 $(if $(VBOX_WITH_AUDIO_VRDE),src-client/DrvAudioVRDE.cpp,)
1191
1192 VBoxC_SOURCES.win = \
1193 src-client/win/dllmain.cpp \
1194 src-client/win/VBoxC.def \
1195 src-client/win/VBoxC.rc
1196 ifdef VBOX_WITH_GUEST_CONTROL
1197 VBoxC_SOURCES += \
1198 src-client/GuestSessionImplTasks.cpp \
1199 src-client/GuestCtrlPrivate.cpp \
1200 src-client/GuestDirectoryImpl.cpp \
1201 src-client/GuestFileImpl.cpp \
1202 src-client/GuestFsObjInfoImpl.cpp \
1203 src-client/GuestProcessImpl.cpp \
1204 src-client/GuestSessionImpl.cpp
1205 endif
1206 ifdef VBOX_WITH_DRAG_AND_DROP
1207 VBoxC_SOURCES += \
1208 src-client/GuestDnDPrivate.cpp \
1209 src-client/GuestDnDSourceImpl.cpp \
1210 src-client/GuestDnDTargetImpl.cpp \
1211 $(PATH_ROOT)/src/VBox/GuestHost/DragAndDrop/DnDUtils.cpp
1212 endif
1213 ifdef VBOX_WITH_XPCOM
1214 VBoxC_SOURCES += \
1215 src-client/xpcom/module.cpp
1216 endif
1217 ifdef VBOX_WITH_HGCM
1218 VBoxC_SOURCES += \
1219 src-client/HGCMObjects.cpp \
1220 src-client/HGCMThread.cpp \
1221 src-client/HGCM.cpp
1222 endif
1223 ifdef VBOX_WITH_USB
1224 VBoxC_SOURCES += \
1225 src-client/RemoteUSBBackend.cpp
1226 endif
1227 ifndef VBOX_WITH_VRDEAUTH_IN_VBOXSVC
1228 VBoxC_SOURCES += \
1229 src-all/AuthLibrary.cpp
1230 endif
1231
1232 $(call KB_FN_DO_PASS0_ON_TARGET,VBoxC) # Sets VBoxC_0_OUTDIR
1233
1234 ifeq ($(KBUILD_TARGET),darwin)
1235 VBoxC_ORDERDEPS += $(VBoxC_0_OUTDIR)/VBoxC.def
1236 VBoxC_CLEAN += $(VBoxC_0_OUTDIR)/VBoxC.def
1237 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxC_0_OUTDIR)/VBoxC.def)
1238 $(VBoxC_0_OUTDIR)/VBoxC.def:
1239 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1240 $(RM) -f $@
1241 $(APPEND) $@ _NSGetModule
1242 $(APPEND) $@ _VBoxDriversRegister
1243 endif
1244
1245 src-client/ConsoleImpl.cpp_DEFS = \
1246 $(if $(VBOX_WITH_OPENSSL_FIPS), VBOX_OPENSSL_FIPS,)
1247
1248
1249 src-client/win/VBoxC.rc_DEPS = $(VBoxC_0_OUTDIR)/VBoxC.rgs $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb
1250 VBoxC_CLEAN.win += $(VBoxC_0_OUTDIR)/VBoxC.rgs
1251 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxC_0_OUTDIR)/VBoxC.rgs)
1252 $(VBoxC_0_OUTDIR)/VBoxC.rgs: $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
1253 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1254 $(VBOX_XSLTPROC) \
1255 --stringparam Application VirtualBox \
1256 --stringparam Module VBoxC \
1257 -o $@ \
1258 $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl \
1259 $(VBOX_XIDL_FILE)
1260
1261 ifdef VBOX_WITH_32_ON_64_MAIN_API
1262 #
1263 # 32-bit VBox API Client In-Process module.
1264 #
1265 # This is currently just a 32-bit version of VBoxC. It might be desirable to
1266 # split up VBoxC into a simple client and a VM client part later, in which
1267 # case this module will be a simple client.
1268 #
1269 # Note! One important thing is that the typelib for this DLL must be build
1270 # with the /env win32 switch and the VBoxC typelib with /env amd64, if
1271 # not they will overwrite each others typelib module entry.
1272 #
1273 DLLS += VBoxClient-x86
1274 VBoxClient-x86_TEMPLATE = VBoxMainComp-x86
1275 VBoxClient-x86_EXTENDS = VBoxC
1276 if defined(VBOX_WITH_PRECOMPILED_HEADERS) && "$(KBUILD_TARGET)" == "win" ## @todo fix inheritance (fixed in r3253)
1277 VBoxClient-x86_USES = vccprecomp
1278 VBoxClient-x86_PCH_HDR := $(PATH_SUB_CURRENT)/src-client/win/precomp_vcc.h
1279 endif
1280 VBoxClient-x86_SDKS = $(filter-out VBoxLibVpx,$(VBoxC_SDKS))
1281 VBoxClient-x86_DEFS = VBOX_COM_INPROC_API_CLIENT \
1282 $(filter-out VBOX_WITH_RECORDING VBOX_WITH_AUDIO_RECORDING \
1283 VBOX_WITH_LIBVPX,$(VBoxC_DEFS))
1284 VBoxClient-x86_INCS.win = \
1285 $(VBoxClient-x86_0_OUTDIR) \
1286 $(VBoxCOM-x86_0_OUTDIR) \
1287 $(VBoxC_INCS.win)
1288 VBoxClient-x86_SOURCES = \
1289 src-all/EventImpl.cpp \
1290 src-all/Global.cpp \
1291 src-all/GlobalStatusConversion.cpp \
1292 src-all/AutoCaller.cpp \
1293 src-all/ThreadTask.cpp \
1294 src-all/VirtualBoxBase.cpp \
1295 src-all/VirtualBoxErrorInfoImpl.cpp \
1296 src-client/ClientTokenHolder.cpp \
1297 src-client/SessionImpl.cpp \
1298 src-client/VirtualBoxClientImpl.cpp \
1299 $(VBOX_AUTOGEN_EVENT_CPP) \
1300 $(VBOX_AUTOGEN_STRINGIFY_ENUMS_CPP) \
1301 $(VBOX_XML_SCHEMADEFS_CPP)
1302 ifdef VBOX_WITH_MAIN_NLS
1303 VBoxClient-x86_SOURCES += \
1304 src-all/VirtualBoxTranslator.cpp \
1305 src-all/QMTranslatorImpl.cpp
1306 endif
1307 VBoxClient-x86_SOURCES.win = \
1308 src-client/win/dllmain.cpp \
1309 src-client/win/VBoxClient-x86.def \
1310 src-client/win/VBoxClient-x86.rc
1311 ifdef VBOX_WITH_XPCOM
1312 VBoxClient-x86_SOURCES += \
1313 src-client/xpcom/module.cpp
1314 endif
1315 VBoxClient-x86_LIBS = \
1316 $(PATH_STAGE_LIB)/VBoxAPIWrap-x86$(VBOX_SUFF_LIB)
1317 VBoxClient-x86_LIBS.win = $(NO_SUCH_VARIABLE)
1318 VBoxClient-x86_LIBS.win.x86 += \
1319 $(PATH_TOOL_$(VBOX_VCC_TOOL_STEM)X86_LIB)/delayimp.lib \
1320 $(PATH_SDK_$(VBOX_WINPSDK)_LIB.x86)/WbemUuid.Lib
1321 VBoxClient-x86_CLEAN.win += $(VBoxClient-x86_0_OUTDIR)/VBoxClient-x86.rgs
1322 $(call KB_FN_DO_PASS0_ON_TARGET,VBoxClient-x86) # Sets VBoxClient-x86_0_OUTDIR
1323
1324 src-client/win/VBoxClient-x86.rc_DEPS = \
1325 $(VBoxClient-x86_0_OUTDIR)/VBoxClient-x86.rgs \
1326 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox-x86.tlb
1327
1328 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxClient-x86_0_OUTDIR)/VBoxClient-x86.rgs)
1329 $(VBoxClient-x86_0_OUTDIR)/VBoxClient-x86.rgs: \
1330 $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl \
1331 $(VBOX_XIDL_FILE) | $$(dir $$@)
1332 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1333 $(VBOX_XSLTPROC) \
1334 --stringparam Application VirtualBox \
1335 --stringparam Module VBoxC \
1336 -o $@ \
1337 $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl \
1338 $(VBOX_XIDL_FILE)
1339 endif
1340
1341 #
1342 # The VBoxExtPackHelperApp.
1343 #
1344 ifdef VBOX_WITH_EXTPACK
1345 PROGRAMS += VBoxExtPackHelperApp
1346 VBoxExtPackHelperApp_TEMPLATE = VBoxR3SetUidToRoot
1347 VBoxExtPackHelperApp_LDFLAGS.darwin = -framework Security
1348 VBoxExtPackHelperApp_LDFLAGS.win = /SUBSYSTEM:windows
1349 VBoxExtPackHelperApp_SOURCES = \
1350 src-helper-apps/VBoxExtPackHelperApp.cpp \
1351 src-all/ExtPackUtil.cpp
1352 VBoxExtPackHelperApp_SOURCES.win = \
1353 src-helper-apps/VBoxExtPackHelperApp.rc
1354 VBoxExtPackHelperApp_LIBS = \
1355 $(LIB_RUNTIME)
1356 endif # VBOX_WITH_EXTPACK
1357
1358 #
1359 # VolInfo
1360 #
1361 ifdef VBOX_WITH_DEVMAPPER
1362 PROGRAMS.linux += VBoxVolInfo
1363 VBoxVolInfo_TEMPLATE = VBoxR3SetUidToRoot
1364 VBoxVolInfo_SOURCES = src-helper-apps/VBoxVolInfo.cpp
1365 VBoxVolInfo_LIBS = devmapper
1366 endif
1367
1368
1369endif # !defined(VBOX_ONLY_SDK) && !defined(VBOX_ONLY_EXTPACKS) (the ifndef is far above)
1370ifndef VBOX_ONLY_SDK
1371
1372
1373 #
1374 # VBoxCOM - COM Abstraction Layer library
1375 #
1376 LIBRARIES += VBoxCOM
1377 VBoxCOM_TEMPLATE = VBoxMainLib
1378 VBoxCOM_INTERMEDIATES = $(VBOX_MAIN_PREREQS) \
1379 $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
1380 VBoxCOM_SOURCES = \
1381 glue/com.cpp \
1382 glue/VBoxLogRelCreate.cpp \
1383 glue/GetVBoxUserHomeDirectory.cpp \
1384 glue/initterm.cpp \
1385 glue/string.cpp \
1386 glue/string-base64.cpp \
1387 glue/AutoLock.cpp \
1388 glue/EventQueue.cpp \
1389 glue/NativeEventQueue.cpp \
1390 glue/ErrorInfo.cpp \
1391 glue/errorprint.cpp
1392 VBoxCOM_INCS += $(VBOX_MAIN_APIWRAPPER_INCS) \
1393 include
1394 ifeq ($(KBUILD_TARGET),win)
1395 ifdef VBOX_WITH_MIDL_PROXY_STUB
1396 VBoxCOM_DEFS.win = VBOX_WITH_AUTO_COM_REG_UPDATE
1397 endif
1398 ifdef VBOX_WITH_SDS
1399 VBoxCOM_DEFS.win += VBOX_WITH_SDS
1400 endif
1401 VBoxCOM_DEFS.x86 = _WIN32_WINNT=0x0500
1402 VBoxCOM_DEFS.amd64 = _WIN32_WINNT=0x0510
1403 VBoxCOM_SOURCES += \
1404 $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c
1405 VBoxCOM_CLEAN = \
1406 $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
1407 $(VBoxCOM_0_OUTDIR)/VirtualBox_p.c \
1408 $(VBoxCOM_0_OUTDIR)/dlldata.c \
1409 $(VBoxCOM_0_OUTDIR)/VirtualBox.h \
1410 $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb
1411 VBoxCOM_CLEAN += \
1412 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_i.c \
1413 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_p.c \
1414 $(VBoxCOM_0_OUTDIR)/legacy/dlldata.c \
1415 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.h \
1416 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.tlb
1417 VBoxCOM_BLDDIRS = $(VBoxCOM_0_OUTDIR)/legacy/
1418 else # !win
1419 VBoxCOM_SOURCES += \
1420 $(VBoxCOM_0_OUTDIR)/VirtualBox_XPCOM_i.c \
1421 glue/xpcom/helpers.cpp
1422 endif # !win
1423
1424 ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
1425 glue/VBoxLogRelCreate.cpp_DEFS = KBUILD_TYPE="$(KBUILD_TYPE)"
1426 else
1427 glue/VBoxLogRelCreate.cpp_DEFS = KBUILD_TYPE=\"$(KBUILD_TYPE)\"
1428 endif
1429
1430 # 32-bit version of VBoxCOM.
1431 if defined(VBOX_WITH_32_ON_64_MAIN_API) && !defined(VBOX_ONLY_EXTPACKS)
1432 LIBRARIES += VBoxCOM-x86
1433 VBoxCOM-x86_TEMPLATE = VBoxMainLib-x86
1434 VBoxCOM-x86_EXTENDS = VBoxCOM
1435 ifeq ($(KBUILD_TARGET),win)
1436 VBoxCOM-x86_CLEAN = \
1437 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c \
1438 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_p.c \
1439 $(VBoxCOM-x86_0_OUTDIR)/dlldata.c \
1440 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox.h \
1441 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox-x86.tlb
1442 endif
1443 endif
1444
1445 # -MD version for the GUI in -MDd builds.
1446 ifeq ($(KBUILD_TARGET).$(VBOX_VCC_CRT_TYPE),win.d)
1447 ifndef VBOX_ONLY_EXTPACKS
1448 LIBRARIES += VBoxCOM-GUI
1449 USES += qt5
1450 VBoxCOM-GUI_TEMPLATE = $(if-expr defined(VBOX_WITH_HARDENING),VBoxQtGuiDll,VBoxQtGuiExe)
1451 VBoxCOM-GUI_EXTENDS = VBoxCOM
1452 endif
1453 endif
1454
1455 # define qt5 tools for translation even if VBOX_ONLY_EXTPACKS is enabled
1456 ifdef VBOX_WITH_NLS
1457 USES += qt5
1458 endif
1459
1460
1461endif # !VBOX_ONLY_SDK
1462
1463
1464#
1465# Installs com related thing(s) to bin.
1466#
1467INSTALLS.win += VBoxMain-com-inst
1468VBoxMain-com-inst_INST = $(INST_BIN)
1469VBoxMain-com-inst_MODE = a+r,u+w
1470VBoxMain-com-inst_SOURCES = src-all/win/comregister.cmd
1471
1472
1473if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "linux" && !defined(VBOX_ONLY_EXTPACKS)
1474 #
1475 # Installs linux/hardening related things to components.
1476 #
1477 INSTALLS.linux += VBoxMain-hardening-inst
1478 VBoxMain-hardening-inst_INST = $(INST_BIN)components/
1479 VBoxMain-hardening-inst_SYMLINKS = \
1480 VBoxDDU.so=>../VBoxDDU.so \
1481 VBoxRT.so=>../VBoxRT.so \
1482 VBoxVMM.so=>../VBoxVMM.so \
1483 VBoxXPCOM.so=>../VBoxXPCOM.so
1484endif
1485
1486
1487if defined(VBOX_WITH_MIDL_PROXY_STUB) && "$(KBUILD_TARGET)" == "win" && !defined(VBOX_ONLY_EXTPACKS)
1488 #
1489 # Experimental COM proxy + stub DLL w/ automatic registration updating.
1490 #
1491 # The Legacy stub is for older 64-bit windows versions (pre Windows 7) as we
1492 # were having various problems on windows server 2003 and 2008 with the code
1493 # MIDL generated. Also, in windows 7 there are some potentially interesting
1494 # changes in the generated code where it uses new helpers from OLE32.
1495 #
1496 DLLS += VBoxProxyStub
1497 VBoxProxyStub_TEMPLATE = VBoxMainComp
1498 ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
1499 VBoxProxyStub_DEFS := REGISTER_PROXY_DLL PROXY_CLSID_IS=$(quote $(VBOX_MIDL_PROXY_CLSID_IS))
1500 else
1501 VBoxProxyStub_DEFS := REGISTER_PROXY_DLL PROXY_CLSID_IS="$(VBOX_MIDL_PROXY_CLSID_IS)"
1502 endif
1503 ifdef VBOX_WITH_SDS
1504 VBoxProxyStub_DEFS += VBOX_WITH_SDS
1505 endif
1506 ifdef VBOX_WITH_SDS_CLIENT_WATCHER
1507 VBoxProxyStub_DEFS += VBOX_WITH_SDS_CLIENT_WATCHER,)
1508 endif
1509 VBoxProxyStub_DEFS.win.x86 = WIN32
1510 VBoxProxyStub_SDKS = VBoxNtDll
1511 VBoxProxyStub_DEFPATH = $(VBoxCOM_0_OUTDIR)/# Hack to workaround drive letter in $(VBoxCOM_0_OUTDIR)/ for CFLAGS hack below.
1512 VBoxProxyStub_INCS = $(VBoxCOM_0_OUTDIR)/
1513 VBoxProxyStub_SOURCES := \
1514 VirtualBox_p.c \
1515 VirtualBox_i.c \
1516 $(PATH_SUB_CURRENT)/src-all/win/VBoxProxyStub.def \
1517 $(PATH_SUB_CURRENT)/src-all/win/VBoxProxyStub.rc \
1518 $(PATH_SUB_CURRENT)/src-all/win/VBoxProxyStub.c
1519 src-all/win/VBoxProxyStub.rc_DEPS = $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb
1520 VBoxProxyStub_VirtualBox_p.c_CFLAGS.x86 = /Gz # Workaround for incorrect ObjectStublessClient* prototypes in SDK v7.1.
1521
1522 DLLS += VBoxProxyStubLegacy
1523 VBoxProxyStubLegacy_TEMPLATE = VBoxMainComp
1524 VBoxProxyStubLegacy_EXTENDS = VBoxProxyStub
1525 VBoxProxyStubLegacy_DEFS = $(VBoxProxyStub_DEFS) VBOX_IN_PROXY_STUB_LEGACY
1526 VBoxProxyStubLegacy_INCS = $(VBoxCOM_0_OUTDIR)/legacy/
1527 VBoxProxyStubLegacy_SOURCES = \
1528 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_p.c \
1529 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_i.c \
1530 src-all/win/VBoxProxyStub.def \
1531 src-all/win/VBoxProxyStubLegacy.rc \
1532 src-all/win/VBoxProxyStub.c
1533 src-all/win/VBoxProxyStubLegacy.rc_DEPS = $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.tlb
1534
1535 ifdef VBOX_WITH_32_ON_64_MAIN_API
1536 DLLS += VBoxProxyStub-x86
1537 VBoxProxyStub-x86_TEMPLATE = VBoxMainComp-x86
1538 VBoxProxyStub-x86_SDKS = VBoxNtDll
1539 VBoxProxyStub-x86_DEFS = $(VBoxProxyStub_DEFS) VBOX_PROXY_STUB_32_ON_64 WIN32
1540 VBoxProxyStub-x86_INCS = $(VBoxCOM-x86_0_OUTDIR)/
1541 VBoxProxyStub-x86_SOURCES = \
1542 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_p.c \
1543 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c \
1544 src-all/win/VBoxProxyStub.c \
1545 src-all/win/VBoxProxyStub-x86.rc \
1546 src-all/win/VBoxProxyStub.def
1547 src-all/win/VBoxProxyStub-x86.rc_DEPS = $(VBoxCOM-x86_0_OUTDIR)/VirtualBox-x86.tlb
1548 endif
1549endif
1550
1551
1552ifdef VBOX_WITH_MAIN_NLS
1553 #
1554 # NLS stuff.
1555 #
1556 include $(PATH_SUB_CURRENT)/nls/ApprovedLanguages.kmk
1557
1558 PROGRAMS += VirtualBoxAPI
1559 VirtualBoxAPI_TEMPLATE = VBoxNLS
1560 VirtualBoxAPI_QT_TRANSLATIONS = $(addsuffix .ts,$(addprefix $(VBOX_PATH_MAIN_SRC)/nls/VirtualBoxAPI_,$(VBOX_APPROVED_MAIN_LANGUAGES)))
1561 VirtualBoxAPI_VBOX_ALL_NLS_SOURCES = $(wildcard \
1562 $(VBOX_PATH_MAIN_SRC)/include/*.h \
1563 $(VBOX_PATH_MAIN_SRC)/src-all/*.cpp \
1564 $(VBOX_PATH_MAIN_SRC)/src-all/*.h \
1565 $(VBOX_PATH_MAIN_SRC)/src-server/*.cpp \
1566 $(VBOX_PATH_MAIN_SRC)/src-server/*.h \
1567 $(VBOX_PATH_MAIN_SRC)/src-client/*.cpp \
1568 $(VBOX_PATH_MAIN_SRC)/src-client/*.h )
1569
1570 updatenls:: makeallnls $(VBOX_PATH_MAIN_SRC)/nls/VirtualBoxAPI_en.ts
1571
1572 makeallnls:: $(VirtualBoxAPI_VBOX_ALL_NLS_SOURCES)
1573 $(call MSG_L1,lupdate all languages (nls/*.ts))
1574 $(QUIET)$(TOOL_QT5_LUPDATE) \
1575 $^ \
1576 -ts \
1577 $(filter-out nls/VirtualBoxAPI_en.ts, $(VirtualBoxAPI_QT_TRANSLATIONS)) \
1578 $(VBOX_PATH_MAIN_SRC)/nls/VirtualBoxAPI_xx_YY.ts
1579
1580 #fake-main-nls:
1581 # $(foreach file, $(VirtualBoxAPI_QT_TRANSLATIONS) \
1582 # ,$(NLTAB)$(SED) -i \
1583 # -e '/<source>.*<\/source>/h' \
1584 # -e '/<source>.*<\/source>/p' \
1585 # -e '/<translation type="unfinished"><\/translation>/{' \
1586 # -e 'x' \
1587 # -e 's/<source>\(.*\)<\/source>/<translation type="unfinished">$(notdir $(file)): \1<\/translation>/' \
1588 # -e '}' \
1589 # $(file) )
1590
1591
1592 # Create the English translation file. This is something special cause it will
1593 # contain the plural forms only.
1594 $(VBOX_PATH_MAIN_SRC)/nls/VirtualBoxAPI_en.ts: $(VirtualBoxAPI_VBOX_ALL_NLS_SOURCES)
1595 $(call MSG_L1,lupdate $@)
1596 $(QUIET)$(TOOL_QT5_LUPDATE) \
1597 $^ \
1598 -ts \
1599 "$@"
1600 $(QUIET)$(SED) -n -i \
1601 -e '/<context>/,/<\/context>/!p' \
1602 -e '/<context>/h' \
1603 -e '/<name>/H' \
1604 -e '/<message numerus="yes">/,/<\/message>/H' \
1605 -e '/<\/context>/{H;x;/<message/p}' \
1606 "$@"
1607
1608endif # VBOX_WITH_MAIN_NLS
1609
1610
1611# generate rules
1612include $(FILE_KBUILD_SUB_FOOTER)
1613
1614
1615
1616#
1617# Additions rules.
1618#
1619
1620## @todo this hack ain't cutting it any longer. (the file name is abspath'ed since ages now.)
1621glue/xpcom/helpers.cpp: $(VBOX_IDL_TYPELIB.XPCOM)
1622
1623$(call KB_FN_AUTO_CMD_DEPS_EX,$(VBOX_IDL_FILE.XPCOM),$(PATH_OUT)/VBOX_IDL_FILE.XPCOM.vbox-dep)
1624$(VBOX_IDL_FILE.XPCOM): $(VBOX_PATH_MAIN_SRC)/idl/xpidl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
1625 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS_EX,$(PATH_OUT)/VBOX_IDL_FILE.XPCOM.vbox-dep)
1626 $(call MSG_TOOL,xsltproc,VBoxSVC,$(VBOX_PATH_MAIN_SRC)/idl/xpidl.xsl,$@)
1627 $(QUIET)$(VBOX_XSLTPROC) -o $@ $(VBOX_PATH_MAIN_SRC)/idl/xpidl.xsl $(VBOX_XIDL_FILE)
1628
1629$(call KB_FN_AUTO_CMD_DEPS_EX,$(VBOX_IDL_TYPELIB.XPCOM),$(PATH_OUT)/VBOX_IDL_TYPELIB.XPCOM.vbox-dep)
1630$(VBOX_IDL_TYPELIB.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
1631 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS_EX,$(PATH_OUT)/VBOX_IDL_TYPELIB.XPCOM.vbox-dep)
1632 $(call MSG_TOOL,xpidl,VBoxSVC,$(VBOX_IDL_FILE.XPCOM),$@)
1633 $(QUIET)$(VBOX_XPIDL_ENV)$(VBOX_XPIDL) -m typelib -I $(VBOX_PATH_XPCOM_IDL) -e $@ $(VBOX_IDL_FILE.XPCOM)
1634 $(CHMOD) 0644 $@
1635## @todo ^^^^^^^^^^^^ fix horrible hack
1636
1637$(call KB_FN_AUTO_CMD_DEPS_EX,$(VBOX_IDL_HEADER.XPCOM),$(PATH_OUT)/VBOX_IDL_HEADER.XPCOM.vbox-dep)
1638$(VBOX_IDL_HEADER.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
1639 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS_EX,$(PATH_OUT)/VBOX_IDL_HEADER.XPCOM.vbox-dep)
1640 $(call MSG_TOOL,xpidl,VBoxSVC,$(VBOX_IDL_FILE.XPCOM),$@)
1641 $(QUIET)$(VBOX_XPIDL_ENV)$(VBOX_XPIDL) -m header -I $(VBOX_PATH_XPCOM_IDL) -e $@ $(VBOX_IDL_FILE.XPCOM)
1642
1643$(call KB_FN_AUTO_CMD_DEPS_EX,$(VBOX_IDL_FILE.MSCOM),$(PATH_OUT)/VBOX_IDL_FILE.MSCOM.vbox-dep)
1644$(VBOX_IDL_FILE.MSCOM): $(VBOX_PATH_MAIN_SRC)/idl/midl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
1645 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS_EX,$(PATH_OUT)/VBOX_IDL_FILE.MSCOM.vbox-dep)
1646 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
1647 $(QUIET)$(VBOX_XSLTPROC) -o $@ \
1648 $(if $(VBOX_WITH_MIDL_PROXY_STUB),-stringparam g_fGenProxy yes,) \
1649 $(if $(VBOX_WITH_SDS),-stringparam g_fVBoxWithSDS yes,) \
1650 $(VBOX_PATH_MAIN_SRC)/idl/midl.xsl $(VBOX_XIDL_FILE)
1651
1652
1653# Aliases for testing purposes.
1654ifdef VBOX_WITH_XPCOM
1655 testidl: $(VBOX_IDL_FILE.XPCOM) $(VBOX_IDL_TYPELIB.XPCOM) $(VBoxCOM_0_OUTDIR)/VirtualBox_XPCOM_i.c
1656 testidlhdr: $(VBOX_IDL_HEADER.XPCOM)
1657else
1658 testidl: $(VBOX_IDL_FILE.MSCOM) $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
1659 $(if $(VBOX_WITH_32_ON_64_MAIN_API),$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c,)
1660endif
1661
1662
1663$(VBoxCOM_0_OUTDIR)/VirtualBox_XPCOM_i.c: $(VBOX_PATH_MAIN_SRC)/idl/xpidl_iid.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
1664 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
1665 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
1666
1667if defined(VBOX_ONLY_SDK) || "$(KBUILD_TARGET)" == "win"
1668
1669 # Note! Because we've got a different proxy stub DLL for pre windows 7 64-bit hosts, we target windows 7 for AMD64.
1670 # The output is different and hopefully more efficient, at least memory wise (using more helpers in OLE32).
1671 # Note! We're checking for win.amd64 below when setting the target because of the SDK build which happens on linux.amd64
1672 # but with a 32-bit Wine.
1673 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxCOM_0_OUTDIR)/VirtualBox_i.c)
1674 $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
1675 $(if $(VBOX_WITH_MIDL_PROXY_STUB), + $(VBoxCOM_0_OUTDIR)/VirtualBox_p.c + $(VBoxCOM_0_OUTDIR)/dlldata.c,) \
1676 + $(VBoxCOM_0_OUTDIR)/VirtualBox.h \
1677 + $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb: $(VBOX_IDL_FILE.MSCOM) | $$(dir $$@)
1678 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1679 $(VBOX_MIDL_REDIRECT) $(VBOX_WIN_MIDL) /nologo /W4 \
1680 /env $(if-expr "$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)" == "win.amd64" ,amd64,win32) \
1681 /robust /protocol all /target $(if-expr defined(VBOX_WITH_MIDL_PROXY_STUB),NT61,NT51) \
1682 /out $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxCOM_0_OUTDIR)) \
1683 /cpp_cmd $(VBOX_MIDL_CPP_CMD) \
1684 $(foreachfile dir,$(SDK_$(VBOX_WINPSDK)_INCS),/I $(call VBOX_FN_MAKE_WIN_PATH,$(dir))) \
1685 /I idl \
1686 $(call VBOX_FN_MAKE_WIN_PATH,$(VBOX_IDL_FILE.MSCOM))
1687 $(call def_VBoxMidlOutputDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/VirtualBox.h)
1688 $(call def_VBoxMidlOutputDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/VirtualBox_i.c)
1689 $(call def_VBoxMidlOutputDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/VirtualBox_p.c)
1690
1691 if defined(VBOX_WITH_MIDL_PROXY_STUB)
1692 # -Windows Server 2003 AMD64 SP1 does not like the result when using '/protocol all' and '/target NT51'.
1693 # -Vista AMD64 SP1 and Windows Server 2008 AMD64 seems to have some objections as well, but it seemed
1694 # that using an older MIDL compiler (v7.00.0499 instead of v7.00.0555) helps. But the W2K3 fix also works.
1695 # To avoid 32-bit vs. 64-bit differences, we do the same for 32-bit windows versions.
1696 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_i.c)
1697 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_i.c \
1698 + $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_p.c \
1699 + $(VBoxCOM_0_OUTDIR)/legacy/dlldata.c \
1700 + $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.h \
1701 + $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.tlb: $(VBOX_IDL_FILE.MSCOM) | $$(dir $$@)
1702 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1703 $(VBOX_MIDL_REDIRECT) $(VBOX_WIN_MIDL) /nologo /W4 \
1704 $(if-expr "$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)" == "win.amd64" \
1705 ,/env amd64 /x64 /target NT50 /robust \
1706 ,/env win32 /target NT51 /robust /protocol all ) \
1707 /out $(call VBOX_FN_MAKE_WIN_PATH,$(dir $@)) \
1708 /cpp_cmd $(VBOX_MIDL_CPP_CMD) \
1709 $(foreachfile dir,$(SDK_$(VBOX_WINPSDK)_INCS),/I $(call VBOX_FN_MAKE_WIN_PATH,$(dir))) \
1710 /I idl \
1711 $(call VBOX_FN_MAKE_WIN_PATH,$(VBOX_IDL_FILE.MSCOM))
1712 $(call def_VBoxMidlOutputDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.h)
1713 $(call def_VBoxMidlOutputDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_i.c)
1714 $(call def_VBoxMidlOutputDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_p.c)
1715 endif
1716
1717 if defined(VBOX_WITH_32_ON_64_MAIN_API) && !defined(VBOX_ONLY_EXTPACKS)
1718 # The XP targetted 32-bit proxy stub works with all versions of windows (the
1719 # issues leading to the VBoxProxyStubLegacy.dll are only on 64-bit windows).
1720 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c)
1721 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c \
1722 $(if $(VBOX_WITH_MIDL_PROXY_STUB), + $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_p.c + $(VBoxCOM-x86_0_OUTDIR)/dlldata.c,) \
1723 + $(VBoxCOM-x86_0_OUTDIR)/VirtualBox.h \
1724 + $(VBoxCOM-x86_0_OUTDIR)/VirtualBox-x86.tlb: $(VBOX_IDL_FILE.MSCOM) | $$(dir $$@)
1725 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1726 $(VBOX_MIDL_REDIRECT_X86) $(VBOX_WIN_MIDL) /nologo /W4 \
1727 /env win32 /target NT51 /robust /protocol all \
1728 /out $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxCOM-x86_0_OUTDIR)) \
1729 /tlb $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox-x86.tlb) \
1730 /cpp_cmd $(VBOX_MIDL_CPP_CMD_X86) \
1731 $(foreachfile dir,$(SDK_$(VBOX_WINPSDK)_INCS),/I $(call VBOX_FN_MAKE_WIN_PATH,$(dir))) \
1732 /I idl \
1733 $(call VBOX_FN_MAKE_WIN_PATH,$(VBOX_IDL_FILE.MSCOM))
1734 $(call def_VBoxMidlOutputDisableMscWarnings,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox.h)
1735 $(call def_VBoxMidlOutputDisableMscWarnings,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c)
1736 $(call def_VBoxMidlOutputDisableMscWarnings,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_p.c)
1737 endif
1738
1739endif # defined(VBOX_ONLY_SDK) || "$(KBUILD_TARGET)" == "win"
1740
1741#
1742# Translation stuff
1743#
1744VBoxSVC_VBOX_HEADERS = \
1745 include/collection.h \
1746 include/MachineImpl.h
1747VBoxSVC_VBOX_TRANSLATIONS = \
1748 nls/VBoxSVC_de.ts
1749
1750VBoxC_VBOX_HEADERS = \
1751 include/ConsoleImpl.h
1752
1753VBoxC_VBOX_INTERMEDIATES = $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
1754VBoxC_VBOX_HEADERS += $(VBOX_MAIN_APIWRAPPER_INCS)
1755
1756VBoxC_VBOX_TRANSLATIONS = \
1757 nls/VBoxC_de.ts
1758
1759ifdef VBOX_WITH_JMSCOM
1760
1761 #
1762 # Java glue JAR files
1763 #
1764 VBOX_JMSCOM_JAR = $(VBoxJMscom-inst-jar_0_OUTDIR)/vboxjmscom.jar
1765 VBOX_JMSCOM_TARGET := $(PATH_TARGET)/vboxjmscom-gen
1766 VBOX_JMSCOM_GEN = $(VBOX_JMSCOM_TARGET)/jmscomgen
1767 VBOX_JMSCOM_JDEST := $(VBOX_JMSCOM_TARGET)/jdest
1768 VBOX_GLUE_XSLT_DIR := $(PATH_ROOT)/src/VBox/Main/glue
1769 VBOX_JACOB_DIR := $(PATH_ROOT)/src/libs/jacob-1.17
1770
1771 INSTALLS += VBoxJMscom-inst-jar
1772 VBoxJMscom-inst-jar_INST = $(INST_SDK)bindings/mscom/java/
1773 VBoxJMscom-inst-jar_MODE = a+r,u+w
1774 VBoxJMscom-inst-jar_SOURCES = \
1775 $(VBoxJMscom-inst-jar_0_OUTDIR)/vboxjmscom.jar
1776 VBoxJMscom-inst-jar_CLEAN = \
1777 $(VBoxJMscom-inst-jar_0_OUTDIR)/vboxjmscom.jar \
1778 $(VBOX_JMSCOM_GEN)/jmscomglue.list \
1779 $(wildcard \
1780 $(VBOX_JMSCOM_GEN)/java/*.java \
1781 $(VBOX_JMSCOM_JDEST)/*.class \
1782 $(VBOX_JMSCOM_JDEST)/*/*.class \
1783 $(VBOX_JMSCOM_JDEST)/*/*/*.class \
1784 $(VBOX_JMSCOM_JDEST)/*/*/*/*.class \
1785 )
1786 VBoxJMscom-inst-jar_BLDDIRS += $(VBOX_JMSCOM_GEN)/java
1787 $(call KB_FN_DO_PASS0_ON_TARGET,VBoxJMscom-inst-jar) # Sets VBoxJMscom-inst-jar_0_OUTDIR
1788
1789 $(call KB_FN_AUTO_CMD_DEPS,$(VBOX_JMSCOM_GEN)/jmscomglue.list)
1790 $(VBOX_JMSCOM_GEN)/jmscomglue.list: \
1791 $(VBOX_XIDL_FILE) \
1792 $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl \
1793 $(VBOX_FILESPLIT) \
1794 | $(VBOX_JMSCOM_GEN)/java/
1795 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1796 $(call MSG_L1,Generating Java MSCOM glue files from XIDL)
1797 $(QUIET)$(RM) -f $(wildcard $(VBOX_JMSCOM_GEN)/java/*.java)
1798 $(QUIET)$(VBOX_XSLTPROC) \
1799 --stringparam filelistonly "" \
1800 --stringparam G_vboxApiSuffix $(VBOX_API_SUFFIX) \
1801 --stringparam G_vboxGlueStyle mscom \
1802 --stringparam G_vboxDirPrefix "" \
1803 -o $(VBOX_JMSCOM_GEN)/java/merged.file $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl $(VBOX_XIDL_FILE)
1804 $(QUIET)$(VBOX_FILESPLIT) $(VBOX_JMSCOM_GEN)/java/merged.file $(VBOX_JMSCOM_GEN)/java
1805 $(QUIET)echo $(VBOX_JMSCOM_GEN)/java/*.java > $@
1806
1807 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxJMscom-inst-jar_0_OUTDIR)/vboxjmscom.jar)
1808 $(VBoxJMscom-inst-jar_0_OUTDIR)/vboxjmscom.jar: $(VBOX_JMSCOM_GEN)/jmscomglue.list | $$(dir $$@)
1809 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1810 $(call MSG_TOOL,javac,$(notdir $@),jmscomglue.list,)
1811 $(QUIET)$(RM) -Rf $(VBOX_JMSCOM_JDEST)
1812 $(QUIET)$(MKDIR) -p $(VBOX_JMSCOM_JDEST)
1813 $(call MSG_TOOL,javac,$(notdir $@),...,)
1814 $(QUIET)$(VBOX_JAVAC) $(VBOX_JAVAC_OPTS) @$(VBOX_JMSCOM_GEN)/jmscomglue.list \
1815 -d $(VBOX_JMSCOM_JDEST) -classpath "$(VBOX_JMSCOM_JDEST)$(VBOX_SEP)$(VBOX_JACOB_DIR)/jacob.jar"
1816 $(call MSG_LINK,$(notdir $@),$@)
1817 $(QUIET)$(VBOX_JAR) cf $@ -C $(VBOX_JMSCOM_JDEST) .
1818
1819 ## @todo compile TestVBox.java (see below) to have sanity checking
1820endif # VBOX_WITH_JMSCOM
1821
1822#
1823# Install Java glue sample code.
1824#
1825INSTALLS += javagluesample
1826javagluesample_INST = $(INST_SDK)bindings/glue/java/
1827javagluesample_MODE = a+r,u+w
1828javagluesample_SOURCES = \
1829 $(VBOX_PATH_MAIN_SRC)/glue/tests/TestVBox.java=>TestVBox.java \
1830 $(VBOX_PATH_MAIN_SRC)/glue/tests/Makefile=>Makefile
1831
1832#
1833# Rules associated with VBoxAPIWrap (in typical invocation order).
1834# We keep them down here to simplify the use of VBoxAPIWrap_0_OUTDIR.
1835#
1836
1837# Generate a make include file which lists the wrapper header and source files.
1838$(call KB_FN_AUTO_CMD_DEPS,$(VBoxAPIWrap_VBOX_KMK_FILE).ts)
1839$(VBoxAPIWrap_VBOX_KMK_FILE).ts \
1840+| $(VBoxAPIWrap_VBOX_KMK_FILE): \
1841 $(VBOX_XIDL_FILE) \
1842 $(VBOX_PATH_MAIN_SRC)/idl/apiwrap-server-filelist.xsl \
1843 $(VBOX_PATH_MAIN_SRC)/Makefile.kmk
1844 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1845 $(call MSG_GENERATE,,$(VBoxAPIWrap_VBOX_KMK_FILE))
1846 $(QUIET)$(RM) -f $@
1847 $(QUIET)$(MKDIR) -p $(@D)
1848 $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
1849 $(if $(VBOX_WITH_SDS),-stringparam g_fVBoxWithSDS yes,) \
1850 -o $@ $(VBOX_PATH_MAIN_SRC)/idl/apiwrap-server-filelist.xsl $(VBOX_XIDL_FILE)
1851 $(QUIET)$(CP) --changed -fv $@ $(VBoxAPIWrap_VBOX_KMK_FILE)
1852
1853# Generate the header files for the wrappers.
1854$(call KB_FN_AUTO_CMD_DEPS,$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-headers)
1855$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-headers \
1856+| $(VBOX_MAIN_APIWRAPPER_GEN_HDRS): \
1857 $(VBOX_XIDL_FILE) \
1858 $(VBOX_PATH_MAIN_SRC)/idl/typemap-shared.inc.xsl \
1859 $(VBoxAPIWrap_VBOX_XSLT) \
1860 $(VBOX_FILESPLIT) \
1861 | $$(dir $$@)
1862 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1863 $(call MSG_L1,Generating C++ Server API wrapper header files from XIDL)
1864 $(QUIET)$(RM) -f -- $(filter-out $(VBOX_MAIN_APIWRAPPER_GEN_HDRS), $(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.h))
1865 $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
1866 --stringparam generating "headers" \
1867 -o $@ $(VBoxAPIWrap_VBOX_XSLT) $(VBOX_XIDL_FILE)
1868 $(QUIET)$(VBOX_FILESPLIT) $@ $(VBoxAPIWrap_0_OUTDIR)
1869
1870# Generate the DTrace probes for the wrappers and combine them with handcoded probes.
1871$(call KB_FN_AUTO_CMD_DEPS,$(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d.ts)
1872$(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d.ts \
1873+| $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d: \
1874 $(VBOX_XIDL_FILE) \
1875 $(VBOX_PATH_MAIN_SRC)/idl/typemap-shared.inc.xsl \
1876 $(VBoxAPIWrap_VBOX_XSLT) \
1877 $(VBOX_FILESPLIT) \
1878 | $$(dir $$@)
1879 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1880 $(call MSG_L1,Generating DTrace Provider for the VBox API (from XIDL))
1881 $(QUIET)$(RM) -f -- "$@" "[email protected]"
1882 $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
1883 --stringparam generating "dtrace-probes" \
1884 -o "$@" $(VBoxAPIWrap_VBOX_XSLT) $(VBOX_XIDL_FILE)
1885 $(QUIET)$(SED) -e '' -o "[email protected]" \
1886 "$(VBOX_PATH_MAIN_SRC)/src-all/VBoxAPI-start$(if-expr "$(VBOX_HOST_DTRACE_VERSION)" == "dtrace: Sun D 1.6.2",-alternative,).d" \
1887 "$@" \
1888 "$(VBOX_PATH_MAIN_SRC)/src-all/VBoxAPI-end$(if-expr "$(VBOX_HOST_DTRACE_VERSION)" == "dtrace: Sun D 1.6.2",-alternative,).d"
1889 $(QUIET)$(MV) -- "[email protected]" "$@"
1890 $(QUIET)$(CP) --changed -fv -- "$@" "$(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d"
1891
1892# Generate the wrapper source files - split in two due to long processing time
1893$(call KB_FN_AUTO_CMD_DEPS,$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-even)
1894$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-even \
1895+| $(VBOX_MAIN_APIWRAPPER_GEN_SRCS_EVEN): \
1896 $(VBOX_XIDL_FILE) \
1897 $(VBOX_PATH_MAIN_SRC)/idl/typemap-shared.inc.xsl \
1898 $(VBoxAPIWrap_VBOX_XSLT) \
1899 $(VBOX_FILESPLIT) \
1900 | $$(dir $$@)
1901 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1902 $(call MSG_L1,Generating C++ Server API wrapper files from XIDL - part 1)
1903 $(QUIET)$(RM) -f -- $(filter-out $(VBOX_MAIN_APIWRAPPER_GEN_SRCS), $(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.cpp))
1904 $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
1905 --stringparam generating "sources" \
1906 --param reminder 0 \
1907 -o $@ $(VBoxAPIWrap_VBOX_XSLT) $(VBOX_XIDL_FILE)
1908 $(QUIET)$(VBOX_FILESPLIT) $@ $(VBoxAPIWrap_0_OUTDIR)
1909
1910$(call KB_FN_AUTO_CMD_DEPS,$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-odd)
1911$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-odd \
1912+| $(VBOX_MAIN_APIWRAPPER_GEN_SRCS_ODD): \
1913 $(VBOX_XIDL_FILE) \
1914 $(VBOX_PATH_MAIN_SRC)/idl/typemap-shared.inc.xsl \
1915 $(VBoxAPIWrap_VBOX_XSLT) \
1916 $(VBOX_FILESPLIT) \
1917 | $$(dir $$@)
1918 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1919 $(call MSG_L1,Generating C++ Server API wrapper files from XIDL - part 2)
1920 $(QUIET)$(RM) -f -- $(filter-out $(VBOX_MAIN_APIWRAPPER_GEN_SRCS), $(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.cpp))
1921 $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
1922 --stringparam generating "sources" \
1923 --param reminder 1 \
1924 -o $@ $(VBoxAPIWrap_VBOX_XSLT) $(VBOX_XIDL_FILE)
1925 $(QUIET)$(VBOX_FILESPLIT) $@ $(VBoxAPIWrap_0_OUTDIR)
1926
1927testapiwrappers:: \
1928 $(VBoxAPIWrap_0_OUTDIR)/apiwrappers-headers \
1929 $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d.ts \
1930 $(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-odd \
1931 $(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-even
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