VirtualBox

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

Last change on this file since 98719 was 98719, checked in by vboxsync, 21 months ago

Main/VBoxVolInfo: Don't link directly against libdevmapper but use the IPRT runtime loader to get rid of the buildtime dependency, bugref:10367 [build fix]

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