VirtualBox

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

Last change on this file since 74087 was 73873, checked in by vboxsync, 6 years ago

OCI: Move OCI code to the extension pack

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