VirtualBox

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

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

scm --update-copyright-year

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