VirtualBox

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

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

Main: Kicked out RpcChannelHook and IVirtualBoxclientList hacks (basically rolling back r12027) as these won't be used. See bugref:3300 for details.

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