VirtualBox

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

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

Main: bugref:9224: Main+VBoxManageDisk+doc part

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