VirtualBox

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

Last change on this file since 76657 was 76657, checked in by vboxsync, 6 years ago

Main/Makefile.kmk: oops

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