VirtualBox

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

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

VBoxSDS,VBoxSVC: Some DEBUG_bird experiments for identifying the caller. bugref:3300

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