VirtualBox

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

Last change on this file since 106850 was 106850, checked in by vboxsync, 3 weeks ago

Main/Makefile.kmk: xsltproc uses ';' as path separator since 1.1.35. Since the --path option is accumulative, we can sidestep the whole separator issue by repating --path for each path. This should fix the SDK build. VBP-1253

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