VirtualBox

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

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

Main: Redoing the IDHCPServer interface, part I. bugref:9288

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