VirtualBox

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

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

Main,FE/Qt: Only use precompiled headers for gcc 5.x and higher (for now).

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