VirtualBox

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

Last change on this file since 96572 was 96572, checked in by vboxsync, 2 years ago

HostDrives,Installer/win: Reworked the windows installer related code for no-CRT mode, where applicable, and changed the XxxxInstall.exe/XxxxUninstall.exe utilities to link against VBoxRT.dll instead of being statically linked. Lot's of cleanup. The change is uncomfortably large, but difficult to detangle these things. bugref:10261

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