VirtualBox

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

Last change on this file since 73188 was 73154, checked in by vboxsync, 6 years ago

bugref:9152. Added 3 interfaces: CloudClient, CloudUserProfileList, CloudUserProfileManager.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 58.8 KB
Line 
1# $Id: Makefile.kmk 73154 2018-07-16 11:02:35Z 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/CloudClientImpl.cpp \
458 src-server/CloudUserProfileListImpl.cpp \
459 src-server/CloudUserProfileManagerImpl.cpp \
460 src-server/DHCPServerImpl.cpp \
461 src-server/NetworkServiceRunner.cpp \
462 src-server/NATNetworkImpl.cpp \
463 src-server/GuestOSTypeImpl.cpp \
464 src-server/HostDnsService.cpp \
465 src-server/HostImpl.cpp \
466 src-server/HostNetworkInterfaceImpl.cpp \
467 src-server/HostPower.cpp \
468 src-server/HostVideoInputDeviceImpl.cpp \
469 src-server/MachineImpl.cpp \
470 src-server/MachineImplCloneVM.cpp \
471 src-server/MachineImplMoveVM.cpp \
472 src-server/Matching.cpp \
473 src-server/MediumAttachmentImpl.cpp \
474 src-server/MediumFormatImpl.cpp \
475 src-server/MediumImpl.cpp \
476 src-server/MediumLock.cpp \
477 src-server/MediumIOImpl.cpp \
478 src-server/NATEngineImpl.cpp \
479 src-server/NetworkAdapterImpl.cpp \
480 src-server/ParallelPortImpl.cpp \
481 src-server/ProgressProxyImpl.cpp \
482 src-server/SerialPortImpl.cpp \
483 src-server/SnapshotImpl.cpp \
484 src-server/StorageControllerImpl.cpp \
485 src-server/SystemPropertiesImpl.cpp \
486 src-server/TokenImpl.cpp \
487 $(if $(VBOX_WITH_UNATTENDED), \
488 src-server/UnattendedImpl.cpp \
489 src-server/UnattendedInstaller.cpp \
490 src-server/UnattendedScript.cpp \
491 ,) \
492 src-server/USBControllerImpl.cpp \
493 src-server/USBDeviceFiltersImpl.cpp \
494 src-server/VFSExplorerImpl.cpp \
495 src-server/VirtualBoxImpl.cpp \
496 src-server/VRDEServerImpl.cpp \
497 src-server/generic/AutostartDb-generic.cpp \
498 xml/ovfreader.cpp \
499 xml/Settings.cpp \
500 $(VBOX_XML_SCHEMADEFS_CPP) \
501 $(VBOX_AUTOGEN_EVENT_CPP) \
502 $(if $(VBOX_WITH_XPCOM),src-server/xpcom/server.cpp,)
503
504src-server/ApplianceImplExport.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
505
506ifn1of ($(KBUILD_TARGET), win darwin)
507 VBoxSVC_SOURCES += $(PATH_ROOT)/src/VBox/Devices/Network/slirp/resolv_conf_parser.c
508# $(PATH_ROOT)/src/VBox/Devices/Network/slirp/resolv_conf_parser.c_DEFS += LOG_GROUP=LOG_GROUP_MAIN
509endif
510
511VBoxSVC_SOURCES.darwin = \
512 src-server/darwin/iokit.cpp \
513 src-server/darwin/HostPowerDarwin.cpp \
514 src-server/darwin/HostDnsServiceDarwin.cpp
515
516VBoxSVC_SOURCES.win = \
517 src-server/win/svcmain.cpp \
518 src-server/win/svchlp.cpp \
519 src-server/win/HostPowerWin.cpp \
520 src-server/win/VBoxSVC.rc \
521 src-server/win/HostDnsServiceWin.cpp
522
523VBoxSVC_SOURCES.linux = \
524 src-server/linux/HostHardwareLinux.cpp \
525 src-server/linux/HostDnsServiceLinux.cpp \
526 $(if $(VBOX_WITH_DBUS),src-server/linux/HostPowerLinux.cpp) \
527 src-server/HostDnsServiceResolvConf.cpp
528
529VBoxSVC_SOURCES.solaris = \
530 src-server/linux/vbox-libhal.cpp \
531 src-server/solaris/DynLoadLibSolaris.cpp \
532 src-server/HostDnsServiceResolvConf.cpp
533
534VBoxSVC_SOURCES.os2 = \
535 src-server/HostDnsServiceResolvConf.cpp
536
537VBoxSVC_SOURCES.freebsd = \
538 src-server/freebsd/HostHardwareFreeBSD.cpp \
539 src-server/HostDnsServiceResolvConf.cpp
540
541
542ifdef VBOX_WITH_USB
543 ifdef VBOX_WITH_SYSFS_BY_DEFAULT
544 src-server/linux/USBProxyBackendLinux.cpp_DEFS += VBOX_WITH_SYSFS_BY_DEFAULT
545 endif
546 VBoxSVC_SOURCES += \
547 src-server/USBDeviceFilterImpl.cpp \
548 src-server/USBProxyService.cpp \
549 src-server/USBProxyBackend.cpp \
550 src-server/generic/USBProxyBackendUsbIp.cpp \
551 src-server/HostUSBDeviceImpl.cpp
552 VBoxSVC_SOURCES.darwin += src-server/darwin/USBProxyBackendDarwin.cpp
553 VBoxSVC_SOURCES.linux += src-server/linux/USBProxyBackendLinux.cpp
554 VBoxSVC_SOURCES.linux += src-server/linux/USBGetDevices.cpp
555 VBoxSVC_SOURCES.os2 += src-server/os2/USBProxyBackendOs2.cpp
556 VBoxSVC_SOURCES.solaris += src-server/solaris/USBProxyBackendSolaris.cpp
557 VBoxSVC_SOURCES.win += src-server/win/USBProxyBackendWindows.cpp
558 VBoxSVC_SOURCES.freebsd += src-server/freebsd/USBProxyBackendFreeBSD.cpp
559endif
560
561ifdef VBOX_WITH_NETFLT
562 VBoxSVC_LIBS.win += \
563 $(PATH_STAGE_LIB)/WinNetConfig$(VBOX_SUFF_LIB) \
564 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
565 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/newdev.lib \
566 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
567 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
568endif
569VBoxSVC_LDFLAGS.darwin = -framework IOKit -framework SystemConfiguration
570
571ifdef VBOX_WITH_CROGL
572 VBoxSVC_LIBS += $(PATH_STAGE_LIB)/VBoxOGLTest$(VBOX_SUFF_LIB)
573 VBoxSVC_LDFLAGS.darwin += -framework OpenGL
574endif
575
576ifeq ($(KBUILD_TYPE),debug)
577 VBoxSVC_LDFLAGS.linux += -rdynamic # for backtrace_symbols()
578endif
579
580ifdef VBOX_WITH_RESOURCE_USAGE_API
581 VBoxSVC_SOURCES += \
582 src-server/PerformanceImpl.cpp \
583 src-server/Performance.cpp
584 VBoxSVC_SOURCES.darwin += src-server/darwin/PerformanceDarwin.cpp
585 VBoxSVC_SOURCES.freebsd += src-server/freebsd/PerformanceFreeBSD.cpp
586 VBoxSVC_SOURCES.linux += src-server/linux/PerformanceLinux.cpp
587 VBoxSVC_SOURCES.os2 += src-server/os2/PerformanceOs2.cpp
588 VBoxSVC_SOURCES.solaris += src-server/solaris/PerformanceSolaris.cpp
589 VBoxSVC_SOURCES.win += src-server/win/PerformanceWin.cpp
590 VBoxSVC_LDFLAGS.darwin += -lproc
591 VBoxSVC_LDFLAGS.solaris += -lkstat -lnvpair
592 VBoxSVC_LDFLAGS.win += psapi.lib powrprof.lib
593endif
594
595ifdef VBOX_WITH_HOSTNETIF_API
596 VBoxSVC_SOURCES.win += src-server/win/NetIf-win.cpp
597 VBoxSVC_SOURCES.linux += src-server/linux/NetIf-linux.cpp
598 VBoxSVC_SOURCES.os2 += src-server/os2/NetIf-os2.cpp
599 VBoxSVC_SOURCES.darwin += src-server/darwin/NetIf-darwin.cpp
600 VBoxSVC_SOURCES.solaris += src-server/solaris/NetIf-solaris.cpp
601 VBoxSVC_SOURCES.freebsd += src-server/freebsd/NetIf-freebsd.cpp
602 VBoxSVC_DEFS += VBOX_WITH_HOSTNETIF_API
603 if1of ($(KBUILD_TARGET), linux darwin solaris freebsd)
604 VBoxSVC_SOURCES += src-server/generic/NetIf-generic.cpp
605 endif
606endif
607
608$(call KB_FN_DO_PASS0_ON_TARGET,VBoxSVC) # Sets VBoxSVC_0_OUTDIR
609
610ifdef VBOX_WITH_MAIN_USB_ID_DATABASE # Generate a database of USB vendor IDs and device IDs.
611 VBoxSVC_DEFS += VBOX_WITH_MAIN_USB_ID_DATABASE
612 VBoxSVC_SOURCES += $(VBoxSVC_0_OUTDIR)/USBIdDatabase.cpp
613 VBoxSVC_CLEAN += $(VBoxSVC_0_OUTDIR)/USBIdDatabase.cpp
614
615 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxSVC_0_OUTDIR)/USBIdDatabase.cpp)
616 $(VBoxSVC_0_OUTDIR)/USBIdDatabase.cpp: $$(USBIdDatabaseGenerator_1_TARGET) \
617 $(PATH_SUB_CURRENT)/src-server/usb.ids $(PATH_SUB_CURRENT)/src-server/custom.ids | $$(dir $$@)
618 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
619 $(call MSG_GENERATE,USBIdDatabase,$@,$(USBIdDatabaseGenerator_1_TARGET))
620 $(QUIET)$(USBIdDatabaseGenerator_1_TARGET) -o "$@" $(filter %.ids,$^)
621
622 BLDPROGS += USBIdDatabaseGenerator
623 USBIdDatabaseGenerator_TEMPLATE = VBoxAdvBldProg
624 USBIdDatabaseGenerator_SOURCES = src-server/USBIdDatabaseGenerator.cpp
625else
626 VBoxSVC_SOURCES += src-server/USBIdDatabaseStub.cpp
627endif
628
629src-server/win/VBoxSVC.rc_INCS = $(VBoxSVC_0_OUTDIR)
630src-server/win/VBoxSVC.rc_DEPS = $(VBoxSVC_0_OUTDIR)/VBoxSVC-icon.rc
631src-server/win/VBoxSVC.rc_CLEAN = $(VBoxSVC_0_OUTDIR)/VBoxSVC-icon.rc
632$(call KB_FN_AUTO_CMD_DEPS,$(VBoxSVC_0_OUTDIR)/VBoxSVC-icon.rc)
633$(VBoxSVC_0_OUTDIR)/VBoxSVC-icon.rc: $(VBOX_WINDOWS_ICON_FILE) | $$(dir $$@)
634 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
635 $(APPEND) -t $@ '1 ICON DISCARDABLE "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
636
637ifndef VBOX_WITH_MIDL_PROXY_STUB
638 src-server/win/VBoxSVC.rc_DEPS += $(VBoxSVC_0_OUTDIR)/VBoxSVC.rgs
639 src-server/win/VBoxSVC.rc_CLEAN += $(VBoxSVC_0_OUTDIR)/VBoxSVC.rgs
640 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxSVC_0_OUTDIR)/VBoxSVC.rgs)
641 $(VBoxSVC_0_OUTDIR)/VBoxSVC.rgs: $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
642 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
643 $(VBOX_XSLTPROC) \
644 --stringparam Application VirtualBox \
645 --stringparam Module VBoxSVC \
646 -o $@ \
647 $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl \
648 $(VBOX_XIDL_FILE)
649endif
650
651## @todo r=klaus unfortunately we don't have xmllint everywhere, would be
652# good to check the validity for every VirtualBox.xidl change.
653#$(VBOX_XIDL_FILE).validated.ts: $(VBOX_XIDL_FILE_SRC)
654# xmllint --dtdvalid $(VBOX_PATH_MAIN_SRC)/idl/VirtualBox.dtd --noout $<
655# $(QUIET)$(CP) --changed -fv $< $(VBOX_XIDL_FILE).validated.ts
656#
657#OTHERS += $(VBOX_XIDL_FILE).validated.ts
658#OTHER_CLEAN += $(VBOX_XIDL_FILE).validated.ts
659
660testvalidxidl: $(VBOX_XIDL_FILE_SRC)
661 xmllint --dtdvalid $(VBOX_PATH_MAIN_SRC)/idl/VirtualBox.dtd --noout $<
662
663
664#
665# Embed some constraints from XML Schema file into VBoxSVC
666#
667VBOX_XML_SCHEMA = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings.xsd
668
669$(VBOX_XML_SCHEMADEFS_H): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA) | $$(dir $$@)
670 $(call MSG_GENERATE,SchemaDefs,$@,$<)
671 $(QUIET)$(VBOX_XSLTPROC) --stringparam mode declare -o $@ $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA)
672
673$(VBOX_XML_SCHEMADEFS_CPP): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA) | $$(dir $$@)
674 $(call MSG_GENERATE,SchemaDefs,$@,$<)
675 $(QUIET)$(VBOX_XSLTPROC) --stringparam mode define -o $@ $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA)
676
677testvalidsettings: $(VBOX_XML_SCHEMA)
678 xmllint --schema $< --noout $(HOME)/.VirtualBox/VirtualBox.xml
679 xmllint --schema $< --noout $(HOME)/.VirtualBox/Machines/*/*.xml
680 xmllint --schema $< --noout $(HOME)/.VirtualBox/Machines/*/*.vbox
681 xmllint --schema $< --noout $(HOME)/VirtualBox\ VMs/*/*.vbox
682
683OTHER_CLEAN += $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP)
684
685
686#
687# Generate some event stuff for VBoxSVC and VBoxC.
688#
689$(VBOX_AUTOGEN_EVENT_H): $(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 VBoxEventHeader -o $@ $< $(VBOX_XIDL_FILE)
692
693$(VBOX_AUTOGEN_EVENT_CPP): $(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
694 $(call MSG_TOOL,xsltproc,autogen events,$<,$@)
695 $(QUIET)$(VBOX_XSLTPROC) --stringparam G_kind VBoxEvent -o $@ $< $(VBOX_XIDL_FILE)
696
697OTHER_CLEAN += $(VBOX_AUTOGEN_EVENT_H) $(VBOX_AUTOGEN_EVENT_CPP)
698
699ifdef VBOX_WITH_XPCOM
700#
701# VBoxSVCM - VBoxSVC wrapper module
702#
703DLLS += VBoxSVCM
704VBoxSVCM_TEMPLATE = VBOXMAINCOMP
705VBoxSVCM_DEFS = IN_RING3 $(VBOX_MAIN_DEFS)
706ifdef VBOX_WITH_HARDENING
707 VBoxSVCM_DEFS += VBOX_WITH_HARDENING
708endif
709VBoxSVCM_INCS = \
710 include \
711 $(VBoxC_0_OUTDIR) \
712 .
713VBoxSVCM_INTERMEDIATES = $(VBOX_MAIN_PREREQS)
714VBoxSVCM_SOURCES = \
715 src-server/xpcom/server_module.cpp
716VBoxSVCM_LDFLAGS.darwin = \
717 -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxSVCM.dylib \
718 -exported_symbols_list $(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def
719 ifeq ($(KBUILD_TARGET),darwin)
720VBoxSVCM_ORDERDEPS += $(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def
721VBoxSVCM_CLEAN += $(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def
722$$(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def:
723 $(RM) -f $@
724 $(APPEND) $@ _NSGetModule
725 endif
726VBoxSVCM_INTERMEDIATES += $(VBOX_IDL_HEADER.XPCOM)
727
728 # 32-bit version of the module.
729 ifdef VBOX_WITH_32_ON_64_MAIN_API
730DLLS += VBoxSVCM-x86
731VBoxSVCM-x86_TEMPLATE = VBoxMainComp-x86
732VBoxSVCM-x86_EXTENDS = VBoxSVCM
733 endif
734
735endif # VBOX_WITH_XPCOM
736
737
738#
739# VBoxC module
740#
741DLLS += VBoxC
742VBoxC_TEMPLATE = VBOXMAINCOMP
743if defined(VBOX_WITH_PRECOMPILED_HEADERS) && "$(KBUILD_TARGET)" == "win"
744 VBoxC_USES = vccprecomp
745 VBoxC_PCH_HDR := $(PATH_SUB_CURRENT)/src-client/win/precomp_vcc.h
746endif
747VBoxC_DEFS = \
748 IN_RING3 \
749 $(VBOX_MAIN_DEFS) \
750 VBOX_COM_INPROC \
751 $(if $(VBOX_WITH_HGCM),VBOX_WITH_HGCM,) \
752 $(if $(VBOX_WITH_AUDIO_OSS),VBOX_WITH_AUDIO_OSS,) \
753 $(if $(VBOX_WITH_AUDIO_ALSA),VBOX_WITH_AUDIO_ALSA,) \
754 $(if $(VBOX_WITH_AUDIO_PULSE),VBOX_WITH_AUDIO_PULSE,) \
755 $(if $(VBOX_WITH_AUDIO_DEBUG),VBOX_WITH_AUDIO_DEBUG,) \
756 $(if $(VBOX_WITH_AUDIO_VALIDATIONKIT),VBOX_WITH_AUDIO_VALIDATIONKIT,) \
757 $(if $(VBOX_WITH_AUDIO_VIDEOREC),VBOX_WITH_AUDIO_VIDEOREC,) \
758 $(if $(VBOX_WITH_VIDEOREC),VBOX_WITH_VIDEOREC,) \
759 $(if $(VBOX_WITH_AUDIO_VRDE),VBOX_WITH_AUDIO_VRDE,) \
760 $(if $(VBOX_WITH_E1000),VBOX_WITH_E1000,) \
761 $(if $(VBOX_WITH_VIRTIO),VBOX_WITH_VIRTIO,) \
762 $(if $(VBOX_WITH_EFI),VBOX_WITH_EFI,) \
763 $(if $(VBOX_WITH_PDM_ASYNC_COMPLETION),VBOX_WITH_PDM_ASYNC_COMPLETION,) \
764 $(if $(VBOX_WITH_LIVE_MIGRATION),VBOX_WITH_LIVE_MIGRATION,) \
765 $(if $(VBOX_WITH_VUSB),VBOX_WITH_VUSB,) \
766 $(if $(VBOX_WITH_HGSMI),VBOX_WITH_HGSMI,) \
767 $(if $(VBOX_WITH_VIDEOHWACCEL),VBOX_WITH_VIDEOHWACCEL,) \
768 $(if $(VBOX_WITH_DRAG_AND_DROP),VBOX_WITH_DRAG_AND_DROP,) \
769 $(if $(VBOX_WITH_DRAG_AND_DROP_GH),VBOX_WITH_DRAG_AND_DROP_GH,) \
770 $(if $(VBOX_WITH_USB),VBOX_WITH_USB,) \
771 $(if-expr defined(VBOX_WITH_EHCI) && defined(VBOX_WITH_USB),VBOX_WITH_EHCI,) \
772 $(if $(VBOX_WITH_EXTPACK),VBOX_WITH_EXTPACK,) \
773 $(if $(VBOX_WITH_PCI_PASSTHROUGH),VBOX_WITH_PCI_PASSTHROUGH,) \
774 $(if $(VBOX_WITH_VRDEAUTH_IN_VBOXSVC),VBOX_WITH_VRDEAUTH_IN_VBOXSVC,) \
775 $(if $(VBOX_WITH_SDS),VBOX_WITH_SDS,)
776ifdef VBOX_WITH_CRHGSMI
777 VBoxC_DEFS += VBOX_WITH_CRHGSMI
778endif
779ifdef VBOX_WITH_NETSHAPER
780 VBoxC_DEFS += VBOX_WITH_NETSHAPER
781endif
782VBoxC_DEFS.darwin.x86 = VBOX_WITH_2X_4GB_ADDR_SPACE
783VBoxC_DEFS.win.x86 += _WIN32_WINNT=0x0500
784VBoxC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
785
786if $(KBUILD_TARGET) != "win" && $(VBOX_GCC_VERSION_CXX) >= 40900 # gcc 4.9.x (4.8.x is causing endless RT_ELEMENT trouble)
787# VBoxC_CXXFLAGS = -Wunused -Wconversion
788endif
789
790VBoxC_SDKS = VBOX_LIBPNG VBOX_ZLIB
791
792ifdef VBOX_WITH_VIDEOREC
793 VBoxC_SOURCES += \
794 src-client/EBMLWriter.cpp \
795 src-client/WebMWriter.cpp
796 ifdef VBOX_WITH_LIBVPX
797 VBoxC_SDKS += VBOX_VPX
798 VBoxC_DEFS += VBOX_WITH_LIBVPX
799 VBoxC_SOURCES += \
800 src-client/VideoRec.cpp
801 else
802 $(error "VBox: No alternative for VPX when using video capturing support yet")
803 endif
804endif
805
806ifdef VBOX_WITH_AUDIO_VIDEOREC
807 ifdef VBOX_WITH_LIBOPUS
808 VBoxC_SDKS += VBOX_OPUS
809 VBoxC_DEFS += VBOX_WITH_LIBOPUS
810 else
811 $(error "VBox: No alternative for Opus when using audio support for video capturing yet")
812 endif
813endif
814
815ifdef VBOX_WITH_OPENSSL_FIPS
816 VBoxC_SDKS += VBOX_OPENSSL2
817endif
818
819VBoxC_INCS = \
820 include \
821 $(VBoxC_0_OUTDIR) \
822 $(VBOX_MAIN_APIWRAPPER_INCS) \
823 $(dir $(VBOX_XML_SCHEMADEFS_H)) \
824 $(VBOX_MAIN_APIWRAPPER_DIR)/dtrace \
825 $(VBOX_GRAPHICS_INCS)
826VBoxC_INCS.win = \
827 $(VBoxCOM_0_OUTDIR) \
828 .
829
830VBoxC_LDFLAGS.darwin = \
831 -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxC.dylib \
832 -exported_symbols_list $(VBoxC_0_OUTDIR)/VBoxC.def \
833 -framework IOKit
834VBoxC_LDFLAGS.win += /MANIFEST \
835 /DELAYLOAD:user32.dll
836
837
838VBoxC_LIBS += \
839 $(PATH_STAGE_LIB)/VBoxAPIWrap$(VBOX_SUFF_LIB) \
840 $(if-expr "$(LIB_VMM)" == "$(VBOX_LIB_VMM_LAZY)",$(LIB_REM),) \
841 $(VBOX_LIB_VMM_LAZY)
842VBoxC_LIBS.win += \
843 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/psapi.lib \
844 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib
845ifdef VBOX_WITH_NETFLT
846 VBoxC_LIBS.win += \
847 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
848 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/newdev.lib \
849 $(PATH_STAGE_LIB)/WinNetConfig$(VBOX_SUFF_LIB) \
850 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
851 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
852 VBoxC_LDFLAGS.win += \
853 /DELAYLOAD:newdev.dll \
854 /DELAYLOAD:setupapi.dll \
855 /DELAYLOAD:iphlpapi.dll
856endif
857
858ifdef VBOX_WITH_CROGL
859 VBoxC_LIBS += $(PATH_STAGE_LIB)/VBoxOGLTest$(VBOX_SUFF_LIB)
860 VBoxC_LDFLAGS.darwin += -framework OpenGL
861endif
862
863ifdef VBOX_WITH_DRAG_AND_DROP
864 VBoxC_LIBS += $(PATH_STAGE_LIB)/VBoxDnDHostR3Lib$(VBOX_SUFF_LIB)
865endif
866
867VBoxC_INTERMEDIATES = \
868 $(VBOX_MAIN_PREREQS) \
869 $(VBOX_XML_SCHEMADEFS_H) \
870 $(VBOX_AUTOGEN_EVENT_H) \
871 $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
872
873VBoxC_SOURCES += \
874 $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d \
875 src-all/DisplayPNGUtil.cpp \
876 src-all/DisplayResampleImage.cpp \
877 src-all/DisplayUtils.cpp \
878 src-all/EventImpl.cpp \
879 src-all/Global.cpp \
880 src-all/HashedPw.cpp \
881 src-all/Logging.cpp \
882 src-all/PCIDeviceAttachmentImpl.cpp \
883 src-all/ProgressImpl.cpp \
884 src-all/SecretKeyStore.cpp \
885 src-all/SharedFolderImpl.cpp \
886 src-all/AutoCaller.cpp \
887 src-all/ThreadTask.cpp \
888 src-all/VirtualBoxBase.cpp \
889 src-all/VirtualBoxErrorInfoImpl.cpp \
890 $(if $(VBOX_WITH_EXTPACK),src-all/ExtPackManagerImpl.cpp src-all/ExtPackUtil.cpp,) \
891 src-client/UsbWebcamInterface.cpp \
892 $(if $(VBOX_WITH_USB_CARDREADER),src-client/UsbCardReader.cpp,) \
893 src-client/Nvram.cpp \
894 src-client/AdditionsFacilityImpl.cpp \
895 src-client/BusAssignmentManager.cpp \
896 $(if $(VBOX_WITH_PCI_PASSTHROUGH),src-client/PCIRawDevImpl.cpp,) \
897 src-client/ClientTokenHolder.cpp \
898 src-client/ConsoleImpl.cpp \
899 src-client/ConsoleImpl2.cpp \
900 src-client/ConsoleImplTeleporter.cpp \
901 src-client/ConsoleVRDPServer.cpp \
902 src-client/DisplayImpl.cpp \
903 src-client/DisplayImplLegacy.cpp \
904 src-client/DisplaySourceBitmapImpl.cpp \
905 src-client/EmulatedUSBImpl.cpp \
906 src-client/GuestImpl.cpp \
907 src-client/GuestCtrlImpl.cpp \
908 src-client/KeyboardImpl.cpp \
909 src-client/MachineDebuggerImpl.cpp \
910 src-client/MouseImpl.cpp \
911 src-client/RemoteUSBDeviceImpl.cpp \
912 src-client/SessionImpl.cpp \
913 src-client/USBDeviceImpl.cpp \
914 src-client/VBoxDriversRegister.cpp \
915 src-client/VirtualBoxClientImpl.cpp \
916 src-client/VMMDevInterface.cpp \
917 $(VBOX_AUTOGEN_EVENT_CPP) \
918 $(VBOX_XML_SCHEMADEFS_CPP)
919
920# Audio bits.
921VBoxC_SOURCES += \
922 ../Devices/Audio/AudioMixBuffer.cpp \
923 ../Devices/Audio/DrvAudioCommon.cpp \
924 src-client/AudioDriver.cpp \
925 $(if $(VBOX_WITH_AUDIO_VRDE),src-client/DrvAudioVRDE.cpp,) \
926 $(if $(VBOX_WITH_AUDIO_VIDEOREC),src-client/DrvAudioVideoRec.cpp,)
927
928VBoxC_SOURCES.win = \
929 src-client/win/dllmain.cpp \
930 src-client/win/VBoxC.def \
931 src-client/win/VBoxC.rc
932ifdef VBOX_WITH_GUEST_CONTROL
933 VBoxC_SOURCES += \
934 src-client/GuestSessionImplTasks.cpp \
935 src-client/GuestCtrlPrivate.cpp \
936 src-client/GuestDirectoryImpl.cpp \
937 src-client/GuestFileImpl.cpp \
938 src-client/GuestFsObjInfoImpl.cpp \
939 src-client/GuestProcessImpl.cpp \
940 src-client/GuestSessionImpl.cpp
941endif
942ifdef VBOX_WITH_DRAG_AND_DROP
943 VBoxC_SOURCES += \
944 src-client/GuestDnDPrivate.cpp \
945 src-client/GuestDnDSourceImpl.cpp \
946 src-client/GuestDnDTargetImpl.cpp
947endif
948ifdef VBOX_WITH_XPCOM
949 VBoxC_SOURCES += \
950 src-client/xpcom/module.cpp
951endif
952ifdef VBOX_WITH_HGCM
953 VBoxC_SOURCES += \
954 src-client/HGCMObjects.cpp \
955 src-client/HGCMThread.cpp \
956 src-client/HGCM.cpp
957endif
958ifdef VBOX_WITH_USB
959 VBoxC_SOURCES += \
960 src-client/RemoteUSBBackend.cpp
961endif
962ifndef VBOX_WITH_VRDEAUTH_IN_VBOXSVC
963 VBoxC_SOURCES += \
964 src-all/AuthLibrary.cpp
965endif
966
967$(call KB_FN_DO_PASS0_ON_TARGET,VBoxC) # Sets VBoxC_0_OUTDIR
968
969ifeq ($(KBUILD_TARGET),darwin)
970 VBoxC_ORDERDEPS += $(VBoxC_0_OUTDIR)/VBoxC.def
971 VBoxC_CLEAN += $(VBoxC_0_OUTDIR)/VBoxC.def
972 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxC_0_OUTDIR)/VBoxC.def)
973 $(VBoxC_0_OUTDIR)/VBoxC.def:
974 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
975 $(RM) -f $@
976 $(APPEND) $@ _NSGetModule
977 $(APPEND) $@ _VBoxDriversRegister
978endif
979
980src-client/ConsoleImpl.cpp_DEFS = \
981 $(if $(VBOX_WITH_OPENSSL_FIPS), VBOX_OPENSSL_FIPS,)
982
983
984src-client/win/VBoxC.rc_DEPS = $(VBoxC_0_OUTDIR)/VBoxC.rgs $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb
985VBoxC_CLEAN.win += $(VBoxC_0_OUTDIR)/VBoxC.rgs
986$(call KB_FN_AUTO_CMD_DEPS,$(VBoxC_0_OUTDIR)/VBoxC.rgs)
987$(VBoxC_0_OUTDIR)/VBoxC.rgs: $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
988 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
989 $(VBOX_XSLTPROC) \
990 --stringparam Application VirtualBox \
991 --stringparam Module VBoxC \
992 -o $@ \
993 $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl \
994 $(VBOX_XIDL_FILE)
995
996ifdef VBOX_WITH_32_ON_64_MAIN_API
997 #
998 # 32-bit VBox API Client In-Process module.
999 #
1000 # This is currently just a 32-bit version of VBoxC. It might be desirable to
1001 # split up VBoxC into a simple client and a VM client part later, in which
1002 # case this module will be a simple client.
1003 #
1004 # Note! One important thing is that the typelib for this DLL must be build
1005 # with the /env win32 switch and the VBoxC typelib with /env amd64, if
1006 # not they will overwrite each others typelib module entry.
1007 #
1008 DLLS += VBoxClient-x86
1009 VBoxClient-x86_TEMPLATE = VBoxMainComp-x86
1010 VBoxClient-x86_EXTENDS = VBoxC
1011if defined(VBOX_WITH_PRECOMPILED_HEADERS) && "$(KBUILD_TARGET)" == "win" ## @todo fix inheritance
1012 VBoxClient-x86_USES = vccprecomp
1013 VBoxClient-x86_PCH_HDR := $(PATH_SUB_CURRENT)/src-client/win/precomp_vcc.h
1014endif
1015 VBoxClient-x86_DEFS = VBOX_COM_INPROC_API_CLIENT $(VBoxC_DEFS)
1016 VBoxClient-x86_INCS.win = \
1017 $(VBoxClient-x86_0_OUTDIR) \
1018 $(VBoxCOM-x86_0_OUTDIR) \
1019 $(VBoxC_INCS.win)
1020 VBoxClient-x86_SOURCES = \
1021 src-all/EventImpl.cpp \
1022 src-all/Global.cpp \
1023 src-all/AutoCaller.cpp \
1024 src-all/ThreadTask.cpp \
1025 src-all/VirtualBoxBase.cpp \
1026 src-all/VirtualBoxErrorInfoImpl.cpp \
1027 src-client/ClientTokenHolder.cpp \
1028 src-client/SessionImpl.cpp \
1029 src-client/VirtualBoxClientImpl.cpp \
1030 $(VBOX_AUTOGEN_EVENT_CPP) \
1031 $(VBOX_XML_SCHEMADEFS_CPP)
1032 VBoxClient-x86_SOURCES.win = \
1033 src-client/win/dllmain.cpp \
1034 src-client/win/VBoxClient-x86.def \
1035 src-client/win/VBoxClient-x86.rc
1036 ifdef VBOX_WITH_XPCOM
1037 VBoxClient-x86_SOURCES += \
1038 src-client/xpcom/module.cpp
1039 endif
1040 VBoxClient-x86_LIBS = \
1041 $(PATH_STAGE_LIB)/VBoxAPIWrap-x86$(VBOX_SUFF_LIB)
1042 VBoxClient-x86_LIBS.win = $(NO_SUCH_VARIABLE)
1043 VBoxClient-x86_LIBS.win.x86 += \
1044 $(PATH_TOOL_$(VBOX_VCC_TOOL_STEM)X86_LIB)/delayimp.lib \
1045 $(PATH_SDK_$(VBOX_WINPSDK)_LIB.x86)/WbemUuid.Lib
1046 VBoxClient-x86_CLEAN.win += $(VBoxClient-x86_0_OUTDIR)/VBoxClient-x86.rgs
1047 $(call KB_FN_DO_PASS0_ON_TARGET,VBoxClient-x86) # Sets VBoxClient-x86_0_OUTDIR
1048
1049 src-client/win/VBoxClient-x86.rc_DEPS = \
1050 $(VBoxClient-x86_0_OUTDIR)/VBoxClient-x86.rgs \
1051 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox-x86.tlb
1052
1053 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxClient-x86_0_OUTDIR)/VBoxClient-x86.rgs)
1054 $(VBoxClient-x86_0_OUTDIR)/VBoxClient-x86.rgs: \
1055 $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl \
1056 $(VBOX_XIDL_FILE) | $$(dir $$@)
1057 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1058 $(VBOX_XSLTPROC) \
1059 --stringparam Application VirtualBox \
1060 --stringparam Module VBoxC \
1061 -o $@ \
1062 $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl \
1063 $(VBOX_XIDL_FILE)
1064endif
1065
1066
1067#
1068# VBoxCOM - COM Abstraction Layer library
1069#
1070LIBRARIES += VBoxCOM
1071VBoxCOM_TEMPLATE = VBoxMainLib
1072VBoxCOM_INTERMEDIATES = $(VBOX_MAIN_PREREQS) \
1073 $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
1074VBoxCOM_SOURCES = \
1075 glue/com.cpp \
1076 glue/VBoxLogRelCreate.cpp \
1077 glue/GetVBoxUserHomeDirectory.cpp \
1078 glue/initterm.cpp \
1079 glue/string.cpp \
1080 glue/AutoLock.cpp \
1081 glue/EventQueue.cpp \
1082 glue/NativeEventQueue.cpp \
1083 glue/ErrorInfo.cpp \
1084 glue/errorprint.cpp
1085VBoxCOM_INCS += $(VBOX_MAIN_APIWRAPPER_INCS) \
1086 include
1087ifeq ($(KBUILD_TARGET),win)
1088 ifdef VBOX_WITH_MIDL_PROXY_STUB
1089 VBoxCOM_DEFS.win = VBOX_WITH_AUTO_COM_REG_UPDATE
1090 endif
1091 VBoxCOM_DEFS.x86 = _WIN32_WINNT=0x0500
1092 VBoxCOM_DEFS.amd64 = _WIN32_WINNT=0x0510
1093 VBoxCOM_SOURCES += \
1094 $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c
1095 VBoxCOM_CLEAN = \
1096 $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
1097 $(VBoxCOM_0_OUTDIR)/VirtualBox_p.c \
1098 $(VBoxCOM_0_OUTDIR)/dlldata.c \
1099 $(VBoxCOM_0_OUTDIR)/VirtualBox.h \
1100 $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb
1101 VBoxCOM_CLEAN += \
1102 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_i.c \
1103 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_p.c \
1104 $(VBoxCOM_0_OUTDIR)/legacy/dlldata.c \
1105 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.h \
1106 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.tlb
1107 VBoxCOM_BLDDIRS = $(VBoxCOM_0_OUTDIR)/legacy/
1108else # !win
1109 VBoxCOM_SOURCES += \
1110 $(VBoxCOM_0_OUTDIR)/VirtualBox_XPCOM_i.c \
1111 glue/xpcom/helpers.cpp
1112endif # !win
1113
1114glue/VBoxLogRelCreate.cpp_DEFS = KBUILD_TYPE=\"$(KBUILD_TYPE)\"
1115
1116# 32-bit version of VBoxCOM.
1117ifdef VBOX_WITH_32_ON_64_MAIN_API
1118 LIBRARIES += VBoxCOM-x86
1119 VBoxCOM-x86_TEMPLATE = VBoxMainLib-x86
1120 VBoxCOM-x86_EXTENDS = VBoxCOM
1121 ifeq ($(KBUILD_TARGET),win)
1122 VBoxCOM-x86_CLEAN = \
1123 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c \
1124 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_p.c \
1125 $(VBoxCOM-x86_0_OUTDIR)/dlldata.c \
1126 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox.h \
1127 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox.tlb
1128 endif
1129endif
1130
1131# -MD version for the GUI in -MDd builds.
1132ifeq ($(KBUILD_TARGET).$(VBOX_VCC_CRT_TYPE),win.d)
1133 LIBRARIES += VBoxCOM-GUI
1134 USES += qt5
1135 VBoxCOM-GUI_TEMPLATE = VBOXQTGUI$(if-expr defined(VBOX_WITH_HARDENING),,EXE)
1136 VBoxCOM-GUI_EXTENDS = VBoxCOM
1137endif
1138
1139
1140
1141#
1142# The VBoxExtPackHelperApp.
1143#
1144ifdef VBOX_WITH_EXTPACK
1145 PROGRAMS += VBoxExtPackHelperApp
1146 VBoxExtPackHelperApp_TEMPLATE = VBoxR3SetUidToRoot
1147 VBoxExtPackHelperApp_LDFLAGS.darwin = -framework Security
1148 VBoxExtPackHelperApp_LDFLAGS.win = /SUBSYSTEM:windows
1149 VBoxExtPackHelperApp_SOURCES = \
1150 src-helper-apps/VBoxExtPackHelperApp.cpp \
1151 src-all/ExtPackUtil.cpp
1152 VBoxExtPackHelperApp_SOURCES.win = \
1153 src-helper-apps/VBoxExtPackHelperApp.rc
1154 VBoxExtPackHelperApp_LIBS = \
1155 $(LIB_RUNTIME)
1156endif # VBOX_WITH_EXTPACK
1157
1158#
1159# VolInfo
1160#
1161ifdef VBOX_WITH_DEVMAPPER
1162 PROGRAMS.linux += VBoxVolInfo
1163 VBoxVolInfo_TEMPLATE = VBoxR3SetUidToRoot
1164 VBoxVolInfo_SOURCES = src-helper-apps/VBoxVolInfo.cpp
1165 VBoxVolInfo_LIBS = devmapper
1166endif
1167
1168endif # !VBOX_ONLY_SDK (the ifndef is far above)
1169
1170
1171#
1172# Installs com related thing(s) to bin.
1173#
1174INSTALLS.win += VBoxMain-com-inst
1175VBoxMain-com-inst_INST = $(INST_BIN)
1176VBoxMain-com-inst_MODE = a+r,u+w
1177VBoxMain-com-inst_SOURCES = src-all/win/comregister.cmd
1178
1179
1180if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "linux"
1181 #
1182 # Installs linux/hardening related things to components.
1183 #
1184 INSTALLS.linux += VBoxMain-hardening-inst
1185 VBoxMain-hardening-inst_INST = $(INST_BIN)components/
1186 VBoxMain-hardening-inst_SYMLINKS = \
1187 VBoxDDU.so=>../VBoxDDU.so \
1188 VBoxREM.so=>../VBoxREM.so \
1189 VBoxRT.so=>../VBoxRT.so \
1190 VBoxVMM.so=>../VBoxVMM.so \
1191 VBoxXPCOM.so=>../VBoxXPCOM.so
1192endif
1193
1194
1195if defined(VBOX_WITH_MIDL_PROXY_STUB) && "$(KBUILD_TARGET)" == "win"
1196 #
1197 # Experimental COM proxy + stub DLL w/ automatic registration updating.
1198 #
1199 # The Legacy stub is for older 64-bit windows versions (pre Windows 7) as we
1200 # were having various problems on windows server 2003 and 2008 with the code
1201 # MIDL generated. Also, in windows 7 there are some potentially interesting
1202 # changes in the generated code where it uses new helpers from OLE32.
1203 #
1204 DLLS += VBoxProxyStub
1205 VBoxProxyStub_TEMPLATE = VBOXMAINCOMP
1206 VBoxProxyStub_DEFS = REGISTER_PROXY_DLL PROXY_CLSID_IS="$(VBOX_MIDL_PROXY_CLSID_IS)" \
1207 $(if $(VBOX_WITH_SDS),VBOX_WITH_SDS,)\
1208 $(if $(VBOX_WITH_SDS_CLIENT_WATCHER),VBOX_WITH_SDS_CLIENT_WATCHER,)
1209 VBoxProxyStub_DEFS.win.x86 = WIN32
1210 VBoxProxyStub_SDKS = VBOX_NTDLL
1211 VBoxProxyStub_DEFPATH = $(VBoxCOM_0_OUTDIR)/# Hack to workaround drive letter in $(VBoxCOM_0_OUTDIR)/ for CFLAGS hack below.
1212 VBoxProxyStub_INCS = $(VBoxCOM_0_OUTDIR)/ \
1213 $(VBOX_PATH_MAIN_SRC)/include/
1214 VBoxProxyStub_SOURCES := \
1215 VirtualBox_p.c \
1216 VirtualBox_i.c \
1217 $(PATH_SUB_CURRENT)/src-all/win/VBoxProxyStub.def \
1218 $(PATH_SUB_CURRENT)/src-all/win/VBoxProxyStub.rc \
1219 $(PATH_SUB_CURRENT)/src-all/win/RpcChannelHook.cpp \
1220 $(PATH_SUB_CURRENT)/src-all/win/VBoxProxyStub.c
1221 src-all/win/VBoxProxyStub.rc_DEPS = $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb
1222 VBoxProxyStub_VirtualBox_p.c_CFLAGS.x86 = /Gz # Workaround for incorrect ObjectStublessClient* prototypes in SDK v7.1.
1223
1224 DLLS += VBoxProxyStubLegacy
1225 VBoxProxyStubLegacy_TEMPLATE = VBOXMAINCOMP
1226 VBoxProxyStubLegacy_EXTENDS = VBoxProxyStub
1227 VBoxProxyStubLegacy_DEFS = $(VBoxProxyStub_DEFS) VBOX_IN_PROXY_STUB_LEGACY
1228 VBoxProxyStubLegacy_INCS = $(VBoxCOM_0_OUTDIR)/legacy/ \
1229 $(VBOX_PATH_MAIN_SRC)/include/
1230 VBoxProxyStubLegacy_SOURCES = \
1231 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_p.c \
1232 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_i.c \
1233 src-all/win/VBoxProxyStub.def \
1234 src-all/win/VBoxProxyStubLegacy.rc \
1235 src-all/win/RpcChannelHook.cpp \
1236 src-all/win/VBoxProxyStub.c
1237 src-all/win/VBoxProxyStubLegacy.rc_DEPS = $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.tlb
1238
1239 ifdef VBOX_WITH_32_ON_64_MAIN_API
1240 DLLS += VBoxProxyStub-x86
1241 VBoxProxyStub-x86_TEMPLATE = VBoxMainComp-x86
1242 VBoxProxyStub-x86_SDKS = VBOX_NTDLL
1243 VBoxProxyStub-x86_DEFS = $(VBoxProxyStub_DEFS) VBOX_PROXY_STUB_32_ON_64 WIN32
1244 VBoxProxyStub-x86_INCS = $(VBoxCOM-x86_0_OUTDIR)/ \
1245 $(VBOX_PATH_MAIN_SRC)/include/
1246 VBoxProxyStub-x86_SOURCES = \
1247 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_p.c \
1248 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c \
1249 src-all/win/VBoxProxyStub.c \
1250 src-all/win/VBoxProxyStub-x86.rc \
1251 src-all/win/RpcChannelHook.cpp \
1252 src-all/win/VBoxProxyStub.def
1253 src-all/win/VBoxProxyStub-x86.rc_DEPS = $(VBoxCOM-x86_0_OUTDIR)/VirtualBox-x86.tlb
1254 endif
1255endif
1256
1257
1258
1259# generate rules
1260include $(FILE_KBUILD_SUB_FOOTER)
1261
1262
1263
1264#
1265# Additions rules.
1266#
1267
1268## @todo this hack ain't cutting it any longer. (the file name is abspath'ed since ages now.)
1269glue/xpcom/helpers.cpp: $(VBOX_IDL_TYPELIB.XPCOM)
1270
1271$(call KB_FN_AUTO_CMD_DEPS_EX,$(VBOX_IDL_FILE.XPCOM),$(PATH_OUT)/VBOX_IDL_FILE.XPCOM.vbox-dep)
1272$(VBOX_IDL_FILE.XPCOM): $(VBOX_PATH_MAIN_SRC)/idl/xpidl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
1273 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS_EX,$(PATH_OUT)/VBOX_IDL_FILE.XPCOM.vbox-dep)
1274 $(call MSG_TOOL,xsltproc,VBoxSVC,$(VBOX_PATH_MAIN_SRC)/idl/xpidl.xsl,$@)
1275 $(QUIET)$(VBOX_XSLTPROC) -o $@ $(VBOX_PATH_MAIN_SRC)/idl/xpidl.xsl $(VBOX_XIDL_FILE)
1276
1277$(call KB_FN_AUTO_CMD_DEPS_EX,$(VBOX_IDL_TYPELIB.XPCOM),$(PATH_OUT)/VBOX_IDL_TYPELIB.XPCOM.vbox-dep)
1278$(VBOX_IDL_TYPELIB.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
1279 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS_EX,$(PATH_OUT)/VBOX_IDL_TYPELIB.XPCOM.vbox-dep)
1280 $(call MSG_TOOL,xpidl,VBoxSVC,$(VBOX_IDL_FILE.XPCOM),$@)
1281 $(QUIET)$(VBOX_XPIDL_ENV)$(VBOX_XPIDL) -m typelib -I $(VBOX_PATH_XPCOM_IDL) -e $@ $(VBOX_IDL_FILE.XPCOM)
1282 $(CHMOD) 0644 $@
1283## @todo ^^^^^^^^^^^^ fix horrible hack
1284
1285$(call KB_FN_AUTO_CMD_DEPS_EX,$(VBOX_IDL_HEADER.XPCOM),$(PATH_OUT)/VBOX_IDL_HEADER.XPCOM.vbox-dep)
1286$(VBOX_IDL_HEADER.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
1287 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS_EX,$(PATH_OUT)/VBOX_IDL_HEADER.XPCOM.vbox-dep)
1288 $(call MSG_TOOL,xpidl,VBoxSVC,$(VBOX_IDL_FILE.XPCOM),$@)
1289 $(QUIET)$(VBOX_XPIDL_ENV)$(VBOX_XPIDL) -m header -I $(VBOX_PATH_XPCOM_IDL) -e $@ $(VBOX_IDL_FILE.XPCOM)
1290
1291$(call KB_FN_AUTO_CMD_DEPS_EX,$(VBOX_IDL_FILE.MSCOM),$(PATH_OUT)/VBOX_IDL_FILE.MSCOM.vbox-dep)
1292$(VBOX_IDL_FILE.MSCOM): $(VBOX_PATH_MAIN_SRC)/idl/midl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
1293 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS_EX,$(PATH_OUT)/VBOX_IDL_FILE.MSCOM.vbox-dep)
1294 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
1295 $(QUIET)$(VBOX_XSLTPROC) -o $@ \
1296 $(if $(VBOX_WITH_MIDL_PROXY_STUB),-stringparam g_fGenProxy yes,) \
1297 $(if $(VBOX_WITH_SDS),-stringparam g_fVBoxWithSDS yes,) \
1298 $(VBOX_PATH_MAIN_SRC)/idl/midl.xsl $(VBOX_XIDL_FILE)
1299
1300
1301# Aliases for testing purposes.
1302ifdef VBOX_WITH_XPCOM
1303testidl: $(VBOX_IDL_FILE.XPCOM) $(VBOX_IDL_TYPELIB.XPCOM) $(VBoxCOM_0_OUTDIR)/VirtualBox_XPCOM_i.c
1304testidlhdr: $(VBOX_IDL_HEADER.XPCOM)
1305else
1306testidl: $(VBOX_IDL_FILE.MSCOM) $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
1307 $(if $(VBOX_WITH_32_ON_64_MAIN_API),$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c,)
1308endif
1309
1310
1311$(VBoxCOM_0_OUTDIR)/VirtualBox_XPCOM_i.c: $(VBOX_PATH_MAIN_SRC)/idl/xpidl_iid.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
1312 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
1313 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
1314
1315##
1316# Edits $1 and adding #pragma directives for disabling warnings windows.h causes.
1317# @param 1 The name of the file to edit.
1318define def_VBoxMainDisableMscWarnings
1319 $(QUIET)$(MV) -f "$1" "$1.tmp"
1320 $(QUIET)$(APPEND) -nt "$1" \
1321 '#pragma warning(push) /* -Wall and windows.h */' \
1322 '#pragma warning(disable:4668 4255)' \
1323 '#if _MSC_VER >= 1800 /* RT_MSC_VER_VC120 */' \
1324 '# pragma warning(disable:4005)' \
1325 '#endif' \
1326 ''
1327 $(QUIET)$(CAT_EXT) "$1.tmp" >> "$1"
1328 $(QUIET)$(APPEND) -n "$1" \
1329 '' \
1330 '#pragma warning(pop)' \
1331 ''
1332 $(QUIET)$(RM) -f "$1.tmp"
1333
1334endef
1335
1336# Note! Because we've got a different proxy stub DLL for pre windows 7 64-bit hosts, we target windows 7 for AMD64.
1337# The output is different and hopefully more efficient, at least memory wise (using more helpers in OLE32).
1338# Note! We're checking for win.amd64 below when setting the target because of the SDK build which happens on linux.amd64
1339# but with a 32-bit Wine.
1340$(call KB_FN_AUTO_CMD_DEPS,$(VBoxCOM_0_OUTDIR)/VirtualBox_i.c)
1341$(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
1342$(if $(VBOX_WITH_MIDL_PROXY_STUB), + $(VBoxCOM_0_OUTDIR)/VirtualBox_p.c + $(VBoxCOM_0_OUTDIR)/dlldata.c,) \
1343+ $(VBoxCOM_0_OUTDIR)/VirtualBox.h \
1344+ $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb: $(VBOX_IDL_FILE.MSCOM) | $$(dir $$@)
1345 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1346 $(VBOX_WIN_MIDL) /nologo /W4 \
1347 /env $(if-expr "$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)" == "win.amd64" ,amd64,win32) \
1348 /robust /protocol all /target $(if-expr defined(VBOX_WITH_MIDL_PROXY_STUB),NT61,NT51) \
1349 /out $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxCOM_0_OUTDIR)) \
1350 /cpp_cmd $(subst $(EXEC_X86_WIN32),,$(call VBOX_FN_MAKE_WIN_PATH,$(TOOL_$(VBOX_VCC_TOOL)_CC))) \
1351 /I $(call VBOX_FN_MAKE_WIN_PATH,$(PATH_SDK_$(VBOX_WINPSDK)_INC)) \
1352 /I idl \
1353 $(call VBOX_FN_MAKE_WIN_PATH,$(VBOX_IDL_FILE.MSCOM))
1354 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/VirtualBox.h)
1355 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/VirtualBox_i.c)
1356 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/VirtualBox_p.c)
1357
1358if defined(VBOX_WITH_MIDL_PROXY_STUB)
1359# -Windows Server 2003 AMD64 SP1 does not like the result when using '/protocol all' and '/target NT51'.
1360# -Vista AMD64 SP1 and Windows Server 2008 AMD64 seems to have some objections as well, but it seemed
1361# that using an older MIDL compiler (v7.00.0499 instead of v7.00.0555) helps. But the W2K3 fix also works.
1362# To avoid 32-bit vs. 64-bit differences, we do the same for 32-bit windows versions.
1363$(call KB_FN_AUTO_CMD_DEPS,$(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_i.c)
1364$(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_i.c \
1365+ $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_p.c\
1366+ $(VBoxCOM_0_OUTDIR)/legacy/dlldata.c \
1367+ $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.h \
1368+ $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.tlb: $(VBOX_IDL_FILE.MSCOM) | $$(dir $$@)
1369 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1370 $(VBOX_WIN_MIDL) /nologo /W4 \
1371 $(if-expr "$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)" == "win.amd64" \
1372 ,/env amd64 /x64 /target NT50 /robust \
1373 ,/env win32 /target NT51 /robust /protocol all ) \
1374 /out $(call VBOX_FN_MAKE_WIN_PATH,$(dir $@)) \
1375 /cpp_cmd $(subst $(EXEC_X86_WIN32),,$(call VBOX_FN_MAKE_WIN_PATH,$(TOOL_$(VBOX_VCC_TOOL)_CC))) \
1376 /I $(call VBOX_FN_MAKE_WIN_PATH,$(PATH_SDK_$(VBOX_WINPSDK)_INC)) \
1377 /I idl \
1378 $(call VBOX_FN_MAKE_WIN_PATH,$(VBOX_IDL_FILE.MSCOM))
1379 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.h)
1380 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_i.c)
1381 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_p.c)
1382endif
1383
1384# The XP targetted 32-bit proxy stub works with all versions of windows (the
1385# issues leading to the VBoxProxyStubLegacy.dll are only on 64-bit windows).
1386$(call KB_FN_AUTO_CMD_DEPS,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c)
1387$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c \
1388$(if $(VBOX_WITH_MIDL_PROXY_STUB), + $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_p.c + $(VBoxCOM-x86_0_OUTDIR)/dlldata.c,) \
1389+ $(VBoxCOM-x86_0_OUTDIR)/VirtualBox.h \
1390+ $(VBoxCOM-x86_0_OUTDIR)/VirtualBox-x86.tlb: $(VBOX_IDL_FILE.MSCOM) | $$(dir $$@)
1391 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1392 $(VBOX_WIN_MIDL) /nologo /W4 \
1393 /env win32 /target NT51 /robust /protocol all \
1394 /out $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxCOM-x86_0_OUTDIR)) \
1395 /tlb $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox-x86.tlb) \
1396 /cpp_cmd $(subst $(EXEC_X86_WIN32),,$(call VBOX_FN_MAKE_WIN_PATH,$(TOOL_$(VBOX_VCC_TOOL_STEM)X86_CC))) \
1397 /I $(call VBOX_FN_MAKE_WIN_PATH,$(PATH_SDK_$(VBOX_WINPSDK)_INC)) \
1398 /I idl \
1399 $(call VBOX_FN_MAKE_WIN_PATH,$(VBOX_IDL_FILE.MSCOM))
1400 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox.h)
1401 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c)
1402 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_p.c)
1403
1404#
1405# Translation stuff
1406#
1407VBoxSVC_VBOX_HEADERS = \
1408 include/collection.h \
1409 include/MachineImpl.h
1410VBoxSVC_VBOX_TRANSLATIONS = \
1411 nls/VBoxSVC_de.ts
1412
1413VBoxC_VBOX_HEADERS = \
1414 include/ConsoleImpl.h
1415
1416VBoxC_VBOX_INTERMEDIATES = $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
1417VBoxC_VBOX_HEADERS += $(VBOX_MAIN_APIWRAPPER_INCS)
1418
1419VBoxC_VBOX_TRANSLATIONS = \
1420 nls/VBoxC_de.ts
1421
1422ifdef VBOX_WITH_JMSCOM
1423
1424 #
1425 # Java glue JAR files
1426 #
1427 VBOX_JMSCOM_JAR = $(VBoxJMscom-inst-jar_0_OUTDIR)/vboxjmscom.jar
1428 VBOX_JMSCOM_TARGET := $(PATH_TARGET)/vboxjmscom-gen
1429 VBOX_JMSCOM_GEN = $(VBOX_JMSCOM_TARGET)/jmscomgen
1430 VBOX_JMSCOM_JDEST := $(VBOX_JMSCOM_TARGET)/jdest
1431 VBOX_GLUE_XSLT_DIR := $(PATH_ROOT)/src/VBox/Main/glue
1432 VBOX_JACOB_DIR := $(PATH_ROOT)/src/libs/jacob-1.17
1433
1434 INSTALLS += VBoxJMscom-inst-jar
1435 VBoxJMscom-inst-jar_INST = $(INST_SDK)bindings/mscom/java/
1436 VBoxJMscom-inst-jar_MODE = a+r,u+w
1437 VBoxJMscom-inst-jar_SOURCES = \
1438 $(VBoxJMscom-inst-jar_0_OUTDIR)/vboxjmscom.jar
1439 VBoxJMscom-inst-jar_CLEAN = \
1440 $(VBoxJMscom-inst-jar_0_OUTDIR)/vboxjmscom.jar \
1441 $(VBOX_JMSCOM_GEN)/jmscomglue.list \
1442 $(wildcard \
1443 $(VBOX_JMSCOM_GEN)/java/*.java \
1444 $(VBOX_JMSCOM_JDEST)/*.class \
1445 $(VBOX_JMSCOM_JDEST)/*/*.class \
1446 $(VBOX_JMSCOM_JDEST)/*/*/*.class \
1447 $(VBOX_JMSCOM_JDEST)/*/*/*/*.class \
1448 )
1449 VBoxJMscom-inst-jar_BLDDIRS += $(VBOX_JMSCOM_GEN)/java
1450 $(call KB_FN_DO_PASS0_ON_TARGET,VBoxJMscom-inst-jar) # Sets VBoxJMscom-inst-jar_0_OUTDIR
1451
1452 $(call KB_FN_AUTO_CMD_DEPS,$(VBOX_JMSCOM_GEN)/jmscomglue.list)
1453 $(VBOX_JMSCOM_GEN)/jmscomglue.list: \
1454 $(VBOX_XIDL_FILE) \
1455 $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl \
1456 $(VBOX_FILESPLIT) \
1457 | $(VBOX_JMSCOM_GEN)/java/
1458 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1459 $(call MSG_L1,Generating Java MSCOM glue files from XIDL)
1460 $(QUIET)$(RM) -f $(wildcard $(VBOX_JMSCOM_GEN)/java/*.java)
1461 $(QUIET)$(VBOX_XSLTPROC) \
1462 --stringparam filelistonly "" \
1463 --stringparam G_vboxApiSuffix $(VBOX_API_SUFFIX) \
1464 --stringparam G_vboxGlueStyle mscom \
1465 --stringparam G_vboxDirPrefix "" \
1466 -o $(VBOX_JMSCOM_GEN)/java/merged.file $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl $(VBOX_XIDL_FILE)
1467 $(QUIET)$(VBOX_FILESPLIT) $(VBOX_JMSCOM_GEN)/java/merged.file $(VBOX_JMSCOM_GEN)/java
1468 $(QUIET)echo $(VBOX_JMSCOM_GEN)/java/*.java > $@
1469
1470 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxJMscom-inst-jar_0_OUTDIR)/vboxjmscom.jar)
1471 $(VBoxJMscom-inst-jar_0_OUTDIR)/vboxjmscom.jar: $(VBOX_JMSCOM_GEN)/jmscomglue.list | $$(dir $$@)
1472 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1473 $(call MSG_TOOL,javac,$(notdir $@),jmscomglue.list,)
1474 $(QUIET)$(RM) -Rf $(VBOX_JMSCOM_JDEST)
1475 $(QUIET)$(MKDIR) -p $(VBOX_JMSCOM_JDEST)
1476 $(call MSG_TOOL,javac,$(notdir $@),...,)
1477 $(QUIET)$(VBOX_JAVAC) $(VBOX_JAVAC_OPTS) @$(VBOX_JMSCOM_GEN)/jmscomglue.list \
1478 -d $(VBOX_JMSCOM_JDEST) -classpath "$(VBOX_JMSCOM_JDEST)$(VBOX_SEP)$(VBOX_JACOB_DIR)/jacob.jar"
1479 $(call MSG_LINK,$(notdir $@),$@)
1480 $(QUIET)$(VBOX_JAR) cf $@ -C $(VBOX_JMSCOM_JDEST) .
1481
1482 ## @todo compile TestVBox.java (see below) to have sanity checking
1483endif # VBOX_WITH_JMSCOM
1484
1485#
1486# Install Java glue sample code.
1487#
1488INSTALLS += javagluesample
1489javagluesample_INST = $(INST_SDK)bindings/glue/java/
1490javagluesample_MODE = a+r,u+w
1491javagluesample_SOURCES = \
1492 $(VBOX_PATH_MAIN_SRC)/glue/tests/TestVBox.java=>TestVBox.java \
1493 $(VBOX_PATH_MAIN_SRC)/glue/tests/Makefile=>Makefile
1494
1495#
1496# Rules associated with VBoxAPIWrap (in typical invocation order).
1497# We keep them down here to simplify the use of VBoxAPIWrap_0_OUTDIR.
1498#
1499
1500# Generate a make include file which lists the wrapper header and source files.
1501$(call KB_FN_AUTO_CMD_DEPS,$(VBoxAPIWrap_VBOX_KMK_FILE).ts)
1502$(VBoxAPIWrap_VBOX_KMK_FILE).ts \
1503+| $(VBoxAPIWrap_VBOX_KMK_FILE): \
1504 $(VBOX_XIDL_FILE) \
1505 $(VBOX_PATH_MAIN_SRC)/idl/apiwrap-server-filelist.xsl \
1506 $(VBOX_PATH_MAIN_SRC)/Makefile.kmk
1507 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1508 $(call MSG_GENERATE,,$(VBoxAPIWrap_VBOX_KMK_FILE))
1509 $(QUIET)$(RM) -f $@
1510 $(QUIET)$(MKDIR) -p $(@D)
1511 $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
1512 $(if $(VBOX_WITH_SDS),-stringparam g_fVBoxWithSDS yes,) \
1513 -o $@ $(VBOX_PATH_MAIN_SRC)/idl/apiwrap-server-filelist.xsl $(VBOX_XIDL_FILE)
1514 $(QUIET)$(CP) --changed -fv $@ $(VBoxAPIWrap_VBOX_KMK_FILE)
1515
1516# Generate the header files for the wrappers.
1517$(call KB_FN_AUTO_CMD_DEPS,$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-headers)
1518$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-headers \
1519+| $(VBOX_MAIN_APIWRAPPER_GEN_HDRS): \
1520 $(VBOX_XIDL_FILE) \
1521 $(VBOX_PATH_MAIN_SRC)/idl/typemap-shared.inc.xsl \
1522 $(VBoxAPIWrap_VBOX_XSLT) \
1523 $(VBOX_FILESPLIT) \
1524 | $$(dir $$@)
1525 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1526 $(call MSG_L1,Generating C++ Server API wrapper header files from XIDL)
1527 $(QUIET)$(RM) -f -- $(filter-out $(VBOX_MAIN_APIWRAPPER_GEN_HDRS), $(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.h))
1528 $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
1529 --stringparam generating "headers" \
1530 -o $@ $(VBoxAPIWrap_VBOX_XSLT) $(VBOX_XIDL_FILE)
1531 $(QUIET)$(VBOX_FILESPLIT) $@ $(VBoxAPIWrap_0_OUTDIR)
1532
1533# Generate the DTrace probes for the wrappers and combine them with handcoded probes.
1534$(call KB_FN_AUTO_CMD_DEPS,$(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d.ts)
1535$(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d.ts \
1536+| $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d: \
1537 $(VBOX_XIDL_FILE) \
1538 $(VBOX_PATH_MAIN_SRC)/idl/typemap-shared.inc.xsl \
1539 $(VBoxAPIWrap_VBOX_XSLT) \
1540 $(VBOX_FILESPLIT) \
1541 | $$(dir $$@)
1542 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1543 $(call MSG_L1,Generating DTrace Provider for the VBox API (from XIDL))
1544 $(QUIET)$(RM) -f -- "$@" "[email protected]"
1545 $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
1546 --stringparam generating "dtrace-probes" \
1547 -o "$@" $(VBoxAPIWrap_VBOX_XSLT) $(VBOX_XIDL_FILE)
1548 $(QUIET)$(SED) -e '' -o "[email protected]" \
1549 "$(VBOX_PATH_MAIN_SRC)/src-all/VBoxAPI-start.d" \
1550 "$@" \
1551 "$(VBOX_PATH_MAIN_SRC)/src-all/VBoxAPI-end.d"
1552 $(QUIET)$(MV) -- "[email protected]" "$@"
1553 $(QUIET)$(CP) --changed -fv -- "$@" "$(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d"
1554
1555# Generate the wrapper source files - split in two due to long processing time
1556$(call KB_FN_AUTO_CMD_DEPS,$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-even)
1557$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-even \
1558+| $(VBOX_MAIN_APIWRAPPER_GEN_SRCS_EVEN): \
1559 $(VBOX_XIDL_FILE) \
1560 $(VBOX_PATH_MAIN_SRC)/idl/typemap-shared.inc.xsl \
1561 $(VBoxAPIWrap_VBOX_XSLT) \
1562 $(VBOX_FILESPLIT) \
1563 | $$(dir $$@)
1564 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1565 $(call MSG_L1,Generating C++ Server API wrapper files from XIDL - part 1)
1566 $(QUIET)$(RM) -f -- $(filter-out $(VBOX_MAIN_APIWRAPPER_GEN_SRCS), $(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.cpp))
1567 $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
1568 --stringparam generating "sources" \
1569 --param reminder 0 \
1570 -o $@ $(VBoxAPIWrap_VBOX_XSLT) $(VBOX_XIDL_FILE)
1571 $(QUIET)$(VBOX_FILESPLIT) $@ $(VBoxAPIWrap_0_OUTDIR)
1572
1573$(call KB_FN_AUTO_CMD_DEPS,$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-odd)
1574$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-odd \
1575+| $(VBOX_MAIN_APIWRAPPER_GEN_SRCS_ODD): \
1576 $(VBOX_XIDL_FILE) \
1577 $(VBOX_PATH_MAIN_SRC)/idl/typemap-shared.inc.xsl \
1578 $(VBoxAPIWrap_VBOX_XSLT) \
1579 $(VBOX_FILESPLIT) \
1580 | $$(dir $$@)
1581 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1582 $(call MSG_L1,Generating C++ Server API wrapper files from XIDL - part 2)
1583 $(QUIET)$(RM) -f -- $(filter-out $(VBOX_MAIN_APIWRAPPER_GEN_SRCS), $(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.cpp))
1584 $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
1585 --stringparam generating "sources" \
1586 --param reminder 1 \
1587 -o $@ $(VBoxAPIWrap_VBOX_XSLT) $(VBOX_XIDL_FILE)
1588 $(QUIET)$(VBOX_FILESPLIT) $@ $(VBoxAPIWrap_0_OUTDIR)
1589
1590testapiwrappers:: \
1591 $(VBoxAPIWrap_0_OUTDIR)/apiwrappers-headers \
1592 $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d.ts \
1593 $(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-odd \
1594 $(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-even
1595
1596
1597#
1598# NLS stuff.
1599#
1600updatenls::
1601 $(VBOX_LUPDATE) $(VBoxSVC_SOURCES) $(VBoxSVC_VBOX_HEADERS) -ts $(VBoxSVC_VBOX_TRANSLATIONS)
1602 $(VBOX_LUPDATE) $(VBoxC_SOURCES) $(VBoxC_VBOX_HEADERS) -ts $(VBoxC_VBOX_TRANSLATIONS)
1603
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