VirtualBox

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

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

Main/DHCPD: bugref:9288 Use new implementation of DHCP server (VCC 10 and GCC 4.4.4 support, other build fixes).

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