VirtualBox

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

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

OCI: Fix extpack build.

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