VirtualBox

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

Last change on this file since 86753 was 86753, checked in by vboxsync, 4 years ago

OCI: bugref:9722 - Add DataStreamWrap.cpp to extpack VBoxAPIWrap_SOURCES

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