VirtualBox

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

Last change on this file since 72466 was 72324, checked in by vboxsync, 7 years ago

Main/Makefile.kmk: Strip trailing white space and empty lines from VritualBox.xidl when creating the stripped version.

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