VirtualBox

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

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

Main/Makefile.kmk: Extpack build fix for bugref:9242.

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