VirtualBox

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

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

Main: Split out the two text script classes from UnattendedScript since they are now used separately from unattended installation. bugref:9152

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