VirtualBox

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

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

Main/Global.cpp: Split out status code conversion functions into a separate file.

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