VirtualBox

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

Last change on this file since 107419 was 107362, checked in by vboxsync, 5 weeks ago

Main,Installer/win: Removed VBoxProxyStubLegacy.dll since we no longer support Vista and older 64-bit windows hosts.

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