VirtualBox

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

Last change on this file since 98123 was 98103, checked in by vboxsync, 23 months ago

Copyright year updates by scm.

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