VirtualBox

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

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

VBoxSDS: Enabled the process watcher for debug builds. bugref:3300 [backed out previous commit]

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