VirtualBox

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

Last change on this file since 103147 was 103098, checked in by vboxsync, 10 months ago

Main,FE/VBoxManage,FE/VirtualBox,ValidationKit: Allow setting the primary VM execution engine to make it easier to force particular engine for testing, ​bugref:10583 [fix for darwin.amd64 where hwvirt is not available]

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