VirtualBox

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

Last change on this file since 81740 was 81710, checked in by vboxsync, 5 years ago

Main: Preps for embedding the EFI firmware into VBoxDD2.

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