VirtualBox

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

Last change on this file since 67249 was 67249, checked in by vboxsync, 7 years ago

Main/Appliance++: Removed non-VBOX_WITH_NEW_TAR_CREATOR code.

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