VirtualBox

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

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

AMD IOMMU: bugref:9654 Main/API: AMD IOMMU support.

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