VirtualBox

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

Last change on this file since 104782 was 104782, checked in by vboxsync, 6 months ago

Main: Added new API IPlatformProperties::getSupportedVRAMRange() to return the VRAM range of a given graphics controller [SCM fix]. bugref:​10693

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