VirtualBox

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

Last change on this file since 72070 was 71718, checked in by vboxsync, 7 years ago

Main/Makefile.kmk: intent fixes

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