VirtualBox

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

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

Shared Clipboard/URI: Update.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 60.2 KB
Line 
1# $Id: Makefile.kmk 78683 2019-05-23 10:07:21Z 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_SHARED_CLIPBOARD),VBOX_WITH_SHARED_CLIPBOARD,) \
837 $(if $(VBOX_WITH_SHARED_CLIPBOARD_URI_LIST),VBOX_WITH_SHARED_CLIPBOARD_URI_LIST,) \
838 $(if $(VBOX_WITH_USB),VBOX_WITH_USB,) \
839 $(if $(VBOX_WITH_VRDEAUTH_IN_VBOXSVC),VBOX_WITH_VRDEAUTH_IN_VBOXSVC,)
840ifdef VBOX_WITH_CRHGSMI
841 VBoxC_DEFS += VBOX_WITH_CRHGSMI
842endif
843ifdef VBOX_WITH_NETSHAPER
844 VBoxC_DEFS += VBOX_WITH_NETSHAPER
845endif
846VBoxC_DEFS.darwin.x86 = VBOX_WITH_2X_4GB_ADDR_SPACE
847VBoxC_DEFS.win.x86 += _WIN32_WINNT=0x0500
848VBoxC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
849
850if $(KBUILD_TARGET) != "win" && $(VBOX_GCC_VERSION_CXX) >= 40900 # gcc 4.9.x (4.8.x is causing endless RT_ELEMENT trouble)
851# VBoxC_CXXFLAGS = -Wunused -Wconversion
852endif
853
854VBoxC_SDKS = VBOX_LIBPNG VBOX_ZLIB
855
856if defined(VBOX_WITH_RECORDING) && defined(VBOX_WITH_LIBVPX)
857VBoxC_SDKS += VBOX_VPX
858VBoxC_DEFS += VBOX_WITH_RECORDING VBOX_WITH_LIBVPX
859VBoxC_SOURCES += \
860 xml/Settings.cpp \
861 src-client/EBMLWriter.cpp \
862 src-client/WebMWriter.cpp \
863 src-client/Recording.cpp \
864 src-client/RecordingInternals.cpp \
865 src-client/RecordingStream.cpp \
866 src-client/RecordingUtils.cpp
867
868 if defined(VBOX_WITH_AUDIO_RECORDING) && defined(VBOX_WITH_LIBOPUS)
869VBoxC_SDKS += VBOX_OPUS
870VBoxC_DEFS += VBOX_WITH_AUDIO_RECORDING VBOX_WITH_LIBOPUS
871VBoxC_SOURCES += src-client/DrvAudioRec.cpp
872 endif
873endif # VBOX_WITH_RECORDING && VBOX_WITH_LIBVPX
874
875ifdef VBOX_WITH_OPENSSL_FIPS
876VBoxC_SDKS += VBOX_OPENSSL2
877endif
878
879VBoxC_INCS = \
880 include \
881 $(VBoxC_0_OUTDIR) \
882 $(VBOX_MAIN_APIWRAPPER_INCS) \
883 $(dir $(VBOX_XML_SCHEMADEFS_H)) \
884 $(VBOX_MAIN_APIWRAPPER_DIR)/dtrace \
885 $(VBOX_GRAPHICS_INCS)
886VBoxC_INCS.win = \
887 $(VBoxCOM_0_OUTDIR) \
888 .
889
890VBoxC_LDFLAGS.darwin = \
891 -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxC.dylib \
892 -exported_symbols_list $(VBoxC_0_OUTDIR)/VBoxC.def \
893 -framework IOKit
894VBoxC_LDFLAGS.win += /MANIFEST \
895 /DELAYLOAD:user32.dll
896
897
898VBoxC_LIBS += \
899 $(PATH_STAGE_LIB)/VBoxAPIWrap$(VBOX_SUFF_LIB) \
900 $(if-expr "$(LIB_VMM)" == "$(VBOX_LIB_VMM_LAZY)",$(LIB_REM),) \
901 $(VBOX_LIB_VMM_LAZY)
902VBoxC_LIBS.win += \
903 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/psapi.lib \
904 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/delayimp.lib
905ifdef VBOX_WITH_NETFLT
906 VBoxC_LIBS.win += \
907 $(PATH_STAGE_LIB)/VBoxDrvCfg$(VBOX_SUFF_LIB) \
908 $(PATH_SDK_$(VBOX_WINDDK)_LIB)/newdev.lib \
909 $(PATH_STAGE_LIB)/WinNetConfig$(VBOX_SUFF_LIB) \
910 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
911 $(PATH_SDK_$(VBOX_WINPSDK)_LIB)/WbemUuid.Lib
912 VBoxC_LDFLAGS.win += \
913 /DELAYLOAD:newdev.dll \
914 /DELAYLOAD:setupapi.dll \
915 /DELAYLOAD:iphlpapi.dll
916endif
917
918ifdef VBOX_WITH_CROGL
919 VBoxC_LIBS += $(PATH_STAGE_LIB)/VBoxOGLTest$(VBOX_SUFF_LIB)
920 VBoxC_LDFLAGS.darwin += -framework OpenGL
921endif
922
923ifdef VBOX_WITH_DRAG_AND_DROP
924 VBoxC_LIBS += $(PATH_STAGE_LIB)/VBoxDnDHostR3Lib$(VBOX_SUFF_LIB)
925endif
926
927VBoxC_INTERMEDIATES = \
928 $(VBOX_MAIN_PREREQS) \
929 $(VBOX_XML_SCHEMADEFS_H) \
930 $(VBOX_AUTOGEN_EVENT_H) \
931 $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
932
933VBoxC_SOURCES += \
934 $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d \
935 src-all/DisplayPNGUtil.cpp \
936 src-all/DisplayResampleImage.cpp \
937 src-all/DisplayUtils.cpp \
938 src-all/EventImpl.cpp \
939 src-all/Global.cpp \
940 src-all/GlobalStatusConversion.cpp \
941 src-all/HashedPw.cpp \
942 src-all/Logging.cpp \
943 src-all/PCIDeviceAttachmentImpl.cpp \
944 src-all/ProgressImpl.cpp \
945 src-all/SecretKeyStore.cpp \
946 src-all/SharedFolderImpl.cpp \
947 src-all/AutoCaller.cpp \
948 src-all/ThreadTask.cpp \
949 src-all/VirtualBoxBase.cpp \
950 src-all/VirtualBoxErrorInfoImpl.cpp \
951 $(if $(VBOX_WITH_EXTPACK),src-all/ExtPackManagerImpl.cpp src-all/ExtPackUtil.cpp,) \
952 src-client/UsbWebcamInterface.cpp \
953 $(if $(VBOX_WITH_USB_CARDREADER),src-client/UsbCardReader.cpp,) \
954 src-client/Nvram.cpp \
955 src-client/AdditionsFacilityImpl.cpp \
956 src-client/BusAssignmentManager.cpp \
957 $(if $(VBOX_WITH_PCI_PASSTHROUGH),src-client/PCIRawDevImpl.cpp,) \
958 src-client/ClientTokenHolder.cpp \
959 src-client/ConsoleImpl.cpp \
960 src-client/ConsoleImpl2.cpp \
961 src-client/ConsoleImplTeleporter.cpp \
962 src-client/ConsoleVRDPServer.cpp \
963 src-client/DisplayImpl.cpp \
964 src-client/DisplayImplLegacy.cpp \
965 src-client/DisplaySourceBitmapImpl.cpp \
966 src-client/EmulatedUSBImpl.cpp \
967 src-client/GuestImpl.cpp \
968 src-client/GuestCtrlImpl.cpp \
969 src-client/KeyboardImpl.cpp \
970 src-client/MachineDebuggerImpl.cpp \
971 src-client/MouseImpl.cpp \
972 src-client/RemoteUSBDeviceImpl.cpp \
973 src-client/SessionImpl.cpp \
974 src-client/USBDeviceImpl.cpp \
975 src-client/VBoxDriversRegister.cpp \
976 src-client/VirtualBoxClientImpl.cpp \
977 src-client/VMMDevInterface.cpp \
978 $(VBOX_AUTOGEN_EVENT_CPP) \
979 $(VBOX_XML_SCHEMADEFS_CPP)
980
981# Audio bits.
982VBoxC_SOURCES += \
983 ../Devices/Audio/AudioMixBuffer.cpp \
984 ../Devices/Audio/DrvAudioCommon.cpp \
985 src-client/AudioDriver.cpp \
986 $(if $(VBOX_WITH_AUDIO_VRDE),src-client/DrvAudioVRDE.cpp,)
987
988VBoxC_SOURCES.win = \
989 src-client/win/dllmain.cpp \
990 src-client/win/VBoxC.def \
991 src-client/win/VBoxC.rc
992ifdef VBOX_WITH_GUEST_CONTROL
993 VBoxC_SOURCES += \
994 src-client/GuestSessionImplTasks.cpp \
995 src-client/GuestCtrlPrivate.cpp \
996 src-client/GuestDirectoryImpl.cpp \
997 src-client/GuestFileImpl.cpp \
998 src-client/GuestFsObjInfoImpl.cpp \
999 src-client/GuestProcessImpl.cpp \
1000 src-client/GuestSessionImpl.cpp
1001endif
1002ifdef VBOX_WITH_DRAG_AND_DROP
1003 VBoxC_SOURCES += \
1004 src-client/GuestDnDPrivate.cpp \
1005 src-client/GuestDnDSourceImpl.cpp \
1006 src-client/GuestDnDTargetImpl.cpp
1007endif
1008ifdef VBOX_WITH_SHARED_CLIPBOARD
1009 VBoxC_SOURCES += \
1010 src-client/SharedClipboardPrivate.cpp
1011endif
1012ifdef VBOX_WITH_XPCOM
1013 VBoxC_SOURCES += \
1014 src-client/xpcom/module.cpp
1015endif
1016ifdef VBOX_WITH_HGCM
1017 VBoxC_SOURCES += \
1018 src-client/HGCMObjects.cpp \
1019 src-client/HGCMThread.cpp \
1020 src-client/HGCM.cpp
1021endif
1022ifdef VBOX_WITH_USB
1023 VBoxC_SOURCES += \
1024 src-client/RemoteUSBBackend.cpp
1025endif
1026ifndef VBOX_WITH_VRDEAUTH_IN_VBOXSVC
1027 VBoxC_SOURCES += \
1028 src-all/AuthLibrary.cpp
1029endif
1030
1031$(call KB_FN_DO_PASS0_ON_TARGET,VBoxC) # Sets VBoxC_0_OUTDIR
1032
1033ifeq ($(KBUILD_TARGET),darwin)
1034 VBoxC_ORDERDEPS += $(VBoxC_0_OUTDIR)/VBoxC.def
1035 VBoxC_CLEAN += $(VBoxC_0_OUTDIR)/VBoxC.def
1036 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxC_0_OUTDIR)/VBoxC.def)
1037 $(VBoxC_0_OUTDIR)/VBoxC.def:
1038 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1039 $(RM) -f $@
1040 $(APPEND) $@ _NSGetModule
1041 $(APPEND) $@ _VBoxDriversRegister
1042endif
1043
1044src-client/ConsoleImpl.cpp_DEFS = \
1045 $(if $(VBOX_WITH_OPENSSL_FIPS), VBOX_OPENSSL_FIPS,)
1046
1047
1048src-client/win/VBoxC.rc_DEPS = $(VBoxC_0_OUTDIR)/VBoxC.rgs $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb
1049VBoxC_CLEAN.win += $(VBoxC_0_OUTDIR)/VBoxC.rgs
1050$(call KB_FN_AUTO_CMD_DEPS,$(VBoxC_0_OUTDIR)/VBoxC.rgs)
1051$(VBoxC_0_OUTDIR)/VBoxC.rgs: $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
1052 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1053 $(VBOX_XSLTPROC) \
1054 --stringparam Application VirtualBox \
1055 --stringparam Module VBoxC \
1056 -o $@ \
1057 $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl \
1058 $(VBOX_XIDL_FILE)
1059
1060ifdef VBOX_WITH_32_ON_64_MAIN_API
1061 #
1062 # 32-bit VBox API Client In-Process module.
1063 #
1064 # This is currently just a 32-bit version of VBoxC. It might be desirable to
1065 # split up VBoxC into a simple client and a VM client part later, in which
1066 # case this module will be a simple client.
1067 #
1068 # Note! One important thing is that the typelib for this DLL must be build
1069 # with the /env win32 switch and the VBoxC typelib with /env amd64, if
1070 # not they will overwrite each others typelib module entry.
1071 #
1072 DLLS += VBoxClient-x86
1073 VBoxClient-x86_TEMPLATE = VBoxMainComp-x86
1074 VBoxClient-x86_EXTENDS = VBoxC
1075if defined(VBOX_WITH_PRECOMPILED_HEADERS) && "$(KBUILD_TARGET)" == "win" ## @todo fix inheritance (fixed in r3253)
1076 VBoxClient-x86_USES = vccprecomp
1077 VBoxClient-x86_PCH_HDR := $(PATH_SUB_CURRENT)/src-client/win/precomp_vcc.h
1078endif
1079 VBoxClient-x86_SDKS = $(filter-out VBOX_OPUS VBOX_VPX,$(VBoxC_SDKS))
1080 VBoxClient-x86_DEFS = VBOX_COM_INPROC_API_CLIENT \
1081 $(filter-out VBOX_WITH_RECORDING VBOX_WITH_LIBVPX VBOX_WITH_AUDIO_RECORDING VBOX_WITH_LIBOPUS,$(VBoxC_DEFS))
1082 VBoxClient-x86_INCS.win = \
1083 $(VBoxClient-x86_0_OUTDIR) \
1084 $(VBoxCOM-x86_0_OUTDIR) \
1085 $(VBoxC_INCS.win)
1086 VBoxClient-x86_SOURCES = \
1087 src-all/EventImpl.cpp \
1088 src-all/Global.cpp \
1089 src-all/GlobalStatusConversion.cpp \
1090 src-all/AutoCaller.cpp \
1091 src-all/ThreadTask.cpp \
1092 src-all/VirtualBoxBase.cpp \
1093 src-all/VirtualBoxErrorInfoImpl.cpp \
1094 src-client/ClientTokenHolder.cpp \
1095 src-client/SessionImpl.cpp \
1096 src-client/VirtualBoxClientImpl.cpp \
1097 $(VBOX_AUTOGEN_EVENT_CPP) \
1098 $(VBOX_XML_SCHEMADEFS_CPP)
1099 VBoxClient-x86_SOURCES.win = \
1100 src-client/win/dllmain.cpp \
1101 src-client/win/VBoxClient-x86.def \
1102 src-client/win/VBoxClient-x86.rc
1103 ifdef VBOX_WITH_XPCOM
1104 VBoxClient-x86_SOURCES += \
1105 src-client/xpcom/module.cpp
1106 endif
1107 VBoxClient-x86_LIBS = \
1108 $(PATH_STAGE_LIB)/VBoxAPIWrap-x86$(VBOX_SUFF_LIB)
1109 VBoxClient-x86_LIBS.win = $(NO_SUCH_VARIABLE)
1110 VBoxClient-x86_LIBS.win.x86 += \
1111 $(PATH_TOOL_$(VBOX_VCC_TOOL_STEM)X86_LIB)/delayimp.lib \
1112 $(PATH_SDK_$(VBOX_WINPSDK)_LIB.x86)/WbemUuid.Lib
1113 VBoxClient-x86_CLEAN.win += $(VBoxClient-x86_0_OUTDIR)/VBoxClient-x86.rgs
1114 $(call KB_FN_DO_PASS0_ON_TARGET,VBoxClient-x86) # Sets VBoxClient-x86_0_OUTDIR
1115
1116 src-client/win/VBoxClient-x86.rc_DEPS = \
1117 $(VBoxClient-x86_0_OUTDIR)/VBoxClient-x86.rgs \
1118 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox-x86.tlb
1119
1120 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxClient-x86_0_OUTDIR)/VBoxClient-x86.rgs)
1121 $(VBoxClient-x86_0_OUTDIR)/VBoxClient-x86.rgs: \
1122 $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl \
1123 $(VBOX_XIDL_FILE) | $$(dir $$@)
1124 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1125 $(VBOX_XSLTPROC) \
1126 --stringparam Application VirtualBox \
1127 --stringparam Module VBoxC \
1128 -o $@ \
1129 $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl \
1130 $(VBOX_XIDL_FILE)
1131endif
1132
1133#
1134# The VBoxExtPackHelperApp.
1135#
1136ifdef VBOX_WITH_EXTPACK
1137 PROGRAMS += VBoxExtPackHelperApp
1138 VBoxExtPackHelperApp_TEMPLATE = VBoxR3SetUidToRoot
1139 VBoxExtPackHelperApp_LDFLAGS.darwin = -framework Security
1140 VBoxExtPackHelperApp_LDFLAGS.win = /SUBSYSTEM:windows
1141 VBoxExtPackHelperApp_SOURCES = \
1142 src-helper-apps/VBoxExtPackHelperApp.cpp \
1143 src-all/ExtPackUtil.cpp
1144 VBoxExtPackHelperApp_SOURCES.win = \
1145 src-helper-apps/VBoxExtPackHelperApp.rc
1146 VBoxExtPackHelperApp_LIBS = \
1147 $(LIB_RUNTIME)
1148endif # VBOX_WITH_EXTPACK
1149
1150#
1151# VolInfo
1152#
1153ifdef VBOX_WITH_DEVMAPPER
1154 PROGRAMS.linux += VBoxVolInfo
1155 VBoxVolInfo_TEMPLATE = VBoxR3SetUidToRoot
1156 VBoxVolInfo_SOURCES = src-helper-apps/VBoxVolInfo.cpp
1157 VBoxVolInfo_LIBS = devmapper
1158endif
1159
1160
1161endif # !defined(VBOX_ONLY_SDK) && !defined(VBOX_ONLY_EXTPACKS) (the ifndef is far above)
1162ifndef VBOX_ONLY_SDK
1163
1164
1165#
1166# VBoxCOM - COM Abstraction Layer library
1167#
1168LIBRARIES += VBoxCOM
1169VBoxCOM_TEMPLATE = VBoxMainLib
1170VBoxCOM_INTERMEDIATES = $(VBOX_MAIN_PREREQS) \
1171 $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
1172VBoxCOM_SOURCES = \
1173 glue/com.cpp \
1174 glue/VBoxLogRelCreate.cpp \
1175 glue/GetVBoxUserHomeDirectory.cpp \
1176 glue/initterm.cpp \
1177 glue/string.cpp \
1178 glue/AutoLock.cpp \
1179 glue/EventQueue.cpp \
1180 glue/NativeEventQueue.cpp \
1181 glue/ErrorInfo.cpp \
1182 glue/errorprint.cpp
1183VBoxCOM_INCS += $(VBOX_MAIN_APIWRAPPER_INCS) \
1184 include
1185ifeq ($(KBUILD_TARGET),win)
1186 ifdef VBOX_WITH_MIDL_PROXY_STUB
1187 VBoxCOM_DEFS.win = VBOX_WITH_AUTO_COM_REG_UPDATE
1188 endif
1189 VBoxCOM_DEFS.x86 = _WIN32_WINNT=0x0500
1190 VBoxCOM_DEFS.amd64 = _WIN32_WINNT=0x0510
1191 VBoxCOM_SOURCES += \
1192 $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c
1193 VBoxCOM_CLEAN = \
1194 $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
1195 $(VBoxCOM_0_OUTDIR)/VirtualBox_p.c \
1196 $(VBoxCOM_0_OUTDIR)/dlldata.c \
1197 $(VBoxCOM_0_OUTDIR)/VirtualBox.h \
1198 $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb
1199 VBoxCOM_CLEAN += \
1200 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_i.c \
1201 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_p.c \
1202 $(VBoxCOM_0_OUTDIR)/legacy/dlldata.c \
1203 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.h \
1204 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.tlb
1205 VBoxCOM_BLDDIRS = $(VBoxCOM_0_OUTDIR)/legacy/
1206else # !win
1207 VBoxCOM_SOURCES += \
1208 $(VBoxCOM_0_OUTDIR)/VirtualBox_XPCOM_i.c \
1209 glue/xpcom/helpers.cpp
1210endif # !win
1211
1212glue/VBoxLogRelCreate.cpp_DEFS = KBUILD_TYPE=\"$(KBUILD_TYPE)\"
1213
1214# 32-bit version of VBoxCOM.
1215if defined(VBOX_WITH_32_ON_64_MAIN_API) && !defined(VBOX_ONLY_EXTPACKS)
1216 LIBRARIES += VBoxCOM-x86
1217 VBoxCOM-x86_TEMPLATE = VBoxMainLib-x86
1218 VBoxCOM-x86_EXTENDS = VBoxCOM
1219 ifeq ($(KBUILD_TARGET),win)
1220 VBoxCOM-x86_CLEAN = \
1221 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c \
1222 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_p.c \
1223 $(VBoxCOM-x86_0_OUTDIR)/dlldata.c \
1224 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox.h \
1225 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox.tlb
1226 endif
1227endif
1228
1229# -MD version for the GUI in -MDd builds.
1230ifeq ($(KBUILD_TARGET).$(VBOX_VCC_CRT_TYPE),win.d)
1231 ifndef VBOX_ONLY_EXTPACKS
1232 LIBRARIES += VBoxCOM-GUI
1233 USES += qt5
1234 VBoxCOM-GUI_TEMPLATE = VBOXQTGUI$(if-expr defined(VBOX_WITH_HARDENING),,EXE)
1235 VBoxCOM-GUI_EXTENDS = VBoxCOM
1236 endif
1237endif
1238
1239endif # !VBOX_ONLY_SDK
1240
1241
1242#
1243# Installs com related thing(s) to bin.
1244#
1245INSTALLS.win += VBoxMain-com-inst
1246VBoxMain-com-inst_INST = $(INST_BIN)
1247VBoxMain-com-inst_MODE = a+r,u+w
1248VBoxMain-com-inst_SOURCES = src-all/win/comregister.cmd
1249
1250
1251if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "linux" && !defined(VBOX_ONLY_EXTPACKS)
1252 #
1253 # Installs linux/hardening related things to components.
1254 #
1255 INSTALLS.linux += VBoxMain-hardening-inst
1256 VBoxMain-hardening-inst_INST = $(INST_BIN)components/
1257 VBoxMain-hardening-inst_SYMLINKS = \
1258 VBoxDDU.so=>../VBoxDDU.so \
1259 VBoxREM.so=>../VBoxREM.so \
1260 VBoxRT.so=>../VBoxRT.so \
1261 VBoxVMM.so=>../VBoxVMM.so \
1262 VBoxXPCOM.so=>../VBoxXPCOM.so
1263endif
1264
1265
1266if defined(VBOX_WITH_MIDL_PROXY_STUB) && "$(KBUILD_TARGET)" == "win" && !defined(VBOX_ONLY_EXTPACKS)
1267 #
1268 # Experimental COM proxy + stub DLL w/ automatic registration updating.
1269 #
1270 # The Legacy stub is for older 64-bit windows versions (pre Windows 7) as we
1271 # were having various problems on windows server 2003 and 2008 with the code
1272 # MIDL generated. Also, in windows 7 there are some potentially interesting
1273 # changes in the generated code where it uses new helpers from OLE32.
1274 #
1275 DLLS += VBoxProxyStub
1276 VBoxProxyStub_TEMPLATE = VBOXMAINCOMP
1277 VBoxProxyStub_DEFS = REGISTER_PROXY_DLL PROXY_CLSID_IS="$(VBOX_MIDL_PROXY_CLSID_IS)" \
1278 $(if $(VBOX_WITH_SDS),VBOX_WITH_SDS,)\
1279 $(if $(VBOX_WITH_SDS_CLIENT_WATCHER),VBOX_WITH_SDS_CLIENT_WATCHER,)
1280 VBoxProxyStub_DEFS.win.x86 = WIN32
1281 VBoxProxyStub_SDKS = VBOX_NTDLL
1282 VBoxProxyStub_DEFPATH = $(VBoxCOM_0_OUTDIR)/# Hack to workaround drive letter in $(VBoxCOM_0_OUTDIR)/ for CFLAGS hack below.
1283 VBoxProxyStub_INCS = $(VBoxCOM_0_OUTDIR)/
1284 VBoxProxyStub_SOURCES := \
1285 VirtualBox_p.c \
1286 VirtualBox_i.c \
1287 $(PATH_SUB_CURRENT)/src-all/win/VBoxProxyStub.def \
1288 $(PATH_SUB_CURRENT)/src-all/win/VBoxProxyStub.rc \
1289 $(PATH_SUB_CURRENT)/src-all/win/VBoxProxyStub.c
1290 src-all/win/VBoxProxyStub.rc_DEPS = $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb
1291 VBoxProxyStub_VirtualBox_p.c_CFLAGS.x86 = /Gz # Workaround for incorrect ObjectStublessClient* prototypes in SDK v7.1.
1292
1293 DLLS += VBoxProxyStubLegacy
1294 VBoxProxyStubLegacy_TEMPLATE = VBOXMAINCOMP
1295 VBoxProxyStubLegacy_EXTENDS = VBoxProxyStub
1296 VBoxProxyStubLegacy_DEFS = $(VBoxProxyStub_DEFS) VBOX_IN_PROXY_STUB_LEGACY
1297 VBoxProxyStubLegacy_INCS = $(VBoxCOM_0_OUTDIR)/legacy/
1298 VBoxProxyStubLegacy_SOURCES = \
1299 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_p.c \
1300 $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_i.c \
1301 src-all/win/VBoxProxyStub.def \
1302 src-all/win/VBoxProxyStubLegacy.rc \
1303 src-all/win/VBoxProxyStub.c
1304 src-all/win/VBoxProxyStubLegacy.rc_DEPS = $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.tlb
1305
1306 ifdef VBOX_WITH_32_ON_64_MAIN_API
1307 DLLS += VBoxProxyStub-x86
1308 VBoxProxyStub-x86_TEMPLATE = VBoxMainComp-x86
1309 VBoxProxyStub-x86_SDKS = VBOX_NTDLL
1310 VBoxProxyStub-x86_DEFS = $(VBoxProxyStub_DEFS) VBOX_PROXY_STUB_32_ON_64 WIN32
1311 VBoxProxyStub-x86_INCS = $(VBoxCOM-x86_0_OUTDIR)/
1312 VBoxProxyStub-x86_SOURCES = \
1313 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_p.c \
1314 $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c \
1315 src-all/win/VBoxProxyStub.c \
1316 src-all/win/VBoxProxyStub-x86.rc \
1317 src-all/win/VBoxProxyStub.def
1318 src-all/win/VBoxProxyStub-x86.rc_DEPS = $(VBoxCOM-x86_0_OUTDIR)/VirtualBox-x86.tlb
1319 endif
1320endif
1321
1322
1323
1324# generate rules
1325include $(FILE_KBUILD_SUB_FOOTER)
1326
1327
1328
1329#
1330# Additions rules.
1331#
1332
1333## @todo this hack ain't cutting it any longer. (the file name is abspath'ed since ages now.)
1334glue/xpcom/helpers.cpp: $(VBOX_IDL_TYPELIB.XPCOM)
1335
1336$(call KB_FN_AUTO_CMD_DEPS_EX,$(VBOX_IDL_FILE.XPCOM),$(PATH_OUT)/VBOX_IDL_FILE.XPCOM.vbox-dep)
1337$(VBOX_IDL_FILE.XPCOM): $(VBOX_PATH_MAIN_SRC)/idl/xpidl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
1338 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS_EX,$(PATH_OUT)/VBOX_IDL_FILE.XPCOM.vbox-dep)
1339 $(call MSG_TOOL,xsltproc,VBoxSVC,$(VBOX_PATH_MAIN_SRC)/idl/xpidl.xsl,$@)
1340 $(QUIET)$(VBOX_XSLTPROC) -o $@ $(VBOX_PATH_MAIN_SRC)/idl/xpidl.xsl $(VBOX_XIDL_FILE)
1341
1342$(call KB_FN_AUTO_CMD_DEPS_EX,$(VBOX_IDL_TYPELIB.XPCOM),$(PATH_OUT)/VBOX_IDL_TYPELIB.XPCOM.vbox-dep)
1343$(VBOX_IDL_TYPELIB.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
1344 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS_EX,$(PATH_OUT)/VBOX_IDL_TYPELIB.XPCOM.vbox-dep)
1345 $(call MSG_TOOL,xpidl,VBoxSVC,$(VBOX_IDL_FILE.XPCOM),$@)
1346 $(QUIET)$(VBOX_XPIDL_ENV)$(VBOX_XPIDL) -m typelib -I $(VBOX_PATH_XPCOM_IDL) -e $@ $(VBOX_IDL_FILE.XPCOM)
1347 $(CHMOD) 0644 $@
1348## @todo ^^^^^^^^^^^^ fix horrible hack
1349
1350$(call KB_FN_AUTO_CMD_DEPS_EX,$(VBOX_IDL_HEADER.XPCOM),$(PATH_OUT)/VBOX_IDL_HEADER.XPCOM.vbox-dep)
1351$(VBOX_IDL_HEADER.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
1352 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS_EX,$(PATH_OUT)/VBOX_IDL_HEADER.XPCOM.vbox-dep)
1353 $(call MSG_TOOL,xpidl,VBoxSVC,$(VBOX_IDL_FILE.XPCOM),$@)
1354 $(QUIET)$(VBOX_XPIDL_ENV)$(VBOX_XPIDL) -m header -I $(VBOX_PATH_XPCOM_IDL) -e $@ $(VBOX_IDL_FILE.XPCOM)
1355
1356$(call KB_FN_AUTO_CMD_DEPS_EX,$(VBOX_IDL_FILE.MSCOM),$(PATH_OUT)/VBOX_IDL_FILE.MSCOM.vbox-dep)
1357$(VBOX_IDL_FILE.MSCOM): $(VBOX_PATH_MAIN_SRC)/idl/midl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
1358 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS_EX,$(PATH_OUT)/VBOX_IDL_FILE.MSCOM.vbox-dep)
1359 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
1360 $(QUIET)$(VBOX_XSLTPROC) -o $@ \
1361 $(if $(VBOX_WITH_MIDL_PROXY_STUB),-stringparam g_fGenProxy yes,) \
1362 $(if $(VBOX_WITH_SDS),-stringparam g_fVBoxWithSDS yes,) \
1363 $(VBOX_PATH_MAIN_SRC)/idl/midl.xsl $(VBOX_XIDL_FILE)
1364
1365
1366# Aliases for testing purposes.
1367ifdef VBOX_WITH_XPCOM
1368testidl: $(VBOX_IDL_FILE.XPCOM) $(VBOX_IDL_TYPELIB.XPCOM) $(VBoxCOM_0_OUTDIR)/VirtualBox_XPCOM_i.c
1369testidlhdr: $(VBOX_IDL_HEADER.XPCOM)
1370else
1371testidl: $(VBOX_IDL_FILE.MSCOM) $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
1372 $(if $(VBOX_WITH_32_ON_64_MAIN_API),$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c,)
1373endif
1374
1375
1376$(VBoxCOM_0_OUTDIR)/VirtualBox_XPCOM_i.c: $(VBOX_PATH_MAIN_SRC)/idl/xpidl_iid.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
1377 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
1378 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
1379
1380##
1381# Edits $1 and adding #pragma directives for disabling warnings windows.h causes.
1382# @param 1 The name of the file to edit.
1383define def_VBoxMainDisableMscWarnings
1384 $(QUIET)$(MV) -f "$1" "$1.tmp"
1385 $(QUIET)$(APPEND) -nt "$1" \
1386 '#pragma warning(push) /* -Wall and windows.h */' \
1387 '#pragma warning(disable:4668 4255)' \
1388 '#if _MSC_VER >= 1800 /* RT_MSC_VER_VC120 */' \
1389 '# pragma warning(disable:4005)' \
1390 '#endif' \
1391 ''
1392 $(QUIET)$(CAT_EXT) "$1.tmp" >> "$1"
1393 $(QUIET)$(APPEND) -n "$1" \
1394 '' \
1395 '#pragma warning(pop)' \
1396 ''
1397 $(QUIET)$(RM) -f "$1.tmp"
1398
1399endef
1400
1401# Note! Because we've got a different proxy stub DLL for pre windows 7 64-bit hosts, we target windows 7 for AMD64.
1402# The output is different and hopefully more efficient, at least memory wise (using more helpers in OLE32).
1403# Note! We're checking for win.amd64 below when setting the target because of the SDK build which happens on linux.amd64
1404# but with a 32-bit Wine.
1405$(call KB_FN_AUTO_CMD_DEPS,$(VBoxCOM_0_OUTDIR)/VirtualBox_i.c)
1406$(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
1407$(if $(VBOX_WITH_MIDL_PROXY_STUB), + $(VBoxCOM_0_OUTDIR)/VirtualBox_p.c + $(VBoxCOM_0_OUTDIR)/dlldata.c,) \
1408+ $(VBoxCOM_0_OUTDIR)/VirtualBox.h \
1409+ $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb: $(VBOX_IDL_FILE.MSCOM) | $$(dir $$@)
1410 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1411 $(VBOX_WIN_MIDL) /nologo /W4 \
1412 /env $(if-expr "$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)" == "win.amd64" ,amd64,win32) \
1413 /robust /protocol all /target $(if-expr defined(VBOX_WITH_MIDL_PROXY_STUB),NT61,NT51) \
1414 /out $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxCOM_0_OUTDIR)) \
1415 /cpp_cmd $(subst $(EXEC_X86_WIN32),,$(call VBOX_FN_MAKE_WIN_PATH,$(TOOL_$(VBOX_VCC_TOOL)_CC))) \
1416 /I $(call VBOX_FN_MAKE_WIN_PATH,$(PATH_SDK_$(VBOX_WINPSDK)_INC)) \
1417 /I idl \
1418 $(call VBOX_FN_MAKE_WIN_PATH,$(VBOX_IDL_FILE.MSCOM))
1419 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/VirtualBox.h)
1420 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/VirtualBox_i.c)
1421 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/VirtualBox_p.c)
1422
1423if defined(VBOX_WITH_MIDL_PROXY_STUB)
1424# -Windows Server 2003 AMD64 SP1 does not like the result when using '/protocol all' and '/target NT51'.
1425# -Vista AMD64 SP1 and Windows Server 2008 AMD64 seems to have some objections as well, but it seemed
1426# that using an older MIDL compiler (v7.00.0499 instead of v7.00.0555) helps. But the W2K3 fix also works.
1427# To avoid 32-bit vs. 64-bit differences, we do the same for 32-bit windows versions.
1428$(call KB_FN_AUTO_CMD_DEPS,$(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_i.c)
1429$(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_i.c \
1430+ $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_p.c\
1431+ $(VBoxCOM_0_OUTDIR)/legacy/dlldata.c \
1432+ $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.h \
1433+ $(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.tlb: $(VBOX_IDL_FILE.MSCOM) | $$(dir $$@)
1434 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1435 $(VBOX_WIN_MIDL) /nologo /W4 \
1436 $(if-expr "$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)" == "win.amd64" \
1437 ,/env amd64 /x64 /target NT50 /robust \
1438 ,/env win32 /target NT51 /robust /protocol all ) \
1439 /out $(call VBOX_FN_MAKE_WIN_PATH,$(dir $@)) \
1440 /cpp_cmd $(subst $(EXEC_X86_WIN32),,$(call VBOX_FN_MAKE_WIN_PATH,$(TOOL_$(VBOX_VCC_TOOL)_CC))) \
1441 /I $(call VBOX_FN_MAKE_WIN_PATH,$(PATH_SDK_$(VBOX_WINPSDK)_INC)) \
1442 /I idl \
1443 $(call VBOX_FN_MAKE_WIN_PATH,$(VBOX_IDL_FILE.MSCOM))
1444 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/legacy/VirtualBox.h)
1445 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_i.c)
1446 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM_0_OUTDIR)/legacy/VirtualBox_p.c)
1447endif
1448
1449# The XP targetted 32-bit proxy stub works with all versions of windows (the
1450# issues leading to the VBoxProxyStubLegacy.dll are only on 64-bit windows).
1451$(call KB_FN_AUTO_CMD_DEPS,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c)
1452$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c \
1453$(if $(VBOX_WITH_MIDL_PROXY_STUB), + $(VBoxCOM-x86_0_OUTDIR)/VirtualBox_p.c + $(VBoxCOM-x86_0_OUTDIR)/dlldata.c,) \
1454+ $(VBoxCOM-x86_0_OUTDIR)/VirtualBox.h \
1455+ $(VBoxCOM-x86_0_OUTDIR)/VirtualBox-x86.tlb: $(VBOX_IDL_FILE.MSCOM) | $$(dir $$@)
1456 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1457 $(VBOX_WIN_MIDL) /nologo /W4 \
1458 /env win32 /target NT51 /robust /protocol all \
1459 /out $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxCOM-x86_0_OUTDIR)) \
1460 /tlb $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox-x86.tlb) \
1461 /cpp_cmd $(subst $(EXEC_X86_WIN32),,$(call VBOX_FN_MAKE_WIN_PATH,$(TOOL_$(VBOX_VCC_TOOL_STEM)X86_CC))) \
1462 /I $(call VBOX_FN_MAKE_WIN_PATH,$(PATH_SDK_$(VBOX_WINPSDK)_INC)) \
1463 /I idl \
1464 $(call VBOX_FN_MAKE_WIN_PATH,$(VBOX_IDL_FILE.MSCOM))
1465 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox.h)
1466 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_i.c)
1467 $(call def_VBoxMainDisableMscWarnings,$(VBoxCOM-x86_0_OUTDIR)/VirtualBox_p.c)
1468
1469#
1470# Translation stuff
1471#
1472VBoxSVC_VBOX_HEADERS = \
1473 include/collection.h \
1474 include/MachineImpl.h
1475VBoxSVC_VBOX_TRANSLATIONS = \
1476 nls/VBoxSVC_de.ts
1477
1478VBoxC_VBOX_HEADERS = \
1479 include/ConsoleImpl.h
1480
1481VBoxC_VBOX_INTERMEDIATES = $(VBOX_MAIN_APIWRAPPER_GEN_HDRS)
1482VBoxC_VBOX_HEADERS += $(VBOX_MAIN_APIWRAPPER_INCS)
1483
1484VBoxC_VBOX_TRANSLATIONS = \
1485 nls/VBoxC_de.ts
1486
1487ifdef VBOX_WITH_JMSCOM
1488
1489 #
1490 # Java glue JAR files
1491 #
1492 VBOX_JMSCOM_JAR = $(VBoxJMscom-inst-jar_0_OUTDIR)/vboxjmscom.jar
1493 VBOX_JMSCOM_TARGET := $(PATH_TARGET)/vboxjmscom-gen
1494 VBOX_JMSCOM_GEN = $(VBOX_JMSCOM_TARGET)/jmscomgen
1495 VBOX_JMSCOM_JDEST := $(VBOX_JMSCOM_TARGET)/jdest
1496 VBOX_GLUE_XSLT_DIR := $(PATH_ROOT)/src/VBox/Main/glue
1497 VBOX_JACOB_DIR := $(PATH_ROOT)/src/libs/jacob-1.17
1498
1499 INSTALLS += VBoxJMscom-inst-jar
1500 VBoxJMscom-inst-jar_INST = $(INST_SDK)bindings/mscom/java/
1501 VBoxJMscom-inst-jar_MODE = a+r,u+w
1502 VBoxJMscom-inst-jar_SOURCES = \
1503 $(VBoxJMscom-inst-jar_0_OUTDIR)/vboxjmscom.jar
1504 VBoxJMscom-inst-jar_CLEAN = \
1505 $(VBoxJMscom-inst-jar_0_OUTDIR)/vboxjmscom.jar \
1506 $(VBOX_JMSCOM_GEN)/jmscomglue.list \
1507 $(wildcard \
1508 $(VBOX_JMSCOM_GEN)/java/*.java \
1509 $(VBOX_JMSCOM_JDEST)/*.class \
1510 $(VBOX_JMSCOM_JDEST)/*/*.class \
1511 $(VBOX_JMSCOM_JDEST)/*/*/*.class \
1512 $(VBOX_JMSCOM_JDEST)/*/*/*/*.class \
1513 )
1514 VBoxJMscom-inst-jar_BLDDIRS += $(VBOX_JMSCOM_GEN)/java
1515 $(call KB_FN_DO_PASS0_ON_TARGET,VBoxJMscom-inst-jar) # Sets VBoxJMscom-inst-jar_0_OUTDIR
1516
1517 $(call KB_FN_AUTO_CMD_DEPS,$(VBOX_JMSCOM_GEN)/jmscomglue.list)
1518 $(VBOX_JMSCOM_GEN)/jmscomglue.list: \
1519 $(VBOX_XIDL_FILE) \
1520 $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl \
1521 $(VBOX_FILESPLIT) \
1522 | $(VBOX_JMSCOM_GEN)/java/
1523 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1524 $(call MSG_L1,Generating Java MSCOM glue files from XIDL)
1525 $(QUIET)$(RM) -f $(wildcard $(VBOX_JMSCOM_GEN)/java/*.java)
1526 $(QUIET)$(VBOX_XSLTPROC) \
1527 --stringparam filelistonly "" \
1528 --stringparam G_vboxApiSuffix $(VBOX_API_SUFFIX) \
1529 --stringparam G_vboxGlueStyle mscom \
1530 --stringparam G_vboxDirPrefix "" \
1531 -o $(VBOX_JMSCOM_GEN)/java/merged.file $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl $(VBOX_XIDL_FILE)
1532 $(QUIET)$(VBOX_FILESPLIT) $(VBOX_JMSCOM_GEN)/java/merged.file $(VBOX_JMSCOM_GEN)/java
1533 $(QUIET)echo $(VBOX_JMSCOM_GEN)/java/*.java > $@
1534
1535 $(call KB_FN_AUTO_CMD_DEPS,$(VBoxJMscom-inst-jar_0_OUTDIR)/vboxjmscom.jar)
1536 $(VBoxJMscom-inst-jar_0_OUTDIR)/vboxjmscom.jar: $(VBOX_JMSCOM_GEN)/jmscomglue.list | $$(dir $$@)
1537 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1538 $(call MSG_TOOL,javac,$(notdir $@),jmscomglue.list,)
1539 $(QUIET)$(RM) -Rf $(VBOX_JMSCOM_JDEST)
1540 $(QUIET)$(MKDIR) -p $(VBOX_JMSCOM_JDEST)
1541 $(call MSG_TOOL,javac,$(notdir $@),...,)
1542 $(QUIET)$(VBOX_JAVAC) $(VBOX_JAVAC_OPTS) @$(VBOX_JMSCOM_GEN)/jmscomglue.list \
1543 -d $(VBOX_JMSCOM_JDEST) -classpath "$(VBOX_JMSCOM_JDEST)$(VBOX_SEP)$(VBOX_JACOB_DIR)/jacob.jar"
1544 $(call MSG_LINK,$(notdir $@),$@)
1545 $(QUIET)$(VBOX_JAR) cf $@ -C $(VBOX_JMSCOM_JDEST) .
1546
1547 ## @todo compile TestVBox.java (see below) to have sanity checking
1548endif # VBOX_WITH_JMSCOM
1549
1550#
1551# Install Java glue sample code.
1552#
1553INSTALLS += javagluesample
1554javagluesample_INST = $(INST_SDK)bindings/glue/java/
1555javagluesample_MODE = a+r,u+w
1556javagluesample_SOURCES = \
1557 $(VBOX_PATH_MAIN_SRC)/glue/tests/TestVBox.java=>TestVBox.java \
1558 $(VBOX_PATH_MAIN_SRC)/glue/tests/Makefile=>Makefile
1559
1560#
1561# Rules associated with VBoxAPIWrap (in typical invocation order).
1562# We keep them down here to simplify the use of VBoxAPIWrap_0_OUTDIR.
1563#
1564
1565# Generate a make include file which lists the wrapper header and source files.
1566$(call KB_FN_AUTO_CMD_DEPS,$(VBoxAPIWrap_VBOX_KMK_FILE).ts)
1567$(VBoxAPIWrap_VBOX_KMK_FILE).ts \
1568+| $(VBoxAPIWrap_VBOX_KMK_FILE): \
1569 $(VBOX_XIDL_FILE) \
1570 $(VBOX_PATH_MAIN_SRC)/idl/apiwrap-server-filelist.xsl \
1571 $(VBOX_PATH_MAIN_SRC)/Makefile.kmk
1572 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1573 $(call MSG_GENERATE,,$(VBoxAPIWrap_VBOX_KMK_FILE))
1574 $(QUIET)$(RM) -f $@
1575 $(QUIET)$(MKDIR) -p $(@D)
1576 $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
1577 $(if $(VBOX_WITH_SDS),-stringparam g_fVBoxWithSDS yes,) \
1578 -o $@ $(VBOX_PATH_MAIN_SRC)/idl/apiwrap-server-filelist.xsl $(VBOX_XIDL_FILE)
1579 $(QUIET)$(CP) --changed -fv $@ $(VBoxAPIWrap_VBOX_KMK_FILE)
1580
1581# Generate the header files for the wrappers.
1582$(call KB_FN_AUTO_CMD_DEPS,$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-headers)
1583$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-headers \
1584+| $(VBOX_MAIN_APIWRAPPER_GEN_HDRS): \
1585 $(VBOX_XIDL_FILE) \
1586 $(VBOX_PATH_MAIN_SRC)/idl/typemap-shared.inc.xsl \
1587 $(VBoxAPIWrap_VBOX_XSLT) \
1588 $(VBOX_FILESPLIT) \
1589 | $$(dir $$@)
1590 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1591 $(call MSG_L1,Generating C++ Server API wrapper header files from XIDL)
1592 $(QUIET)$(RM) -f -- $(filter-out $(VBOX_MAIN_APIWRAPPER_GEN_HDRS), $(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.h))
1593 $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
1594 --stringparam generating "headers" \
1595 -o $@ $(VBoxAPIWrap_VBOX_XSLT) $(VBOX_XIDL_FILE)
1596 $(QUIET)$(VBOX_FILESPLIT) $@ $(VBoxAPIWrap_0_OUTDIR)
1597
1598# Generate the DTrace probes for the wrappers and combine them with handcoded probes.
1599$(call KB_FN_AUTO_CMD_DEPS,$(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d.ts)
1600$(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d.ts \
1601+| $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d: \
1602 $(VBOX_XIDL_FILE) \
1603 $(VBOX_PATH_MAIN_SRC)/idl/typemap-shared.inc.xsl \
1604 $(VBoxAPIWrap_VBOX_XSLT) \
1605 $(VBOX_FILESPLIT) \
1606 | $$(dir $$@)
1607 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1608 $(call MSG_L1,Generating DTrace Provider for the VBox API (from XIDL))
1609 $(QUIET)$(RM) -f -- "$@" "$@.tmp"
1610 $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
1611 --stringparam generating "dtrace-probes" \
1612 -o "$@" $(VBoxAPIWrap_VBOX_XSLT) $(VBOX_XIDL_FILE)
1613 $(QUIET)$(SED) -e '' -o "$@.tmp" \
1614 "$(VBOX_PATH_MAIN_SRC)/src-all/VBoxAPI-start$(if-expr "$(VBOX_HOST_DTRACE_VERSION)" == "dtrace: Sun D 1.6.2",-alternative,).d" \
1615 "$@" \
1616 "$(VBOX_PATH_MAIN_SRC)/src-all/VBoxAPI-end$(if-expr "$(VBOX_HOST_DTRACE_VERSION)" == "dtrace: Sun D 1.6.2",-alternative,).d"
1617 $(QUIET)$(MV) -- "$@.tmp" "$@"
1618 $(QUIET)$(CP) --changed -fv -- "$@" "$(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d"
1619
1620# Generate the wrapper source files - split in two due to long processing time
1621$(call KB_FN_AUTO_CMD_DEPS,$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-even)
1622$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-even \
1623+| $(VBOX_MAIN_APIWRAPPER_GEN_SRCS_EVEN): \
1624 $(VBOX_XIDL_FILE) \
1625 $(VBOX_PATH_MAIN_SRC)/idl/typemap-shared.inc.xsl \
1626 $(VBoxAPIWrap_VBOX_XSLT) \
1627 $(VBOX_FILESPLIT) \
1628 | $$(dir $$@)
1629 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1630 $(call MSG_L1,Generating C++ Server API wrapper files from XIDL - part 1)
1631 $(QUIET)$(RM) -f -- $(filter-out $(VBOX_MAIN_APIWRAPPER_GEN_SRCS), $(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.cpp))
1632 $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
1633 --stringparam generating "sources" \
1634 --param reminder 0 \
1635 -o $@ $(VBoxAPIWrap_VBOX_XSLT) $(VBOX_XIDL_FILE)
1636 $(QUIET)$(VBOX_FILESPLIT) $@ $(VBoxAPIWrap_0_OUTDIR)
1637
1638$(call KB_FN_AUTO_CMD_DEPS,$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-odd)
1639$(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-odd \
1640+| $(VBOX_MAIN_APIWRAPPER_GEN_SRCS_ODD): \
1641 $(VBOX_XIDL_FILE) \
1642 $(VBOX_PATH_MAIN_SRC)/idl/typemap-shared.inc.xsl \
1643 $(VBoxAPIWrap_VBOX_XSLT) \
1644 $(VBOX_FILESPLIT) \
1645 | $$(dir $$@)
1646 $(call KB_FN_AUTO_CMD_DEPS_COMMANDS)
1647 $(call MSG_L1,Generating C++ Server API wrapper files from XIDL - part 2)
1648 $(QUIET)$(RM) -f -- $(filter-out $(VBOX_MAIN_APIWRAPPER_GEN_SRCS), $(wildcard $(VBoxAPIWrap_0_OUTDIR)/*.cpp))
1649 $(QUIET)$(VBOX_XSLTPROC) --stringparam KBUILD_HOST $(KBUILD_HOST) \
1650 --stringparam generating "sources" \
1651 --param reminder 1 \
1652 -o $@ $(VBoxAPIWrap_VBOX_XSLT) $(VBOX_XIDL_FILE)
1653 $(QUIET)$(VBOX_FILESPLIT) $@ $(VBoxAPIWrap_0_OUTDIR)
1654
1655testapiwrappers:: \
1656 $(VBoxAPIWrap_0_OUTDIR)/apiwrappers-headers \
1657 $(VBoxAPIWrap_0_OUTDIR)/VBoxAPI.d.ts \
1658 $(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-odd \
1659 $(VBoxAPIWrap_0_OUTDIR)/apiwrappers-sources-even
1660
1661
1662#
1663# NLS stuff.
1664#
1665updatenls::
1666 $(VBOX_LUPDATE) $(VBoxSVC_SOURCES) $(VBoxSVC_VBOX_HEADERS) -ts $(VBoxSVC_VBOX_TRANSLATIONS)
1667 $(VBOX_LUPDATE) $(VBoxC_SOURCES) $(VBoxC_VBOX_HEADERS) -ts $(VBoxC_VBOX_TRANSLATIONS)
1668
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