VirtualBox

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

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

Intel IOMMU: bugref:9967 Main, VBoxManage: Handle Intel IOMMU in places where it's missing. Without VBOX_WITH_IOMMU_INTEL define, it's considered not implemented.

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