VirtualBox

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

Last change on this file was 106065, checked in by vboxsync, 7 weeks ago

Manual copyright year updates.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 72.2 KB
Line 
1# $Id: Makefile.kmk 106065 2024-09-16 21:42: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_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 ifeq ($(KBUILD_TARGET),win)
343 ifndef VBOX_WITHOUT_PRECOMPILED_HEADERS
344 VBoxAPIWrap_USES = vccprecomp
345 VBoxAPIWrap_PCH_HDR := $(PATH_SUB_CURRENT)/src-all/win/VBoxAPIWrap-precomp_vcc.h
346 endif
347 else if $(KBUILD_KMK_REVISION) >= 3256 && "$(KBUILD_TARGET)" != "darwin" && !defined(VBOX_WITHOUT_PRECOMPILED_HEADERS)
348 if $(VBOX_GCC_VERSION_CXX) >= 50000 # GCC 4.x runs into trouble compiling the header.
349 VBoxAPIWrap_USES = gccprecomp
350 VBoxAPIWrap_PCH_HDR := $(PATH_SUB_CURRENT)/src-all/xpcom/VBoxAPIWrap-precomp_gcc.h
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) && "$(KBUILD_TARGET)" == "win"
520 VBoxSVC_USES += vccprecomp
521 VBoxSVC_PCH_HDR := $(PATH_SUB_CURRENT)/src-server/win/precomp_vcc.h
522 else 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.
524 VBoxSVC_USES += gccprecomp
525 VBoxSVC_PCH_HDR := $(PATH_SUB_CURRENT)/src-server/xpcom/precomp_gcc.h
526 endif
527 endif
528 VBoxSVC_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,) \
551 $(if $(VBOX_WITH_VIRT_ARMV8),VBOX_WITH_VIRT_ARMV8,) \
552 $(if $(VBOX_WITH_NATIVE_NEM),VBOX_WITH_NATIVE_NEM,) \
553 $(if $(VBOX_WITH_IEM_NATIVE_RECOMPILER),VBOX_WITH_IEM_NATIVE_RECOMPILER,) \
554 $(if $(VBOX_WITH_DRIVERLESS_FORCED),VBOX_WITH_DRIVERLESS_FORCED,)
555
556 ifdef VBOX_WITH_USB
557 VBoxSVC_DEFS += \
558 VBOX_WITH_USB \
559 $(if $(VBOX_WITH_EHCI),VBOX_WITH_EHCI,) \
560 $(if $(VBOX_WITH_NEW_USB_CODE_ON_DARWIN),VBOX_WITH_NEW_USB_CODE_ON_DARWIN,)
561 endif
562 VBoxSVC_DEFS.win += VBOX_COM_OUTOFPROC_MODULE _WIN32_WINNT=0x0600
563 # Try to load and use libhal at runtime for probing removable media
564 # VBoxSVC_DEFS.linux += VBOX_USE_LIBHAL
565 VBoxSVC_DEFS.solaris += VBOX_USE_LIBHAL
566
567 if $(KBUILD_TARGET) != "win" && $(VBOX_GCC_VERSION_CXX) >= 40900 # gcc 4.9.x (4.8.x is causing endless RT_ELEMENT trouble)
568 VBoxSVC_CXXFLAGS = -Wunused -Wconversion
569 endif
570
571 VBoxSVC_INCS = \
572 include \
573 $(VBoxSVC_0_OUTDIR) \
574 $(dir $(VBOX_XML_SCHEMADEFS_H)) \
575 $(VBOX_MAIN_APIWRAPPER_INCS) \
576 . \
577 $(VBOX_GRAPHICS_INCS)
578 VBoxSVC_INCS.win = \
579 $(VBoxCOM_0_OUTDIR)
580 ifdef VBOX_WITH_USB
581 VBoxSVC_INCS.os2 = \
582 $(PATH_ROOT)/src/VBox/HostDrivers/VBoxUSB/os2
583 endif
584
585 VBoxSVC_LIBS += \
586 $(PATH_STAGE_LIB)/VBoxAPIWrap$(VBOX_SUFF_LIB) \
587 $(PATH_STAGE_LIB)/SSMStandalone$(VBOX_SUFF_LIB) \
588 $(LIB_VBOXXPCOMIPCD) \
589 $(LIB_DDU)
590
591 VBoxSVC_SDKS = VBoxLibPng VBoxZlib
592 VBoxSVC_LIBS.solaris = \
593 adm \
594 nsl \
595 devinfo \
596 socket
597
598 VBoxSVC_LIBS.win += \
599 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/dnsapi.lib
600
601 VBoxSVC_INTERMEDIATES = \
602 $(VBOX_MAIN_PREREQS) \
603 $(VBOX_XML_SCHEMADEFS_H) \
604 $(VBOX_AUTOGEN_EVENT_H) \
605 $(VBOX_AUTOGEN_STRINGIFY_ENUMS_H) \
606 $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
607
608 VBoxSVC_SOURCES = \
609 $(VBOX_SVC_CERTS_FILE) \
610 $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d \
611 src-all/AuthLibrary.cpp \
612 src-all/CryptoUtils.cpp \
613 src-all/DisplayPNGUtil.cpp \
614 src-all/DisplayResampleImage.cpp \
615 src-all/DisplayUtils.cpp \
616 src-all/EventImpl.cpp \
617 src-all/Global.cpp \
618 src-all/GlobalStatusConversion.cpp \
619 src-all/HashedPw.cpp \
620 src-all/Logging.cpp \
621 src-all/NvramStoreImpl.cpp \
622 src-all/PCIDeviceAttachmentImpl.cpp \
623 src-all/PlatformPropertiesImpl.cpp \
624 src-all/ProgressImpl.cpp \
625 src-all/SecretKeyStore.cpp \
626 src-all/SharedFolderImpl.cpp \
627 src-all/AutoCaller.cpp \
628 src-all/ThreadTask.cpp \
629 src-all/VirtualBoxBase.cpp \
630 src-all/VirtualBoxErrorInfoImpl.cpp \
631 $(if $(VBOX_WITH_EXTPACK),src-all/ExtPackManagerImpl.cpp src-all/ExtPackUtil.cpp,) \
632 src-server/CertificateImpl.cpp \
633 src-server/ApplianceImpl.cpp \
634 src-server/ApplianceImplExport.cpp \
635 src-server/ApplianceImplImport.cpp \
636 src-server/AudioAdapterImpl.cpp \
637 src-server/AudioSettingsImpl.cpp \
638 src-server/BandwidthControlImpl.cpp \
639 src-server/BandwidthGroupImpl.cpp \
640 src-server/FirmwareSettingsImpl.cpp \
641 src-server/RecordingSettingsImpl.cpp \
642 src-server/RecordingScreenSettingsImpl.cpp \
643 src-server/GraphicsAdapterImpl.cpp \
644 src-server/ClientWatcher.cpp \
645 src-server/ClientToken.cpp \
646 src-server/CloudProviderManagerImpl.cpp \
647 src-server/CPUProfileImpl.cpp \
648 src-server/DataStreamImpl.cpp \
649 src-server/DHCPServerImpl.cpp \
650 src-server/DHCPConfigImpl.cpp \
651 ../NetworkServices/Dhcpd/DhcpOptions.cpp \
652 src-server/NetworkServiceRunner.cpp \
653 src-server/NATNetworkImpl.cpp \
654 $(if $(VBOX_WITH_CLOUD_NET), \
655 src-server/CloudNetworkImpl.cpp \
656 ,) \
657 src-server/GuestDebugControlImpl.cpp \
658 src-server/GuestOSTypeImpl.cpp \
659 src-server/HostDnsService.cpp \
660 src-server/HostImpl.cpp \
661 src-server/HostX86Impl.cpp \
662 src-server/HostAudioDeviceImpl.cpp \
663 src-server/HostNetworkInterfaceImpl.cpp \
664 src-server/HostPower.cpp \
665 $(if $(VBOX_WITH_LIBCURL), \
666 $(if $(VBOX_WITH_UPDATE_AGENT), \
667 src-server/UpdateAgentImpl.cpp,), \
668 ) \
669 src-server/HostVideoInputDeviceImpl.cpp \
670 src-server/HostDrivePartitionImpl.cpp \
671 src-server/HostDriveImpl.cpp \
672 src-server/MachineImpl.cpp \
673 src-all/MachineLaunchVMCommonWorker.cpp \
674 src-server/MachineImplCloneVM.cpp \
675 src-server/MachineImplMoveVM.cpp \
676 src-server/Matching.cpp \
677 src-server/MediumAttachmentImpl.cpp \
678 src-server/MediumFormatImpl.cpp \
679 src-server/MediumImpl.cpp \
680 src-server/MediumLock.cpp \
681 src-server/MediumIOImpl.cpp \
682 src-server/NATEngineImpl.cpp \
683 src-server/NetworkAdapterImpl.cpp \
684 src-server/ParallelPortImpl.cpp \
685 src-server/PlatformBase.cpp \
686 src-server/PlatformImpl.cpp \
687 $(if $(VBOX_WITH_VIRT_ARMV8), src-server/PlatformARMImpl.cpp,) \
688 src-server/PlatformX86Impl.cpp \
689 src-server/ProgressProxyImpl.cpp \
690 src-server/SerialPortImpl.cpp \
691 src-server/SnapshotImpl.cpp \
692 src-server/StorageControllerImpl.cpp \
693 src-server/SystemPropertiesImpl.cpp \
694 src-server/TokenImpl.cpp \
695 src-server/TrustedPlatformModuleImpl.cpp \
696 src-server/UefiVariableStoreImpl.cpp \
697 $(if $(VBOX_WITH_UNATTENDED), \
698 src-server/UnattendedImpl.cpp \
699 src-server/UnattendedInstaller.cpp \
700 src-server/UnattendedOs2Installer.cpp \
701 src-server/UnattendedScript.cpp \
702 src-all/TextScript.cpp \
703 ,) \
704 src-server/USBControllerImpl.cpp \
705 src-server/USBDeviceFiltersImpl.cpp \
706 src-server/VFSExplorerImpl.cpp \
707 src-server/VirtualBoxImpl.cpp \
708 src-server/VRDEServerImpl.cpp \
709 src-server/generic/AutostartDb-generic.cpp \
710 xml/ovfreader.cpp \
711 xml/Settings.cpp \
712 $(VBOX_XML_SCHEMADEFS_CPP) \
713 $(VBOX_AUTOGEN_EVENT_CPP) \
714 $(VBOX_AUTOGEN_STRINGIFY_ENUMS_CPP) \
715 $(if $(VBOX_WITH_XPCOM),src-server/xpcom/server.cpp,)
716
717 ifdef VBOX_WITH_MAIN_NLS
718 VBoxSVC_SOURCES += \
719 src-all/VirtualBoxTranslator.cpp \
720 src-all/QMTranslatorImpl.cpp
721 endif
722
723 ifn1of ($(KBUILD_TARGET), win darwin)
724 VBoxSVC_SOURCES += $(PATH_ROOT)/src/VBox/Devices/Network/slirp/resolv_conf_parser.c
725 #$(PATH_ROOT)/src/VBox/Devices/Network/slirp/resolv_conf_parser.c_DEFS += LOG_GROUP=LOG_GROUP_MAIN
726 endif
727
728 VBoxSVC_SOURCES.darwin = \
729 src-server/darwin/iokit.cpp \
730 src-server/darwin/HostPowerDarwin.cpp \
731 src-server/darwin/HostDnsServiceDarwin.cpp
732 ifdef VBOX_WITH_VMNET
733 VBoxSVC_SOURCES.darwin += \
734 src-server/HostOnlyNetworkImpl.cpp
735 endif
736
737 VBoxSVC_SOURCES.win = \
738 src-server/win/svcmain.cpp \
739 src-server/win/svchlp.cpp \
740 src-server/win/HostPowerWin.cpp \
741 src-server/win/VBoxSVC.rc \
742 src-server/win/HostDnsServiceWin.cpp
743
744 VBoxSVC_SOURCES.linux = \
745 src-server/linux/HostHardwareLinux.cpp \
746 src-server/linux/HostDnsServiceLinux.cpp \
747 $(if $(VBOX_WITH_DBUS),src-server/linux/HostPowerLinux.cpp) \
748 src-server/HostDnsServiceResolvConf.cpp
749
750 VBoxSVC_SOURCES.solaris = \
751 src-server/linux/vbox-libhal.cpp \
752 src-server/solaris/DynLoadLibSolaris.cpp \
753 src-server/HostDnsServiceResolvConf.cpp
754
755 VBoxSVC_SOURCES.os2 = \
756 src-server/HostDnsServiceResolvConf.cpp
757
758 VBoxSVC_SOURCES.freebsd = \
759 src-server/freebsd/HostHardwareFreeBSD.cpp \
760 src-server/HostDnsServiceResolvConf.cpp
761
762 VBoxSVC_LDFLAGS.freebsd += -lcam
763
764
765 ifdef VBOX_WITH_USB
766 ifdef VBOX_WITH_SYSFS_BY_DEFAULT
767 src-server/linux/USBProxyBackendLinux.cpp_DEFS += VBOX_WITH_SYSFS_BY_DEFAULT
768 endif
769 VBoxSVC_SOURCES += \
770 src-server/USBDeviceFilterImpl.cpp \
771 src-server/USBProxyService.cpp \
772 src-server/USBProxyBackend.cpp \
773 src-server/generic/USBProxyBackendUsbIp.cpp \
774 src-server/HostUSBDeviceImpl.cpp
775 VBoxSVC_SOURCES.darwin += src-server/darwin/USBProxyBackendDarwin.cpp
776 VBoxSVC_SOURCES.linux += src-server/linux/USBProxyBackendLinux.cpp
777 VBoxSVC_SOURCES.linux += src-server/linux/USBGetDevices.cpp
778 VBoxSVC_SOURCES.os2 += src-server/os2/USBProxyBackendOs2.cpp
779 VBoxSVC_SOURCES.solaris += src-server/solaris/USBProxyBackendSolaris.cpp
780 VBoxSVC_SOURCES.win += src-server/win/USBProxyBackendWindows.cpp
781 VBoxSVC_SOURCES.freebsd += src-server/freebsd/USBProxyBackendFreeBSD.cpp
782 endif
783
784 ifdef VBOX_WITH_NETFLT
785 VBoxSVC_SDKS.win += VBoxWinNewDevLib
786 VBoxSVC_LIBS.win += \
787 $(PATH_STAGE_LIB)/WinNetConfigDll$(VBOX_SUFF_LIB) \
788 $(PATH_STAGE_LIB)/VBoxDrvCfgDll$(VBOX_SUFF_LIB) \
789 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
790 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
791 endif
792 VBoxSVC_LDFLAGS.darwin = -framework IOKit -framework SystemConfiguration
793
794 ifdef VBOX_WITH_3D_ACCELERATION
795 VBoxSVC_DEFS += VBOX_WITH_3D_ACCELERATION
796 endif
797
798 ifeq ($(KBUILD_TYPE),debug)
799 VBoxSVC_LDFLAGS.linux += -rdynamic # for backtrace_symbols()
800 endif
801
802 ifdef VBOX_WITH_RESOURCE_USAGE_API
803 VBoxSVC_SOURCES += \
804 src-server/PerformanceImpl.cpp \
805 src-server/Performance.cpp
806 VBoxSVC_SOURCES.darwin += src-server/darwin/PerformanceDarwin.cpp
807 VBoxSVC_SOURCES.freebsd += src-server/freebsd/PerformanceFreeBSD.cpp
808 VBoxSVC_SOURCES.linux += src-server/linux/PerformanceLinux.cpp
809 VBoxSVC_SOURCES.os2 += src-server/os2/PerformanceOs2.cpp
810 VBoxSVC_SOURCES.solaris += src-server/solaris/PerformanceSolaris.cpp
811 VBoxSVC_SOURCES.win += src-server/win/PerformanceWin.cpp
812 VBoxSVC_LDFLAGS.darwin += -lproc
813 VBoxSVC_LDFLAGS.solaris += -lkstat -lnvpair
814 VBoxSVC_LDFLAGS.win += psapi.lib powrprof.lib
815 endif
816
817 ifdef VBOX_WITH_HOSTNETIF_API
818 VBoxSVC_SOURCES.win += src-server/win/NetIf-win.cpp
819 VBoxSVC_SOURCES.linux += src-server/linux/NetIf-linux.cpp
820 VBoxSVC_SOURCES.os2 += src-server/os2/NetIf-os2.cpp
821 VBoxSVC_SOURCES.darwin += src-server/darwin/NetIf-darwin.cpp
822 VBoxSVC_SOURCES.solaris += src-server/solaris/NetIf-solaris.cpp
823 VBoxSVC_SOURCES.freebsd += src-server/freebsd/NetIf-freebsd.cpp
824 VBoxSVC_DEFS += VBOX_WITH_HOSTNETIF_API
825 if1of ($(KBUILD_TARGET), linux darwin solaris freebsd)
826 VBoxSVC_SOURCES += src-server/generic/NetIf-generic.cpp
827 endif
828 endif
829
830 $(call KB_FN_DO_PASS0_ON_TARGET,VBoxSVC) # Sets VBoxSVC_0_OUTDIR
831
832 ifdef VBOX_WITH_MAIN_USB_ID_DATABASE # Generate a database of USB vendor IDs and device IDs.
833 VBoxSVC_DEFS += VBOX_WITH_MAIN_USB_ID_DATABASE
834 VBoxSVC_SOURCES += $(VBoxSVC_0_OUTDIR)/USBIdDatabase.cpp
835 VBoxSVC_CLEAN += $(VBoxSVC_0_OUTDIR)/USBIdDatabase.cpp
836
837 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxSVC_0_OUTDIR)/USBIdDatabase.cpp)
838 $(VBoxSVC_0_OUTDIR)/USBIdDatabase.cpp: $$(USBIdDatabaseGenerator_1_TARGET) \
839 $(PATH_SUB_CURRENT)/src-server/usb.ids $(PATH_SUB_CURRENT)/src-server/custom.ids | $$(dir $$@)
840 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
841 $(call MSG_GENERATE,USBIdDatabase,$@,$(USBIdDatabaseGenerator_1_TARGET))
842 $(QUIET)$(USBIdDatabaseGenerator_1_TARGET) -o "$@" $(filter %.ids,$^)
843
844 BLDPROGS += USBIdDatabaseGenerator
845 USBIdDatabaseGenerator_TEMPLATE = VBoxAdvBldProg
846 USBIdDatabaseGenerator_SOURCES = src-server/USBIdDatabaseGenerator.cpp
847 else
848 VBoxSVC_SOURCES += src-server/USBIdDatabaseStub.cpp
849 endif
850
851 src-server/win/VBoxSVC.rc_INCS = $(VBoxSVC_0_OUTDIR)
852 src-server/win/VBoxSVC.rc_DEPS = $(VBoxSVC_0_OUTDIR)/VBoxSVC-icon.rc
853 VBoxSVC_CLEAN += $(VBoxSVC_0_OUTDIR)/VBoxSVC-icon.rc
854 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxSVC_0_OUTDIR)/VBoxSVC-icon.rc)
855 $(VBoxSVC_0_OUTDIR)/VBoxSVC-icon.rc: $(VBOX_WINDOWS_ICON_FILE) | $$(dir $$@)
856 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
857 $(APPEND) -t $@ '1 ICON DISCARDABLE "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
858
859 ifndef VBOX_WITH_MIDL_PROXY_STUB
860 src-server/win/VBoxSVC.rc_DEPS += $(VBoxSVC_0_OUTDIR)/VBoxSVC.rgs
861 VBoxSVC_CLEAN += $(VBoxSVC_0_OUTDIR)/VBoxSVC.rgs
862 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxSVC_0_OUTDIR)/VBoxSVC.rgs)
863 $(VBoxSVC_0_OUTDIR)/VBoxSVC.rgs: $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
864 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
865 $(VBOX_XSLTPROC) \
866 --stringparam Application VirtualBox \
867 --stringparam Module VBoxSVC \
868 -o $@ \
869 $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl \
870 $(VBOX_XIDL_FILE)
871 endif
872
873 ## @todo r=klaus unfortunately we don't have xmllint everywhere, would be
874 # good to check the validity for every VirtualBox.xidl change.
875 #$(VBOX_XIDL_FILE).validated.ts: $(VBOX_XIDL_FILE_SRC)
876 # xmllint --dtdvalid $(VBOX_PATH_MAIN_SRC)/idl/VirtualBox.dtd --noout $<
877 # $(QUIET)$(CP) --changed -fv $< $(VBOX_XIDL_FILE).validated.ts
878 #
879 #OTHERS += $(VBOX_XIDL_FILE).validated.ts
880 #OTHER_CLEAN += $(VBOX_XIDL_FILE).validated.ts
881
882 testvalidxidl: $(VBOX_XIDL_FILE_SRC)
883 xmllint --dtdvalid $(VBOX_PATH_MAIN_SRC)/idl/VirtualBox.dtd --noout $<
884
885
886 #
887 # Embed some constraints from XML Schema file into VBoxSVC
888 #
889 VBOX_XML_SCHEMA = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings.xsd
890
891 $(VBOX_XML_SCHEMADEFS_H): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA) | $$(dir $$@)
892 $(call MSG_GENERATE,SchemaDefs,$@,$<)
893 $(QUIET)$(VBOX_XSLTPROC) --stringparam mode declare -o $@ $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA)
894
895 $(VBOX_XML_SCHEMADEFS_CPP): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA) | $$(dir $$@)
896 $(call MSG_GENERATE,SchemaDefs,$@,$<)
897 $(QUIET)$(VBOX_XSLTPROC) --stringparam mode define -o $@ $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA)
898
899 testvalidsettings: $(VBOX_XML_SCHEMA)
900 if ("$(KBUILD_TARGET)" == "solaris")
901 xmllint --schema $< --noout $(HOME)/.config/VirtualBox/VirtualBox.xml
902 xmllint --schema $< --noout $(HOME)/VirtualBox\ VMs/*/*.vbox
903 else if ("$(KBUILD_TARGET)" == "darwin")
904 xmllint --schema $< --noout $(HOME)/Library/VirtualBox/VirtualBox.xml
905 xmllint --schema $< --noout $(HOME)/VirtualBox\ VMs/*/*.vbox
906 else
907 xmllint --schema $< --noout $(HOME)/.VirtualBox/VirtualBox.xml
908 xmllint --schema $< --noout $(HOME)/.VirtualBox/Machines/*/*.xml
909 xmllint --schema $< --noout $(HOME)/.VirtualBox/Machines/*/*.vbox
910 xmllint --schema $< --noout $(HOME)/VirtualBox\ VMs/*/*.vbox
911 endif
912
913 OTHER_CLEAN += $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP)
914
915
916 #
917 # Generate some event stuff for VBoxSVC and VBoxC.
918 #
919
920 # Events
921 $(call KB_FN_AUTO_CMD_DEPS,$(VBOX_AUTOGEN_EVENT_H).ts)
922 $(VBOX_AUTOGEN_EVENT_H).ts +| $(VBOX_AUTOGEN_EVENT_H): $(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
923 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
924 $(call MSG_TOOL,xsltproc,autogen events,$<,$@)
925 $(QUIET)$(VBOX_XSLTPROC) \
926 --stringparam G_kind VBoxEventHeader \
927 --stringparam g_uVBoxCopyrightYear "$(VBOX_C_YEAR)" \
928 -o "$@" "$(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl" "$(VBOX_XIDL_FILE)"
929 $(QUIET)$(CP) --changed -fv -- "$@" "$(VBOX_AUTOGEN_EVENT_H)"
930
931 $(call KB_FN_AUTO_CMD_DEPS,$(VBOX_AUTOGEN_EVENT_CPP).ts)
932 $(VBOX_AUTOGEN_EVENT_CPP).ts +| $(VBOX_AUTOGEN_EVENT_CPP): $(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
933 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
934 $(call MSG_TOOL,xsltproc,autogen events,$<,$@)
935 $(QUIET)$(VBOX_XSLTPROC) \
936 --stringparam G_kind VBoxEvent \
937 --stringparam g_uVBoxCopyrightYear "$(VBOX_C_YEAR)" \
938 -o "$@" "$(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl" "$(VBOX_XIDL_FILE)"
939 $(QUIET)$(CP) --changed -fv -- "$@" "$(VBOX_AUTOGEN_EVENT_CPP)"
940
941 OTHER_CLEAN += $(VBOX_AUTOGEN_EVENT_H).ts $(VBOX_AUTOGEN_EVENT_H) $(VBOX_AUTOGEN_EVENT_CPP).ts $(VBOX_AUTOGEN_EVENT_CPP)
942
943 # Enum stringifiers
944 $(call KB_FN_AUTO_CMD_DEPS,$(VBOX_AUTOGEN_STRINGIFY_ENUMS_H).ts)
945 $(VBOX_AUTOGEN_STRINGIFY_ENUMS_H).ts +| $(VBOX_AUTOGEN_STRINGIFY_ENUMS_H): $(VBOX_PATH_MAIN_SRC)/idl/stringify-enums.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
946 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
947 $(call MSG_TOOL,xsltproc,autogen enum stringifiers,$<,$@)
948 $(QUIET)$(VBOX_XSLTPROC) \
949 --stringparam G_kind header \
950 --stringparam g_uVBoxCopyrightYear "$(VBOX_C_YEAR)" \
951 -o "$@" "$(VBOX_PATH_MAIN_SRC)/idl/stringify-enums.xsl" "$(VBOX_XIDL_FILE)"
952 $(QUIET)$(CP) --changed -fv -- "$@" "$(VBOX_AUTOGEN_STRINGIFY_ENUMS_H)"
953
954 $(call KB_FN_AUTO_CMD_DEPS,$(VBOX_AUTOGEN_STRINGIFY_ENUMS_CPP).ts)
955 $(VBOX_AUTOGEN_STRINGIFY_ENUMS_CPP).ts +| $(VBOX_AUTOGEN_STRINGIFY_ENUMS_CPP): $(VBOX_PATH_MAIN_SRC)/idl/stringify-enums.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
956 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
957 $(call MSG_TOOL,xsltproc,autogen enum stringifiers,$<,$@)
958 $(QUIET)$(VBOX_XSLTPROC) \
959 --stringparam G_kind source \
960 --stringparam g_uVBoxCopyrightYear "$(VBOX_C_YEAR)" \
961 -o "$@" "$(VBOX_PATH_MAIN_SRC)/idl/stringify-enums.xsl" "$(VBOX_XIDL_FILE)"
962 $(QUIET)$(CP) --changed -fv -- "$@" "$(VBOX_AUTOGEN_STRINGIFY_ENUMS_CPP)"
963
964 OTHER_CLEAN += $(VBOX_AUTOGEN_STRINGIFY_ENUMS_H).ts $(VBOX_AUTOGEN_STRINGIFY_ENUMS_H) $(VBOX_AUTOGEN_STRINGIFY_ENUMS_CPP).ts $(VBOX_AUTOGEN_STRINGIFY_ENUMS_CPP)
965
966 ifdef VBOX_WITH_XPCOM
967 #
968 # VBoxSVCM - VBoxSVC wrapper module
969 #
970 DLLS += VBoxSVCM
971 VBoxSVCM_TEMPLATE = VBoxMainComp
972 VBoxSVCM_DEFS = IN_RING3 $(VBOX_MAIN_DEFS)
973 ifdef VBOX_WITH_HARDENING
974 VBoxSVCM_DEFS += VBOX_WITH_HARDENING
975 endif
976 VBoxSVCM_INCS = \
977 include \
978 $(VBoxC_0_OUTDIR) \
979 .
980 VBoxSVCM_INTERMEDIATES = $(VBOX_MAIN_PREREQS)
981 VBoxSVCM_SOURCES = \
982 src-server/xpcom/server_module.cpp
983 VBoxSVCM_LDFLAGS.darwin = \
984 -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxSVCM.dylib \
985 -exported_symbols_list $(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def
986 ifeq ($(KBUILD_TARGET),darwin)
987 VBoxSVCM_ORDERDEPS += $(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def
988 VBoxSVCM_CLEAN += $(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def
989 $$(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def:
990 $(RM) -f $@
991 $(APPEND) $@ _NSGetModule
992 endif
993 VBoxSVCM_INTERMEDIATES += $(VBOX_IDL_HEADER.XPCOM)
994
995 # 32-bit version of the module.
996 ifdef VBOX_WITH_32_ON_64_MAIN_API
997 DLLS += VBoxSVCM-x86
998 VBoxSVCM-x86_TEMPLATE = VBoxMainComp-x86
999 VBoxSVCM-x86_EXTENDS = VBoxSVCM
1000 endif
1001
1002 endif # VBOX_WITH_XPCOM
1003
1004
1005 #
1006 # VBoxC module
1007 #
1008 DLLS += VBoxC
1009 VBoxC_TEMPLATE = VBoxMainComp
1010 if defined(VBOX_WITH_PRECOMPILED_HEADERS) && "$(KBUILD_TARGET)" == "win"
1011 VBoxC_USES = vccprecomp
1012 VBoxC_PCH_HDR := $(PATH_SUB_CURRENT)/src-client/win/precomp_vcc.h
1013 else if $(KBUILD_KMK_REVISION) >= 3256 && "$(KBUILD_TARGET)" != "darwin" && !defined(VBOX_WITHOUT_PRECOMPILED_HEADERS)
1014 if $(VBOX_GCC_VERSION_CXX) >= 50000 # GCC 4.x runs into trouble compiling the header.
1015 VBoxC_USES += gccprecomp
1016 VBoxC_PCH_HDR := $(PATH_SUB_CURRENT)/src-client/xpcom/precomp_gcc.h
1017 endif
1018 endif
1019 VBoxC_DEFS = \
1020 IN_RING3 \
1021 $(VBOX_MAIN_DEFS) \
1022 VBOX_COM_INPROC \
1023 $(if $(VBOX_WITH_EFI),VBOX_WITH_EFI,) \
1024 $(if $(VBOX_WITH_HGSMI),VBOX_WITH_HGSMI,) \
1025 $(if $(VBOX_WITH_VIDEOHWACCEL),VBOX_WITH_VIDEOHWACCEL,) \
1026 $(if $(VBOX_WITH_3D_ACCELERATION),VBOX_WITH_3D_ACCELERATION,) \
1027 $(if $(VBOX_WITH_DRAG_AND_DROP),VBOX_WITH_DRAG_AND_DROP,) \
1028 $(if $(VBOX_WITH_DRAG_AND_DROP_GH),VBOX_WITH_DRAG_AND_DROP_GH,) \
1029 $(if $(VBOX_WITH_USB),VBOX_WITH_USB,) \
1030 $(if $(VBOX_WITH_VRDEAUTH_IN_VBOXSVC),VBOX_WITH_VRDEAUTH_IN_VBOXSVC,) \
1031 $(if $(VBOX_WITH_IOMMU_AMD),VBOX_WITH_IOMMU_AMD,) \
1032 $(if $(VBOX_WITH_IOMMU_INTEL),VBOX_WITH_IOMMU_INTEL,) \
1033 $(if $(VBOX_WITH_TPM),VBOX_WITH_TPM,) \
1034 $(if $(VBOX_WITH_FULL_VM_ENCRYPTION),VBOX_WITH_FULL_VM_ENCRYPTION,) \
1035 $(if $(VBOX_WITH_VIRT_ARMV8),VBOX_WITH_VIRT_ARMV8,)
1036 ifdef VBOX_WITH_NETSHAPER
1037 VBoxC_DEFS += VBOX_WITH_NETSHAPER
1038 endif
1039 VBoxC_DEFS.darwin.x86 = VBOX_WITH_2X_4GB_ADDR_SPACE
1040 VBoxC_DEFS.win.x86 += _WIN32_WINNT=0x0500
1041 VBoxC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
1042 VBoxC_DEFS.win.arm64 += _WIN32_WINNT=0x0510
1043
1044 if $(KBUILD_TARGET) != "win" && $(VBOX_GCC_VERSION_CXX) >= 40900 # gcc 4.9.x (4.8.x is causing endless RT_ELEMENT trouble)
1045 # VBoxC_CXXFLAGS = -Wunused -Wconversion
1046 endif
1047
1048 VBoxC_SDKS = VBoxLibPng VBoxZlib
1049
1050 ifdef VBOX_WITH_RECORDING
1051 ifdef VBOX_WITH_LIBVPX
1052 VBoxC_SDKS += VBoxLibVpx
1053 VBoxC_DEFS += VBOX_WITH_LIBVPX
1054 endif
1055 VBoxC_SOURCES += \
1056 src-client/EBMLWriter.cpp \
1057 src-client/WebMWriter.cpp \
1058 src-client/Recording.cpp \
1059 src-client/RecordingInternals.cpp \
1060 src-client/RecordingCodec.cpp \
1061 src-client/RecordingStream.cpp \
1062 src-client/RecordingUtils.cpp
1063
1064 ifdef VBOX_WITH_AUDIO_RECORDING
1065 VBoxC_DEFS += VBOX_WITH_AUDIO_RECORDING
1066 # Needed in VBoxSVC for ISystemProperties.
1067 src-server/SystemPropertiesImpl.cpp_DEFS += VBOX_WITH_AUDIO_RECORDING
1068 ifdef VBOX_WITH_LIBOGG
1069 VBOX_MAIN_DEFS += VBOX_WITH_LIBOGG
1070 VBoxC_SDKS += VBoxLibOgg
1071 VBoxC_DEFS += VBOX_WITH_LIBOGG
1072 ## @todo We need this for libvorbis down below. Remove once the libvorbis @todo is resolved.
1073 VBoxSVC_SDKS += VBoxLibOgg
1074 endif
1075 ifdef VBOX_WITH_LIBVORBIS
1076 VBOX_MAIN_DEFS += VBOX_WITH_LIBVORBIS
1077 VBoxC_SDKS += VBoxLibVorbis
1078 ## @todo We also need to specify this for VBoxSVC, as we need to have VBOX_WITH_LIBVORBIS defined
1079 ## for SystemProperties::getSupportedRecordingAudioCodecs().
1080 # SystemPropertiesImpl_DEFS += VBOX_WITH_LIBVORBIS didn't work for precompiled headers on Windows --
1081 # needs to be solved properly so that we can remove the following _SDKS from VBoxSVC again.
1082 VBoxSVC_SDKS += VBoxLibVorbis
1083 endif
1084 VBoxC_SOURCES += src-client/DrvAudioRec.cpp
1085 endif # VBOX_WITH_AUDIO_RECORDING
1086 endif # VBOX_WITH_RECORDING
1087
1088 ifdef VBOX_WITH_OPENSSL_FIPS
1089 VBoxC_SDKS += VBoxOpenSsl
1090 endif
1091
1092 VBoxC_INCS = \
1093 include \
1094 $(VBoxC_0_OUTDIR) \
1095 $(VBOX_MAIN_APIWRAPPER_INCS) \
1096 $(dir $(VBOX_XML_SCHEMADEFS_H)) \
1097 $(VBOX_MAIN_APIWRAPPER_DIR)/dtrace \
1098 $(VBOX_GRAPHICS_INCS)
1099 VBoxC_INCS.win = \
1100 $(VBoxCOM_0_OUTDIR) \
1101 .
1102
1103 VBoxC_LDFLAGS.darwin = \
1104 -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxC.dylib \
1105 -exported_symbols_list $(VBoxC_0_OUTDIR)/VBoxC.def \
1106 -framework IOKit
1107 VBoxC_LDFLAGS.win += /MANIFEST \
1108 /DELAYLOAD:user32.dll
1109
1110
1111 VBoxC_LIBS += \
1112 $(PATH_STAGE_LIB)/VBoxAPIWrap$(VBOX_SUFF_LIB)
1113 VBoxC_LIBS.win += \
1114 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/psapi.lib \
1115 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib
1116 ifdef VBOX_WITH_NETFLT
1117 VBoxC_SDKS.win += VBoxWinNewDevLib
1118 VBoxC_LIBS.win += \
1119 $(PATH_STAGE_LIB)/WinNetConfigDll$(VBOX_SUFF_LIB) \
1120 $(PATH_STAGE_LIB)/VBoxDrvCfgDll$(VBOX_SUFF_LIB) \
1121 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
1122 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
1123 VBoxC_LDFLAGS.win += \
1124 /DELAYLOAD:newdev.dll \
1125 /DELAYLOAD:setupapi.dll \
1126 /DELAYLOAD:iphlpapi.dll
1127 endif
1128
1129 ifdef VBOX_WITH_DRAG_AND_DROP
1130 VBoxC_LIBS += $(PATH_STAGE_LIB)/VBoxDnDHostR3Lib$(VBOX_SUFF_LIB)
1131 endif
1132
1133 VBoxC_INTERMEDIATES = \
1134 $(VBOX_MAIN_PREREQS) \
1135 $(VBOX_XML_SCHEMADEFS_H) \
1136 $(VBOX_AUTOGEN_EVENT_H) \
1137 $(VBOX_AUTOGEN_STRINGIFY_ENUMS_H) \
1138 $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
1139
1140 VBoxC_SOURCES += \
1141 $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d \
1142 src-all/CryptoUtils.cpp \
1143 src-all/ConsoleSharedFolderImpl.cpp \
1144 src-all/DisplayPNGUtil.cpp \
1145 src-all/DisplayResampleImage.cpp \
1146 src-all/EventImpl.cpp \
1147 src-all/Global.cpp \
1148 src-all/GlobalStatusConversion.cpp \
1149 src-all/HashedPw.cpp \
1150 src-all/Logging.cpp \
1151 src-all/NvramStoreImpl.cpp \
1152 src-all/PCIDeviceAttachmentImpl.cpp \
1153 src-all/PlatformPropertiesImpl.cpp \
1154 src-all/ProgressImpl.cpp \
1155 src-all/SecretKeyStore.cpp \
1156 src-all/AutoCaller.cpp \
1157 src-all/ThreadTask.cpp \
1158 src-all/VirtualBoxBase.cpp \
1159 src-all/VirtualBoxErrorInfoImpl.cpp \
1160 $(if $(VBOX_WITH_EXTPACK),src-all/ExtPackManagerImpl.cpp src-all/ExtPackUtil.cpp,) \
1161 src-client/UsbWebcamInterface.cpp \
1162 $(if $(VBOX_WITH_USB_CARDREADER),src-client/UsbCardReader.cpp,) \
1163 src-client/AdditionsFacilityImpl.cpp \
1164 src-client/BusAssignmentManager.cpp \
1165 $(if $(VBOX_WITH_PCI_PASSTHROUGH),src-client/PCIRawDevImpl.cpp,) \
1166 src-client/ClientTokenHolder.cpp \
1167 src-client/ConsoleImpl.cpp \
1168 src-client/ConsoleImplConfigCommon.cpp \
1169 src-client/ConsoleImplConfigX86.cpp \
1170 $(if $(VBOX_WITH_VIRT_ARMV8),src-client/ConsoleImplConfigArmV8.cpp,) \
1171 src-client/ConsoleImplTeleporter.cpp \
1172 src-client/ConsoleVRDPServer.cpp \
1173 src-client/DisplayImpl.cpp \
1174 src-client/DisplayImplLegacy.cpp \
1175 src-client/DisplaySourceBitmapImpl.cpp \
1176 src-client/EmulatedUSBImpl.cpp \
1177 src-client/GuestImpl.cpp \
1178 src-client/GuestCtrlImpl.cpp \
1179 src-client/KeyboardImpl.cpp \
1180 src-client/MachineDebuggerImpl.cpp \
1181 src-client/MouseImpl.cpp \
1182 src-client/RemoteUSBDeviceImpl.cpp \
1183 $(if $(VBOX_WITH_VIRT_ARMV8),src-client/ResourceAssignmentManager.cpp,) \
1184 $(if $(VBOX_WITH_VIRT_ARMV8),src-client/ResourceStoreImpl.cpp,) \
1185 src-client/SessionImpl.cpp \
1186 src-client/USBDeviceImpl.cpp \
1187 src-client/VBoxDriversRegister.cpp \
1188 src-client/VirtualBoxClientImpl.cpp \
1189 src-client/VMMDevInterface.cpp \
1190 xml/Settings.cpp \
1191 $(VBOX_AUTOGEN_EVENT_CPP) \
1192 $(VBOX_AUTOGEN_STRINGIFY_ENUMS_CPP) \
1193 $(VBOX_XML_SCHEMADEFS_CPP)
1194
1195 ifdef VBOX_WITH_MAIN_NLS
1196 VBoxC_SOURCES += \
1197 src-all/VirtualBoxTranslator.cpp \
1198 src-all/QMTranslatorImpl.cpp
1199 endif
1200
1201 # Experimental cloud support
1202 if defined(VBOX_WITH_CLOUD_NET)
1203 if defined(VBOX_WITH_LIBSSH)
1204 VBoxC_SDKS += VBoxLibSsh VBoxOpenSsl
1205 VBoxC_DEFS += VBOX_WITH_LIBSSH
1206 endif
1207 VBoxC_SOURCES += src-client/CloudGateway.cpp
1208
1209 VBoxC_SOURCES += \
1210 $(VBoxC_0_OUTDIR)/VBoxLibSshLazyLoad.asm
1211 VBoxC_CLEAN += $(VBoxC_0_OUTDIR)/VBoxLibSshLazyLoad.asm
1212 $$(VBoxC_0_OUTDIR)/VBoxLibSshLazyLoad.asm: $(PATH_SUB_CURRENT)/src-all/VBoxLibSsh.def $(VBOX_DEF_2_LAZY_LOAD) | $$(dir $$@)
1213 $(call MSG_TOOL,VBoxDef2LazyLoad,VBoxC,$(filter %.def, $^),$@)
1214 $(QUIET)$(RM) -f -- "$@"
1215 $(VBOX_DEF_2_LAZY_LOAD) --explicit-load-function --library VBoxLibSsh --output "$@" $(filter %.def, $^)
1216
1217 endif
1218
1219 # Audio bits.
1220 VBoxC_SOURCES += \
1221 src-client/AudioDriver.cpp \
1222 $(if $(VBOX_WITH_AUDIO_VRDE),src-client/DrvAudioVRDE.cpp,)
1223
1224 VBoxC_SOURCES.win = \
1225 src-client/win/dllmain.cpp \
1226 src-client/win/VBoxC.def \
1227 src-client/win/VBoxC.rc
1228 ifdef VBOX_WITH_GUEST_CONTROL
1229 VBoxC_SOURCES += \
1230 src-client/GuestSessionImplTasks.cpp \
1231 src-client/GuestCtrlPrivate.cpp \
1232 src-client/GuestDirectoryImpl.cpp \
1233 src-client/GuestFileImpl.cpp \
1234 src-client/GuestFsInfoImpl.cpp \
1235 src-client/GuestFsObjInfoImpl.cpp \
1236 src-client/GuestProcessImpl.cpp \
1237 src-client/GuestSessionImpl.cpp
1238 endif
1239 ifdef VBOX_WITH_SHARED_CLIPBOARD
1240 VBoxC_SOURCES += \
1241 src-client/GuestShClPrivate.cpp
1242 endif
1243 ifdef VBOX_WITH_DRAG_AND_DROP
1244 VBoxC_SOURCES += \
1245 src-client/GuestDnDPrivate.cpp \
1246 src-client/GuestDnDSourceImpl.cpp \
1247 src-client/GuestDnDTargetImpl.cpp \
1248 $(PATH_ROOT)/src/VBox/GuestHost/DragAndDrop/DnDUtils.cpp
1249 endif
1250 ifdef VBOX_WITH_XPCOM
1251 VBoxC_SOURCES += \
1252 src-client/xpcom/module.cpp
1253 endif
1254 ifdef VBOX_WITH_HGCM
1255 VBoxC_SOURCES += \
1256 src-client/HGCMObjects.cpp \
1257 src-client/HGCMThread.cpp \
1258 src-client/HGCM.cpp
1259 endif
1260 ifdef VBOX_WITH_USB
1261 VBoxC_SOURCES += \
1262 src-client/RemoteUSBBackend.cpp
1263 endif
1264 ifndef VBOX_WITH_VRDEAUTH_IN_VBOXSVC
1265 VBoxC_SOURCES += \
1266 src-all/AuthLibrary.cpp
1267 endif
1268
1269 $(call KB_FN_DO_PASS0_ON_TARGET,VBoxC) # Sets VBoxC_0_OUTDIR
1270
1271 ifeq ($(KBUILD_TARGET),darwin)
1272 VBoxC_ORDERDEPS += $(VBoxC_0_OUTDIR)/VBoxC.def
1273 VBoxC_CLEAN += $(VBoxC_0_OUTDIR)/VBoxC.def
1274 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxC_0_OUTDIR)/VBoxC.def)
1275 $(VBoxC_0_OUTDIR)/VBoxC.def:
1276 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1277 $(RM) -f $@
1278 $(APPEND) $@ _NSGetModule
1279 $(APPEND) $@ _VBoxDriversRegister
1280 endif
1281
1282 src-client/ConsoleImpl.cpp_DEFS = \
1283 $(if $(VBOX_WITH_OPENSSL_FIPS), VBOX_OPENSSL_FIPS,)
1284
1285
1286 src-client/win/VBoxC.rc_DEPS = $(VBoxC_0_OUTDIR)/VBoxC.rgs $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb
1287 VBoxC_CLEAN.win += $(VBoxC_0_OUTDIR)/VBoxC.rgs
1288 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxC_0_OUTDIR)/VBoxC.rgs)
1289 $(VBoxC_0_OUTDIR)/VBoxC.rgs: $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
1290 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1291 $(VBOX_XSLTPROC) \
1292 --stringparam Application VirtualBox \
1293 --stringparam Module VBoxC \
1294 -o $@ \
1295 $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl \
1296 $(VBOX_XIDL_FILE)
1297
1298 ifdef VBOX_WITH_32_ON_64_MAIN_API
1299 #
1300 # 32-bit VBox API Client In-Process module.
1301 #
1302 # This is currently just a 32-bit version of VBoxC. It might be desirable to
1303 # split up VBoxC into a simple client and a VM client part later, in which
1304 # case this module will be a simple client.
1305 #
1306 # Note! One important thing is that the typelib for this DLL must be build
1307 # with the /env win32 switch and the VBoxC typelib with /env amd64, if
1308 # not they will overwrite each others typelib module entry.
1309 #
1310 DLLS += VBoxClient-x86
1311 VBoxClient-x86_TEMPLATE = VBoxMainComp-x86
1312 VBoxClient-x86_EXTENDS = VBoxC
1313 if defined(VBOX_WITH_PRECOMPILED_HEADERS) && "$(KBUILD_TARGET)" == "win" ## @todo fix inheritance (fixed in r3253)
1314 VBoxClient-x86_USES = vccprecomp
1315 VBoxClient-x86_PCH_HDR := $(PATH_SUB_CURRENT)/src-client/win/precomp_vcc.h
1316 endif
1317 VBoxClient-x86_SDKS = $(filter-out VBoxLibVpx,$(VBoxC_SDKS))
1318 VBoxClient-x86_DEFS = VBOX_COM_INPROC_API_CLIENT \
1319 $(filter-out VBOX_WITH_RECORDING VBOX_WITH_AUDIO_RECORDING \
1320 VBOX_WITH_LIBVPX,$(VBoxC_DEFS))
1321 VBoxClient-x86_INCS.win = \
1322 $(VBoxClient-x86_0_OUTDIR) \
1323 $(VBoxCOM-x86_0_OUTDIR) \
1324 $(VBoxC_INCS.win)
1325 VBoxClient-x86_SOURCES = \
1326 src-all/EventImpl.cpp \
1327 src-all/Global.cpp \
1328 src-all/GlobalStatusConversion.cpp \
1329 src-all/AutoCaller.cpp \
1330 src-all/ThreadTask.cpp \
1331 src-all/VirtualBoxBase.cpp \
1332 src-all/VirtualBoxErrorInfoImpl.cpp \
1333 src-client/ClientTokenHolder.cpp \
1334 src-client/SessionImpl.cpp \
1335 src-client/VirtualBoxClientImpl.cpp \
1336 $(VBOX_AUTOGEN_EVENT_CPP) \
1337 $(VBOX_AUTOGEN_STRINGIFY_ENUMS_CPP) \
1338 $(VBOX_XML_SCHEMADEFS_CPP)
1339 ifdef VBOX_WITH_MAIN_NLS
1340 VBoxClient-x86_SOURCES += \
1341 src-all/VirtualBoxTranslator.cpp \
1342 src-all/QMTranslatorImpl.cpp
1343 endif
1344 VBoxClient-x86_SOURCES.win = \
1345 src-client/win/dllmain.cpp \
1346 src-client/win/VBoxClient-x86.def \
1347 src-client/win/VBoxClient-x86.rc
1348 ifdef VBOX_WITH_XPCOM
1349 VBoxClient-x86_SOURCES += \
1350 src-client/xpcom/module.cpp
1351 endif
1352 VBoxClient-x86_LIBS = \
1353 $(PATH_STAGE_LIB)/VBoxAPIWrap-x86$(VBOX_SUFF_LIB)
1354 VBoxClient-x86_LIBS.win = $(NO_SUCH_VARIABLE)
1355 VBoxClient-x86_LIBS.win.x86 += \
1356 $(PATH_TOOL_$(VBOX_VCC_TOOL_STEM)X86_LIB)/delayimp.lib \
1357 $(PATH_SDK_$(VBOX_WINPSDK)_LIB.x86)/WbemUuid.Lib
1358 VBoxClient-x86_CLEAN.win += $(VBoxClient-x86_0_OUTDIR)/VBoxClient-x86.rgs
1359 $(call KB_FN_DO_PASS0_ON_TARGET,VBoxClient-x86) # Sets VBoxClient-x86_0_OUTDIR
1360
1361 src-client/win/VBoxClient-x86.rc_DEPS = \
1362 $(VBoxClient-x86_0_OUTDIR)/VBoxClient-x86.rgs \
1363 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox-x86.tlb
1364
1365 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxClient-x86_0_OUTDIR)/VBoxClient-x86.rgs)
1366 $(VBoxClient-x86_0_OUTDIR)/VBoxClient-x86.rgs: \
1367 $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl \
1368 $(VBOX_XIDL_FILE) | $$(dir $$@)
1369 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1370 $(VBOX_XSLTPROC) \
1371 --stringparam Application VirtualBox \
1372 --stringparam Module VBoxC \
1373 -o $@ \
1374 $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl \
1375 $(VBOX_XIDL_FILE)
1376 endif
1377
1378 #
1379 # The VBoxExtPackHelperApp.
1380 #
1381 ifdef VBOX_WITH_EXTPACK
1382 PROGRAMS += VBoxExtPackHelperApp
1383 VBoxExtPackHelperApp_TEMPLATE = VBoxR3SetUidToRoot
1384 VBoxExtPackHelperApp_LDFLAGS.darwin = -framework Security
1385 VBoxExtPackHelperApp_LDFLAGS.win = /SUBSYSTEM:windows
1386 VBoxExtPackHelperApp_SOURCES = \
1387 src-helper-apps/VBoxExtPackHelperApp.cpp \
1388 src-all/ExtPackUtil.cpp
1389 VBoxExtPackHelperApp_SOURCES.win = \
1390 src-helper-apps/VBoxExtPackHelperApp.rc
1391 VBoxExtPackHelperApp_LIBS = \
1392 $(LIB_RUNTIME)
1393 endif # VBOX_WITH_EXTPACK
1394
1395
1396endif # !defined(VBOX_ONLY_SDK) && !defined(VBOX_ONLY_EXTPACKS) (the ifndef is far above)
1397
1398
1399#
1400# VBoxCOM - COM Abstraction Layer library
1401#
1402ifndef VBOX_ONLY_SDK
1403 LIBRARIES += VBoxCOM
1404endif
1405VBoxCOM_TEMPLATE = VBoxMainLib
1406VBoxCOM_INTERMEDIATES = $(VBOX_MAIN_PREREQS) \
1407 $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
1408VBoxCOM_SOURCES = \
1409 glue/com.cpp \
1410 glue/VBoxLogRelCreate.cpp \
1411 glue/GetVBoxUserHomeDirectory.cpp \
1412 glue/initterm.cpp \
1413 glue/string.cpp \
1414 glue/string-base64.cpp \
1415 glue/AutoLock.cpp \
1416 glue/EventQueue.cpp \
1417 glue/NativeEventQueue.cpp \
1418 glue/ErrorInfo.cpp \
1419 glue/errorprint.cpp
1420VBoxCOM_INCS += $(VBOX_MAIN_APIWRAPPER_INCS) \
1421 include
1422ifeq ($(KBUILD_TARGET),win)
1423 ifdef VBOX_WITH_MIDL_PROXY_STUB
1424 VBoxCOM_DEFS.win = VBOX_WITH_AUTO_COM_REG_UPDATE
1425 endif
1426 ifdef VBOX_WITH_SDS
1427 VBoxCOM_DEFS.win += VBOX_WITH_SDS
1428 endif
1429 VBoxCOM_DEFS.x86 = _WIN32_WINNT=0x0500
1430 VBoxCOM_DEFS.amd64 = _WIN32_WINNT=0x0510
1431 VBoxCOM_DEFS.arm64 = _WIN32_WINNT=0x0510
1432 VBoxCOM_SOURCES += \
1433 $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c
1434 VBoxCOM_CLEAN = \
1435 $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
1436 $(VBoxCOM_0_OUTDIR)/VirtualBox_p.c \
1437 $(VBoxCOM_0_OUTDIR)/dlldata.c \
1438 $(VBoxCOM_0_OUTDIR)/VirtualBox.h \
1439 $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb
1440 VBoxCOM_CLEAN += \
1441 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_i.c \
1442 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_p.c \
1443 $(VBoxCOM_0_OUTDIR)/legacy/dlldata.c \
1444 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.h \
1445 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.tlb
1446 VBoxCOM_BLDDIRS = $(VBoxCOM_0_OUTDIR)/legacy/
1447else # !win
1448 VBoxCOM_SOURCES += \
1449 $(VBoxCOM_0_OUTDIR)/VirtualBox_XPCOM_i.c \
1450 glue/xpcom/helpers.cpp
1451endif # !win
1452
1453ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
1454 glue/VBoxLogRelCreate.cpp_DEFS = KBUILD_TYPE="$(KBUILD_TYPE)"
1455else
1456 glue/VBoxLogRelCreate.cpp_DEFS = KBUILD_TYPE=\"$(KBUILD_TYPE)\"
1457endif
1458
1459# A couple of tricks to define VBoxCOM_0_OUTDIR for SDK builds and mkdir rule.
1460$(call KB_FN_DO_PASS0_ON_TARGET,VBoxCOM)
1461BLDDIRS += $(VBoxCOM_0_OUTDIR)
1462
1463
1464ifndef VBOX_ONLY_SDK
1465
1466 # 32-bit version of VBoxCOM.
1467 if defined(VBOX_WITH_32_ON_64_MAIN_API) && !defined(VBOX_ONLY_EXTPACKS)
1468 LIBRARIES += VBoxCOM-x86
1469 VBoxCOM-x86_TEMPLATE = VBoxMainLib-x86
1470 VBoxCOM-x86_EXTENDS = VBoxCOM
1471 ifeq ($(KBUILD_TARGET),win)
1472 VBoxCOM-x86_CLEAN = \
1473 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c \
1474 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_p.c \
1475 $(VBoxCOM-x86_0_OUTDIR)/dlldata.c \
1476 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox.h \
1477 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox-x86.tlb
1478 endif
1479 endif
1480
1481 # -MD version for the GUI in -MDd builds.
1482 ifeq ($(KBUILD_TARGET).$(VBOX_VCC_CRT_TYPE),win.d)
1483 ifndef VBOX_ONLY_EXTPACKS
1484 LIBRARIES += VBoxCOM-GUI
1485 USES += qt6
1486 VBoxCOM-GUI_TEMPLATE = $(if-expr defined(VBOX_WITH_HARDENING),VBoxQtGuiDll,VBoxQtGuiExe)
1487 VBoxCOM-GUI_EXTENDS = VBoxCOM
1488 endif
1489 endif
1490
1491 # define qt6 tools for translation even if VBOX_ONLY_EXTPACKS is enabled
1492 ifdef VBOX_WITH_NLS
1493 USES += qt6
1494 endif
1495
1496endif # !VBOX_ONLY_SDK
1497
1498
1499#
1500# Installs com related thing(s) to bin.
1501#
1502INSTALLS.win += VBoxMain-com-inst
1503VBoxMain-com-inst_INST = $(INST_BIN)
1504VBoxMain-com-inst_MODE = a+r,u+w
1505VBoxMain-com-inst_SOURCES = src-all/win/comregister.cmd
1506
1507
1508if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "linux" && !defined(VBOX_ONLY_EXTPACKS)
1509 #
1510 # Installs linux/hardening related things to components.
1511 #
1512 INSTALLS.linux += VBoxMain-hardening-inst
1513 VBoxMain-hardening-inst_INST = $(INST_BIN)components/
1514 VBoxMain-hardening-inst_SYMLINKS = \
1515 VBoxDDU.so=>../VBoxDDU.so \
1516 VBoxRT.so=>../VBoxRT.so \
1517 VBoxVMM.so=>../VBoxVMM.so \
1518 VBoxXPCOM.so=>../VBoxXPCOM.so
1519endif
1520
1521
1522if defined(VBOX_WITH_MIDL_PROXY_STUB) && "$(KBUILD_TARGET)" == "win" && !defined(VBOX_ONLY_EXTPACKS) && !defined(VBOX_ONLY_SDK)
1523 #
1524 # Experimental COM proxy + stub DLL w/ automatic registration updating.
1525 #
1526 # The Legacy stub is for older 64-bit windows versions (pre Windows 7) as we
1527 # were having various problems on windows server 2003 and 2008 with the code
1528 # MIDL generated. Also, in windows 7 there are some potentially interesting
1529 # changes in the generated code where it uses new helpers from OLE32.
1530 #
1531 DLLS += VBoxProxyStub
1532 VBoxProxyStub_TEMPLATE = VBoxMainComp
1533 ifdef VBOX_WITH_AUTOMATIC_DEFS_QUOTING
1534 VBoxProxyStub_DEFS := REGISTER_PROXY_DLL PROXY_CLSID_IS=$(quote $(VBOX_MIDL_PROXY_CLSID_IS))
1535 else
1536 VBoxProxyStub_DEFS := REGISTER_PROXY_DLL PROXY_CLSID_IS="$(VBOX_MIDL_PROXY_CLSID_IS)"
1537 endif
1538 ifdef VBOX_WITH_SDS
1539 VBoxProxyStub_DEFS += VBOX_WITH_SDS
1540 endif
1541 ifdef VBOX_WITH_SDS_CLIENT_WATCHER
1542 VBoxProxyStub_DEFS += VBOX_WITH_SDS_CLIENT_WATCHER,)
1543 endif
1544 VBoxProxyStub_DEFS.win.x86 = WIN32
1545 VBoxProxyStub_DEFS.win.arm64 = WIN32
1546 VBoxProxyStub_SDKS = VBoxNtDll
1547 VBoxProxyStub_DEFPATH = $(VBoxCOM_0_OUTDIR)/# Hack to workaround drive letter in $(VBoxCOM_0_OUTDIR)/ for CFLAGS hack below.
1548 VBoxProxyStub_INCS = $(VBoxCOM_0_OUTDIR)/
1549 VBoxProxyStub_SOURCES := \
1550 VirtualBox_p.c \
1551 VirtualBox_i.c \
1552 $(PATH_SUB_CURRENT)/src-all/win/VBoxProxyStub.def \
1553 $(PATH_SUB_CURRENT)/src-all/win/VBoxProxyStub.rc \
1554 $(PATH_SUB_CURRENT)/src-all/win/VBoxProxyStub.c
1555 src-all/win/VBoxProxyStub.rc_DEPS = $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb
1556 VBoxProxyStub_VirtualBox_p.c_CFLAGS.x86 = /Gz # Workaround for incorrect ObjectStublessClient* prototypes in SDK v7.1.
1557
1558 ifn1of ($(KBUILD_TARGET_ARCH), arm64)
1559 DLLS += VBoxProxyStubLegacy
1560 VBoxProxyStubLegacy_TEMPLATE = VBoxMainComp
1561 VBoxProxyStubLegacy_EXTENDS = VBoxProxyStub
1562 VBoxProxyStubLegacy_DEFS = $(VBoxProxyStub_DEFS) VBOX_IN_PROXY_STUB_LEGACY
1563 VBoxProxyStubLegacy_INCS = $(VBoxCOM_0_OUTDIR)/legacy/
1564 VBoxProxyStubLegacy_SOURCES = \
1565 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_p.c \
1566 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_i.c \
1567 src-all/win/VBoxProxyStub.def \
1568 src-all/win/VBoxProxyStubLegacy.rc \
1569 src-all/win/VBoxProxyStub.c
1570 src-all/win/VBoxProxyStubLegacy.rc_DEPS = $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.tlb
1571 endif
1572
1573 ifdef VBOX_WITH_32_ON_64_MAIN_API
1574 DLLS += VBoxProxyStub-x86
1575 VBoxProxyStub-x86_TEMPLATE = VBoxMainComp-x86
1576 VBoxProxyStub-x86_SDKS = VBoxNtDll
1577 VBoxProxyStub-x86_DEFS = $(VBoxProxyStub_DEFS) VBOX_PROXY_STUB_32_ON_64 WIN32
1578 VBoxProxyStub-x86_INCS = $(VBoxCOM-x86_0_OUTDIR)/
1579 VBoxProxyStub-x86_SOURCES = \
1580 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_p.c \
1581 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c \
1582 src-all/win/VBoxProxyStub.c \
1583 src-all/win/VBoxProxyStub-x86.rc \
1584 src-all/win/VBoxProxyStub.def
1585 src-all/win/VBoxProxyStub-x86.rc_DEPS = $(VBoxCOM-x86_0_OUTDIR)/VirtualBox-x86.tlb
1586 endif
1587endif
1588
1589
1590ifdef VBOX_WITH_MAIN_NLS
1591 #
1592 # NLS stuff.
1593 #
1594 include $(PATH_SUB_CURRENT)/nls/ApprovedLanguages.kmk
1595
1596 PROGRAMS += VirtualBoxAPI
1597 VirtualBoxAPI_TEMPLATE = VBoxNLS
1598 VirtualBoxAPI_QT_TRANSLATIONS = $(addsuffix .ts,$(addprefix $(VBOX_PATH_MAIN_SRC)/nls/VirtualBoxAPI_,$(VBOX_APPROVED_MAIN_LANGUAGES)))
1599 VirtualBoxAPI_VBOX_ALL_NLS_SOURCES = $(wildcard \
1600 $(VBOX_PATH_MAIN_SRC)/include/*.h \
1601 $(VBOX_PATH_MAIN_SRC)/src-all/*.cpp \
1602 $(VBOX_PATH_MAIN_SRC)/src-all/*.h \
1603 $(VBOX_PATH_MAIN_SRC)/src-server/*.cpp \
1604 $(VBOX_PATH_MAIN_SRC)/src-server/*.h \
1605 $(VBOX_PATH_MAIN_SRC)/src-client/*.cpp \
1606 $(VBOX_PATH_MAIN_SRC)/src-client/*.h )
1607
1608 updatenls:: makeallnls $(VBOX_PATH_MAIN_SRC)/nls/VirtualBoxAPI_en.ts
1609
1610 makeallnls:: $(VirtualBoxAPI_VBOX_ALL_NLS_SOURCES)
1611 $(call MSG_L1,lupdate all languages (nls/*.ts))
1612 $(QUIET)$(TOOL_QT6_LUPDATE) \
1613 $^ \
1614 -ts \
1615 $(filter-out nls/VirtualBoxAPI_en.ts, $(VirtualBoxAPI_QT_TRANSLATIONS)) \
1616 $(VBOX_PATH_MAIN_SRC)/nls/VirtualBoxAPI_xx_YY.ts
1617
1618 #fake-main-nls:
1619 # $(foreach file, $(VirtualBoxAPI_QT_TRANSLATIONS) \
1620 # ,$(NLTAB)$(SED) -i \
1621 # -e '/<source>.*<\/source>/h' \
1622 # -e '/<source>.*<\/source>/p' \
1623 # -e '/<translation type="unfinished"><\/translation>/{' \
1624 # -e 'x' \
1625 # -e 's/<source>\(.*\)<\/source>/<translation type="unfinished">$(notdir $(file)): \1<\/translation>/' \
1626 # -e '}' \
1627 # $(file) )
1628
1629
1630 # Create the English translation file. This is something special cause it will
1631 # contain the plural forms only.
1632 $(VBOX_PATH_MAIN_SRC)/nls/VirtualBoxAPI_en.ts: $(VirtualBoxAPI_VBOX_ALL_NLS_SOURCES)
1633 $(call MSG_L1,lupdate $@)
1634 $(QUIET)$(TOOL_QT6_LUPDATE) \
1635 $^ \
1636 -ts \
1637 "$@"
1638 $(QUIET)$(SED) -n -i \
1639 -e '/<context>/,/<\/context>/!p' \
1640 -e '/<context>/h' \
1641 -e '/<name>/H' \
1642 -e '/<message numerus="yes">/,/<\/message>/H' \
1643 -e '/<\/context>/{H;x;/<message/p}' \
1644 "$@"
1645
1646endif # VBOX_WITH_MAIN_NLS
1647
1648
1649# generate rules
1650include $(FILE_KBUILD_SUB_FOOTER)
1651
1652
1653
1654#
1655# Additions rules.
1656#
1657
1658## @todo this hack ain't cutting it any longer. (the file name is abspath'ed since ages now.)
1659glue/xpcom/helpers.cpp: $(VBOX_IDL_TYPELIB.XPCOM)
1660
1661$(call KB_FN_AUTO_CMD_DEPS_EX,$(VBOX_IDL_FILE.XPCOM),$(PATH_OUT)/VBOX_IDL_FILE.XPCOM.vbox-dep)
1662$(VBOX_IDL_FILE.XPCOM): $(VBOX_PATH_MAIN_SRC)/idl/xpidl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
1663 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS_EX,$(PATH_OUT)/VBOX_IDL_FILE.XPCOM.vbox-dep)
1664 $(call MSG_TOOL,xsltproc,VBoxSVC,$(VBOX_PATH_MAIN_SRC)/idl/xpidl.xsl,$@)
1665 $(QUIET)$(VBOX_XSLTPROC) -o $@ $(VBOX_PATH_MAIN_SRC)/idl/xpidl.xsl $(VBOX_XIDL_FILE)
1666
1667$(call KB_FN_AUTO_CMD_DEPS_EX,$(VBOX_IDL_TYPELIB.XPCOM),$(PATH_OUT)/VBOX_IDL_TYPELIB.XPCOM.vbox-dep)
1668$(VBOX_IDL_TYPELIB.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
1669 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS_EX,$(PATH_OUT)/VBOX_IDL_TYPELIB.XPCOM.vbox-dep)
1670 $(call MSG_TOOL,xpidl,VBoxSVC,$(VBOX_IDL_FILE.XPCOM),$@)
1671 $(QUIET)$(VBOX_XPIDL_ENV)$(VBOX_XPIDL) -m typelib -I $(VBOX_PATH_XPCOM_IDL) -e $@ $(VBOX_IDL_FILE.XPCOM)
1672 $(CHMOD) 0644 $@
1673## @todo ^^^^^^^^^^^^ fix horrible hack
1674
1675$(call KB_FN_AUTO_CMD_DEPS_EX,$(VBOX_IDL_HEADER.XPCOM),$(PATH_OUT)/VBOX_IDL_HEADER.XPCOM.vbox-dep)
1676$(VBOX_IDL_HEADER.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
1677 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS_EX,$(PATH_OUT)/VBOX_IDL_HEADER.XPCOM.vbox-dep)
1678 $(call MSG_TOOL,xpidl,VBoxSVC,$(VBOX_IDL_FILE.XPCOM),$@)
1679 $(QUIET)$(VBOX_XPIDL_ENV)$(VBOX_XPIDL) -m header -I $(VBOX_PATH_XPCOM_IDL) -e $@ $(VBOX_IDL_FILE.XPCOM)
1680
1681$(call KB_FN_AUTO_CMD_DEPS_EX,$(VBOX_IDL_FILE.MSCOM),$(PATH_OUT)/VBOX_IDL_FILE.MSCOM.vbox-dep)
1682$(VBOX_IDL_FILE.MSCOM): $(VBOX_PATH_MAIN_SRC)/idl/midl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
1683 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS_EX,$(PATH_OUT)/VBOX_IDL_FILE.MSCOM.vbox-dep)
1684 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
1685 $(QUIET)$(VBOX_XSLTPROC) -o $@ \
1686 $(if $(VBOX_WITH_MIDL_PROXY_STUB),-stringparam g_fGenProxy yes,) \
1687 $(if $(VBOX_WITH_SDS),-stringparam g_fVBoxWithSDS yes,) \
1688 $(VBOX_PATH_MAIN_SRC)/idl/midl.xsl $(VBOX_XIDL_FILE)
1689
1690
1691# Aliases for testing purposes.
1692ifdef VBOX_WITH_XPCOM
1693 testidl: $(VBOX_IDL_FILE.XPCOM) $(VBOX_IDL_TYPELIB.XPCOM) $(VBoxCOM_0_OUTDIR)/VirtualBox_XPCOM_i.c
1694 testidlhdr: $(VBOX_IDL_HEADER.XPCOM)
1695else
1696 testidl: $(VBOX_IDL_FILE.MSCOM) $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
1697 $(if $(VBOX_WITH_32_ON_64_MAIN_API),$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c,)
1698endif
1699
1700
1701$(VBoxCOM_0_OUTDIR)/VirtualBox_XPCOM_i.c: $(VBOX_PATH_MAIN_SRC)/idl/xpidl_iid.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
1702 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
1703 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
1704
1705if "$(KBUILD_TARGET)" == "win" || (defined(VBOX_ONLY_SDK) && !defined(VBOX_ONLY_SDK_ON_HOST) && !defined(VBOX_ONLY_SDK_IN_VM))
1706
1707 # Note! Because we've got a different proxy stub DLL for pre windows 7 64-bit hosts, we target windows 7 for AMD64.
1708 # The output is different and hopefully more efficient, at least memory wise (using more helpers in OLE32).
1709 # Note! We're checking for win.amd64 below when setting the target because of the SDK build which happens on linux.amd64
1710 # but with a 32-bit Wine.
1711 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxCOM_0_OUTDIR)/VirtualBox_i.c)
1712 $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
1713 $(if $(VBOX_WITH_MIDL_PROXY_STUB), + $(VBoxCOM_0_OUTDIR)/VirtualBox_p.c + $(VBoxCOM_0_OUTDIR)/dlldata.c,) \
1714 + $(VBoxCOM_0_OUTDIR)/VirtualBox.h \
1715 + $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb: $(VBOX_IDL_FILE.MSCOM) | $$(dir $$@)
1716 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1717 $(VBOX_MIDL_REDIRECT) $(VBOX_WIN_MIDL) /nologo /W4 \
1718 /env $(if-expr "$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)" == "win.amd64" ,amd64,$(if-expr "$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)" == "win.arm64" ,arm64,win32)) \
1719 /robust /protocol all /target $(if-expr defined(VBOX_WITH_MIDL_PROXY_STUB),NT61,NT51) \
1720 /out $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxCOM_0_OUTDIR)) \
1721 /cpp_cmd $(VBOX_MIDL_CPP_CMD) \
1722 $(foreachfile dir,$(SDK_$(VBOX_WINPSDK)_INCS),/I $(call VBOX_FN_MAKE_WIN_PATH,$(dir))) \
1723 /I idl \
1724 $(call VBOX_FN_MAKE_WIN_PATH,$(VBOX_IDL_FILE.MSCOM))
1725 $(call def_VBoxMidlOutputDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/VirtualBox.h)
1726 $(call def_VBoxMidlOutputDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/VirtualBox_i.c)
1727 $(call def_VBoxMidlOutputDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/VirtualBox_p.c)
1728
1729 if defined(VBOX_WITH_MIDL_PROXY_STUB)
1730 # -Windows Server 2003 AMD64 SP1 does not like the result when using '/protocol all' and '/target NT51'.
1731 # -Vista AMD64 SP1 and Windows Server 2008 AMD64 seems to have some objections as well, but it seemed
1732 # that using an older MIDL compiler (v7.00.0499 instead of v7.00.0555) helps. But the W2K3 fix also works.
1733 # To avoid 32-bit vs. 64-bit differences, we do the same for 32-bit windows versions.
1734 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_i.c)
1735 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_i.c \
1736 + $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_p.c \
1737 + $(VBoxCOM_0_OUTDIR)/legacy/dlldata.c \
1738 + $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.h \
1739 + $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.tlb: $(VBOX_IDL_FILE.MSCOM) | $$(dir $$@)
1740 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1741 $(VBOX_MIDL_REDIRECT) $(VBOX_WIN_MIDL) /nologo /W4 \
1742 $(if-expr "$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)" == "win.amd64" \
1743 ,/env amd64 /x64 /target NT50 /robust \
1744 ,/env win32 /target NT51 /robust /protocol all ) \
1745 /out $(call VBOX_FN_MAKE_WIN_PATH,$(dir $@)) \
1746 /cpp_cmd $(VBOX_MIDL_CPP_CMD) \
1747 $(foreachfile dir,$(SDK_$(VBOX_WINPSDK)_INCS),/I $(call VBOX_FN_MAKE_WIN_PATH,$(dir))) \
1748 /I idl \
1749 $(call VBOX_FN_MAKE_WIN_PATH,$(VBOX_IDL_FILE.MSCOM))
1750 $(call def_VBoxMidlOutputDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.h)
1751 $(call def_VBoxMidlOutputDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_i.c)
1752 $(call def_VBoxMidlOutputDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_p.c)
1753 endif
1754
1755 if defined(VBOX_WITH_32_ON_64_MAIN_API) && !defined(VBOX_ONLY_EXTPACKS)
1756 # The XP targetted 32-bit proxy stub works with all versions of windows (the
1757 # issues leading to the VBoxProxyStubLegacy.dll are only on 64-bit windows).
1758 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c)
1759 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c \
1760 $(if $(VBOX_WITH_MIDL_PROXY_STUB), + $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_p.c + $(VBoxCOM-x86_0_OUTDIR)/dlldata.c,) \
1761 + $(VBoxCOM-x86_0_OUTDIR)/VirtualBox.h \
1762 + $(VBoxCOM-x86_0_OUTDIR)/VirtualBox-x86.tlb: $(VBOX_IDL_FILE.MSCOM) | $$(dir $$@)
1763 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1764 $(VBOX_MIDL_REDIRECT_X86) $(VBOX_WIN_MIDL) /nologo /W4 \
1765 /env win32 /target NT51 /robust /protocol all \
1766 /out $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxCOM-x86_0_OUTDIR)) \
1767 /tlb $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox-x86.tlb) \
1768 /cpp_cmd $(VBOX_MIDL_CPP_CMD_X86) \
1769 $(foreachfile dir,$(SDK_$(VBOX_WINPSDK)_INCS),/I $(call VBOX_FN_MAKE_WIN_PATH,$(dir))) \
1770 /I idl \
1771 $(call VBOX_FN_MAKE_WIN_PATH,$(VBOX_IDL_FILE.MSCOM))
1772 $(call def_VBoxMidlOutputDisableMscWarnings,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox.h)
1773 $(call def_VBoxMidlOutputDisableMscWarnings,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c)
1774 $(call def_VBoxMidlOutputDisableMscWarnings,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_p.c)
1775 endif
1776
1777endif # "$(KBUILD_TARGET)" == "win" || (defined(VBOX_ONLY_SDK) && !defined(VBOX_ONLY_SDK_ON_HOST) && !defined(VBOX_ONLY_SDK_IN_VM))
1778
1779#
1780# Translation stuff
1781#
1782VBoxSVC_VBOX_HEADERS = \
1783 include/collection.h \
1784 include/MachineImpl.h
1785VBoxSVC_VBOX_TRANSLATIONS = \
1786 nls/VBoxSVC_de.ts
1787
1788VBoxC_VBOX_HEADERS = \
1789 include/ConsoleImpl.h
1790
1791VBoxC_VBOX_INTERMEDIATES = $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
1792VBoxC_VBOX_HEADERS += $(VBOX_MAIN_APIWRAPPER_INCS)
1793
1794VBoxC_VBOX_TRANSLATIONS = \
1795 nls/VBoxC_de.ts
1796
1797ifdef VBOX_WITH_JMSCOM
1798
1799 #
1800 # Java glue JAR files
1801 #
1802 VBOX_JMSCOM_JAR = $(VBoxJMscom-inst-jar_0_OUTDIR)/vboxjmscom.jar
1803 VBOX_JMSCOM_TARGET := $(PATH_TARGET)/vboxjmscom-gen
1804 VBOX_JMSCOM_GEN = $(VBOX_JMSCOM_TARGET)/jmscomgen
1805 VBOX_JMSCOM_JDEST := $(VBOX_JMSCOM_TARGET)/jdest
1806 VBOX_GLUE_XSLT_DIR := $(PATH_ROOT)/src/VBox/Main/glue
1807 VBOX_JACOB_DIR := $(PATH_ROOT)/src/libs/jacob-1.17
1808
1809 INSTALLS += VBoxJMscom-inst-jar
1810 VBoxJMscom-inst-jar_INST = $(INST_SDK)bindings/mscom/java/
1811 VBoxJMscom-inst-jar_MODE = a+r,u+w
1812 VBoxJMscom-inst-jar_SOURCES = \
1813 $(VBoxJMscom-inst-jar_0_OUTDIR)/vboxjmscom.jar
1814 VBoxJMscom-inst-jar_CLEAN = \
1815 $(VBoxJMscom-inst-jar_0_OUTDIR)/vboxjmscom.jar \
1816 $(VBOX_JMSCOM_GEN)/jmscomglue.list \
1817 $(wildcard \
1818 $(VBOX_JMSCOM_GEN)/java/*.java \
1819 $(VBOX_JMSCOM_JDEST)/*.class \
1820 $(VBOX_JMSCOM_JDEST)/*/*.class \
1821 $(VBOX_JMSCOM_JDEST)/*/*/*.class \
1822 $(VBOX_JMSCOM_JDEST)/*/*/*/*.class \
1823 )
1824 VBoxJMscom-inst-jar_BLDDIRS += $(VBOX_JMSCOM_GEN)/java
1825 $(call KB_FN_DO_PASS0_ON_TARGET,VBoxJMscom-inst-jar) # Sets VBoxJMscom-inst-jar_0_OUTDIR
1826
1827 $(call KB_FN_AUTO_CMD_DEPS,$(VBOX_JMSCOM_GEN)/jmscomglue.list)
1828 $(VBOX_JMSCOM_GEN)/jmscomglue.list: \
1829 $(VBOX_XIDL_FILE) \
1830 $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl \
1831 $(VBOX_FILESPLIT) \
1832 | $(VBOX_JMSCOM_GEN)/java/
1833 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1834 $(call MSG_L1,Generating Java MSCOM glue files from XIDL)
1835 $(QUIET)$(RM) -f $(wildcard $(VBOX_JMSCOM_GEN)/java/*.java)
1836 $(QUIET)$(VBOX_XSLTPROC) \
1837 --stringparam filelistonly "" \
1838 --stringparam G_vboxApiSuffix $(VBOX_API_SUFFIX) \
1839 --stringparam G_vboxGlueStyle mscom \
1840 --stringparam G_vboxDirPrefix "" \
1841 --stringparam g_uVBoxCopyrightYear "$(VBOX_C_YEAR)" \
1842 -o $(VBOX_JMSCOM_GEN)/java/merged.file $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl $(VBOX_XIDL_FILE)
1843 $(QUIET)$(VBOX_FILESPLIT) $(VBOX_JMSCOM_GEN)/java/merged.file $(VBOX_JMSCOM_GEN)/java
1844 $(QUIET)echo $(VBOX_JMSCOM_GEN)/java/*.java > $@
1845
1846 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxJMscom-inst-jar_0_OUTDIR)/vboxjmscom.jar)
1847 $(VBoxJMscom-inst-jar_0_OUTDIR)/vboxjmscom.jar: $(VBOX_JMSCOM_GEN)/jmscomglue.list | $$(dir $$@)
1848 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1849 $(call MSG_TOOL,javac,$(notdir $@),jmscomglue.list,)
1850 $(QUIET)$(RM) -Rf $(VBOX_JMSCOM_JDEST)
1851 $(QUIET)$(MKDIR) -p $(VBOX_JMSCOM_JDEST)
1852 $(call MSG_TOOL,javac,$(notdir $@),...,)
1853 $(QUIET)$(VBOX_JAVAC) $(VBOX_JAVAC_OPTS) @$(VBOX_JMSCOM_GEN)/jmscomglue.list \
1854 -d $(VBOX_JMSCOM_JDEST) -classpath "$(VBOX_JMSCOM_JDEST)$(VBOX_SEP)$(VBOX_JACOB_DIR)/jacob.jar"
1855 $(call MSG_LINK,$(notdir $@),$@)
1856 $(QUIET)$(VBOX_JAR) cf $@ -C $(VBOX_JMSCOM_JDEST) .
1857
1858 ## @todo compile TestVBox.java (see below) to have sanity checking
1859endif # VBOX_WITH_JMSCOM
1860
1861#
1862# Install Java glue sample code.
1863#
1864INSTALLS += javagluesample
1865javagluesample_INST = $(INST_SDK)bindings/glue/java/
1866javagluesample_MODE = a+r,u+w
1867javagluesample_SOURCES = \
1868 $(VBOX_PATH_MAIN_SRC)/glue/tests/TestVBox.java=>TestVBox.java \
1869 $(VBOX_PATH_MAIN_SRC)/glue/tests/Makefile=>Makefile
1870
1871#
1872# Rules associated with VBoxAPIWrap (in typical invocation order).
1873# We keep them down here to simplify the use of VBoxAPIWrap_0_OUTDIR.
1874#
1875
1876# Generate a make include file which lists the wrapper header and source files.
1877$(call KB_FN_AUTO_CMD_DEPS,$(VBoxAPIWrap_VBOX_KMK_FILE).ts)
1878$(VBoxAPIWrap_VBOX_KMK_FILE).ts \
1879+| $(VBoxAPIWrap_VBOX_KMK_FILE): \
1880 $(VBOX_XIDL_FILE) \
1881 $(VBOX_PATH_MAIN_SRC)/idl/apiwrap-server-filelist.xsl \
1882 $(VBOX_PATH_MAIN_SRC)/Makefile.kmk
1883 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1884 $(call MSG_GENERATE,,$(VBoxAPIWrap_VBOX_KMK_FILE))
1885 $(QUIET)$(RM) -f $@
1886 $(QUIET)$(MKDIR) -p $(@D)
1887 $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
1888 $(if $(VBOX_WITH_SDS),-stringparam g_fVBoxWithSDS yes,) \
1889 -o $@ $(VBOX_PATH_MAIN_SRC)/idl/apiwrap-server-filelist.xsl $(VBOX_XIDL_FILE)
1890 $(QUIET)$(CP) --changed -fv $@ $(VBoxAPIWrap_VBOX_KMK_FILE)
1891
1892# Generate the header files for the wrappers.
1893$(call KB_FN_AUTO_CMD_DEPS,$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-headers)
1894$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-headers \
1895+| $(VBOX_MAIN_APIWRAPPER_GEN_HDRS): \
1896 $(VBOX_XIDL_FILE) \
1897 $(VBOX_PATH_MAIN_SRC)/idl/typemap-shared.inc.xsl \
1898 $(VBoxAPIWrap_VBOX_XSLT) \
1899 $(VBOX_FILESPLIT) \
1900 | $$(dir $$@)
1901 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1902 $(call MSG_L1,Generating C++ Server API wrapper header files from XIDL)
1903 $(QUIET)$(RM) -f -- $(filter-out $(VBOX_MAIN_APIWRAPPER_GEN_HDRS), $(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.h))
1904 $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
1905 --stringparam generating "headers" \
1906 --stringparam g_uVBoxCopyrightYear "$(VBOX_C_YEAR)" \
1907 -o $@ $(VBoxAPIWrap_VBOX_XSLT) $(VBOX_XIDL_FILE)
1908 $(QUIET)$(VBOX_FILESPLIT) $@ $(VBoxAPIWrap_0_OUTDIR)
1909
1910# Generate the DTrace probes for the wrappers and combine them with handcoded probes.
1911$(call KB_FN_AUTO_CMD_DEPS,$(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d.ts)
1912$(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d.ts \
1913+| $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d: \
1914 $(VBOX_XIDL_FILE) \
1915 $(VBOX_PATH_MAIN_SRC)/idl/typemap-shared.inc.xsl \
1916 $(VBoxAPIWrap_VBOX_XSLT) \
1917 $(VBOX_FILESPLIT) \
1918 | $$(dir $$@)
1919 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1920 $(call MSG_L1,Generating DTrace Provider for the VBox API (from XIDL))
1921 $(QUIET)$(RM) -f -- "$@" "$@.tmp"
1922 $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
1923 --stringparam generating "dtrace-probes" \
1924 --stringparam g_uVBoxCopyrightYear "$(VBOX_C_YEAR)" \
1925 -o "$@" $(VBoxAPIWrap_VBOX_XSLT) $(VBOX_XIDL_FILE)
1926 $(QUIET)$(SED) -e '' -o "$@.tmp" \
1927 "$(VBOX_PATH_MAIN_SRC)/src-all/VBoxAPI-start$(if-expr "$(VBOX_HOST_DTRACE_VERSION)" == "dtrace: Sun D 1.6.2",-alternative,).d" \
1928 "$@" \
1929 "$(VBOX_PATH_MAIN_SRC)/src-all/VBoxAPI-end$(if-expr "$(VBOX_HOST_DTRACE_VERSION)" == "dtrace: Sun D 1.6.2",-alternative,).d"
1930 $(QUIET)$(MV) -- "$@.tmp" "$@"
1931 $(QUIET)$(CP) --changed -fv -- "$@" "$(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d"
1932
1933# Generate the wrapper source files - split in two due to long processing time
1934$(call KB_FN_AUTO_CMD_DEPS,$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-even)
1935$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-even \
1936+| $(VBOX_MAIN_APIWRAPPER_GEN_SRCS_EVEN): \
1937 $(VBOX_XIDL_FILE) \
1938 $(VBOX_PATH_MAIN_SRC)/idl/typemap-shared.inc.xsl \
1939 $(VBoxAPIWrap_VBOX_XSLT) \
1940 $(VBOX_FILESPLIT) \
1941 | $$(dir $$@)
1942 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1943 $(call MSG_L1,Generating C++ Server API wrapper files from XIDL - part 1)
1944 $(QUIET)$(RM) -f -- $(filter-out $(VBOX_MAIN_APIWRAPPER_GEN_SRCS), $(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.cpp))
1945 $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
1946 --stringparam generating "sources" \
1947 --param reminder 0 \
1948 --stringparam g_uVBoxCopyrightYear "$(VBOX_C_YEAR)" \
1949 -o $@ $(VBoxAPIWrap_VBOX_XSLT) $(VBOX_XIDL_FILE)
1950 $(QUIET)$(VBOX_FILESPLIT) $@ $(VBoxAPIWrap_0_OUTDIR)
1951
1952$(call KB_FN_AUTO_CMD_DEPS,$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-odd)
1953$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-odd \
1954+| $(VBOX_MAIN_APIWRAPPER_GEN_SRCS_ODD): \
1955 $(VBOX_XIDL_FILE) \
1956 $(VBOX_PATH_MAIN_SRC)/idl/typemap-shared.inc.xsl \
1957 $(VBoxAPIWrap_VBOX_XSLT) \
1958 $(VBOX_FILESPLIT) \
1959 | $$(dir $$@)
1960 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1961 $(call MSG_L1,Generating C++ Server API wrapper files from XIDL - part 2)
1962 $(QUIET)$(RM) -f -- $(filter-out $(VBOX_MAIN_APIWRAPPER_GEN_SRCS), $(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.cpp))
1963 $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
1964 --stringparam generating "sources" \
1965 --param reminder 1 \
1966 --stringparam g_uVBoxCopyrightYear "$(VBOX_C_YEAR)" \
1967 -o $@ $(VBoxAPIWrap_VBOX_XSLT) $(VBOX_XIDL_FILE)
1968 $(QUIET)$(VBOX_FILESPLIT) $@ $(VBoxAPIWrap_0_OUTDIR)
1969
1970testapiwrappers:: \
1971 $(VBoxAPIWrap_0_OUTDIR)/apiwrappers-headers \
1972 $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d.ts \
1973 $(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-odd \
1974 $(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