VirtualBox

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

Last change on this file since 80398 was 80398, checked in by vboxsync, 5 years ago

Main: Get rid of VBOX_WITH_CROGL and replace with more generic VBOX_WITH_3D_ACCELERATION, bugref:9529

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