VirtualBox

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

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

Shared Clipboard/Transfers: Removed clipboard area handling code. bugref:9437

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