VirtualBox

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

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

Main/Makefile.kmk: Even more cleanup fixes.

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