VirtualBox

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

Last change on this file since 93349 was 93312, checked in by vboxsync, 3 years ago

CloudNet: ​bugref:9469 Replace local gateway with DrvCloudTunnel. Build 25519 encryption support in libssh. Add missing version bump in machine settings to 1.18 if cloud attachment is used.

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