VirtualBox

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

Last change on this file since 36043 was 35967, checked in by vboxsync, 14 years ago

Main/VBoxManage: Update on guest facilities, added IAdditionsFacility; now it's possible to iterate over known facilities (see VBoxManage showvminfo --details). Also, facilities now are grouped into several classes (AdditionsFacilityClass).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 32.7 KB
Line 
1# $Id: Makefile.kmk 35967 2011-02-15 09:37:16Z vboxsync $
2## @file
3# Makefile for the VBox Main module.
4#
5
6#
7# Copyright (C) 2006-2010 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# Include sub-makefile(s).
23#
24ifdef VBOX_WITH_WEBSERVICES
25 include $(PATH_SUB_CURRENT)/webservice/Makefile.kmk
26endif
27include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
28include $(PATH_SUB_CURRENT)/cbinding/Makefile.kmk
29
30
31#
32# Targets and globals (bit of a mess...)
33#
34VBOX_PATH_MAIN_SRC := $(PATH_SUB_CURRENT)
35
36ifdef VBOX_ONLY_SDK
37 # I'm Evil! Dr. Evil.
38 VBoxCOM_0_OUTDIR = $(PATH_TARGET)/VBoxCOM
39 BLDDIRS += $(VBoxCOM_0_OUTDIR) $(PATH_BIN)/components
40 include $(KBUILD_PATH)/tools/VCC70.kmk
41 include $(KBUILD_PATH)/sdks/WINPSDK.kmk
42endif # !VBOX_ONLY_SDK
43
44
45# Construct VBOX_MAIN_DEFS
46## @todo eliminate or expand VBOX_MAIN_DEFS.
47VBOX_MAIN_DEFS =
48ifneq ($(KBUILD_TARGET),win)
49 ifndef VBOX_WITH_XPCOM
50 $(error "VBox: VBOX_WITH_XPCOM isn't defined")
51 endif
52 ifneq ($(KBUILD_TARGET),os2)
53 VBOX_MAIN_DEFS += VBOX_WITH_SYS_V_IPC_SESSION_WATCHER
54 endif
55endif
56VBOX_MAIN_DEFS += \
57 $(if $(VBOX_WITH_RAW_MODE),VBOX_WITH_RAW_MODE,) \
58 $(if $(VBOX_WITH_NETFLT),VBOX_WITH_NETFLT,) \
59 $(if $(VBOX_WITH_COPYTOGUEST),VBOX_WITH_COPYTOGUEST,) \
60 $(if $(VBOX_WITH_CROGL),VBOX_WITH_CROGL,) \
61 $(if $(VBOX_WITH_GUEST_PROPS),VBOX_WITH_GUEST_PROPS,) \
62 $(if $(VBOX_WITH_GUEST_PROPS_RDONLY_GUEST),VBOX_WITH_GUEST_PROPS_RDONLY_GUEST,) \
63 $(if $(VBOX_WITH_GUEST_CONTROL),VBOX_WITH_GUEST_CONTROL,) \
64 $(if $(VBOX_WITH_HOSTNETIF_API),VBOX_WITH_HOSTNETIF_API,) \
65 $(if $(VBOX_WITH_VDE),VBOX_WITH_VDE,)
66
67# Unconditionally enable the new semaphore key generation code
68VBOX_MAIN_DEFS += VBOX_WITH_NEW_SYS_V_KEYGEN
69
70VBOX_IDL_FILE.MSCOM = $(VBOX_PATH_SDK)/bindings/mscom/idl/VirtualBox.idl
71VBOX_IDL_FILE.XPCOM = $(VBOX_PATH_SDK)/bindings/xpcom/idl/VirtualBox_XPCOM.idl
72
73VBOX_IDL_TYPELIB.XPCOM = $(PATH_BIN)/components/VirtualBox_XPCOM.xpt
74VBOX_IDL_HEADER.XPCOM = $(VBOX_PATH_SDK)/bindings/xpcom/include/VirtualBox_XPCOM.h
75
76# The MS COM specific stuff.
77if defined(VBOX_ONLY_SDK) || "$(KBUILD_TARGET)" == "win"
78 OTHERS += \
79 $(VBOX_IDL_FILE.MSCOM) \
80 $(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h \
81 $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox.tlb \
82 $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox_i.c
83 OTHER_CLEAN += \
84 $(VBOX_IDL_FILE.MSCOM) \
85 $(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h \
86 $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox.tlb \
87 $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox_i.c \
88 $(VBoxCOM_0_OUTDIR)/VirtualBox.h \
89 $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
90 $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb
91
92 VBOX_MAIN_PREREQS += $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c
93 BLDDIRS += $(VBOX_PATH_SDK)/bindings/mscom/idl
94endif
95
96# The XPCOM specific stuff.
97if defined(VBOX_ONLY_SDK) || "$(KBUILD_TARGET)" != "win"
98 OTHERS += $(VBOX_IDL_FILE.XPCOM) $(VBOX_IDL_TYPELIB.XPCOM) $(VBOX_IDL_HEADER.XPCOM)
99 OTHER_CLEAN += \
100 $(VBOX_IDL_FILE.XPCOM) \
101 $(VBOX_IDL_HEADER.XPCOM) \
102 $(VBOX_IDL_TYPELIB.XPCOM)
103
104 VBOX_MAIN_PREREQS += $(VBOX_IDL_TYPELIB.XPCOM) $(VBOX_IDL_HEADER.XPCOM)
105 BLDDIRS += \
106 $(VBOX_PATH_SDK)/bindings/xpcom/idl \
107 $(VBOX_PATH_SDK)/bindings/xpcom/include
108endif # xpcom
109
110
111#
112# Strip documentation from source XIDL so that we don't get a full
113# recompile every time a comma in the documentation is changed.
114#
115$(VBOX_XIDL_FILE).ts +| $(VBOX_XIDL_FILE): \
116 $(VBOX_XIDL_FILE_SRC) \
117 $(VBOX_PATH_MAIN_SRC)/idl/docstrip.xsl \
118 | $$(dir $$@)
119# $(CP) -fv $< $(VBOX_XIDL_FILE).ts
120 $(QUIET)$(VBOX_XSLTPROC) -o $(VBOX_XIDL_FILE).ts $(VBOX_PATH_MAIN_SRC)/idl/docstrip.xsl $<
121 $(QUIET)$(CP) --changed -fv $(VBOX_XIDL_FILE).ts $(VBOX_XIDL_FILE)
122
123OTHER_CLEAN += $(VBOX_XIDL_FILE) $(VBOX_XIDL_FILE).ts
124
125#
126# The Main API documentation
127#
128VBOX_MAIN_DOC_DIR = $(VBOX_PATH_SDK)/docs
129BLDDIRS += $(VBOX_MAIN_DOC_DIR)
130
131$(PATH_TARGET)/docs.Main: \
132 $(VBOX_PATH_MAIN_SRC)/Doxyfile.Main \
133 $(VBOX_PATH_MAIN_SRC)/idl/doxygen.xsl \
134 $(VBOX_XIDL_FILE_SRC) \
135 | $(PATH_TARGET)/ \
136 $(VBOX_MAIN_DOC_DIR)/
137 $(call MSG_TOOL,xsltproc,doxygen input,$<,$@)
138 $(QUIET)$(RM) -f $(wildcard $(VBOX_MAIN_DOC_DIR)/html/*) $(PATH_TARGET)/docs.Main
139 $(QUIET)$(VBOX_XSLTPROC) -o $(PATH_TARGET)/VirtualBox.idl $(VBOX_PATH_MAIN_SRC)/idl/doxygen.xsl $(VBOX_XIDL_FILE_SRC)
140 $(QUIET)$(REDIRECT) -E 'DOCDIR=$(VBOX_MAIN_DOC_DIR)' -E 'PATH_TARGET=$(PATH_TARGET)' -E 'PATH_CHM=$(subst /,\,$(VBOX_MAIN_DOC_DIR)/VirtualBoxAPI.chm)' \
141 -- doxygen $(VBOX_PATH_MAIN_SRC)/Doxyfile.Main
142 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) ">>>>>>>>>>>>>>>>>>>> Main.err: >>>>>>>>>>>>>>>>>>>>>>>>"
143 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(CAT) "$(PATH_TARGET)/Main.err"
144 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "<<<<<<<<<<<<<<<<<<<< Main.err <<<<<<<<<<<<<<<<<<<<<<<<<"
145 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "===> **************************************************"
146 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "===> Please fix above doxygen errors/warnings listed in"
147 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "===> $(PATH_TARGET)/Main.err"
148 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "===> **************************************************"
149 -$(EXEC_X86_WIN32) $(VBOX_PATH_HTML_HELP_WORKSHOP)/hhc.exe $(subst /,\\,$(VBOX_MAIN_DOC_DIR)/html/index.hhp)
150 $(APPEND) $(PATH_TARGET)/docs.Main
151# aliases
152docs.main docs.Main: $(PATH_TARGET)/docs.Main
153if !defined(VBOX_ONLY_DOCS)
154docs: $(PATH_TARGET)/docs.Main
155endif
156
157
158#
159# Some SDK bit.
160#
161INSTALLS += VBox-main-xidl
162VBox-main-xidl_INST = $(INST_SDK)bindings/
163VBox-main-xidl_SOURCES = $(VBOX_XIDL_FILE_SRC)
164
165ifdef VBOX_WITH_PYTHON
166
167# or to some subdir?
168VBOX_PYTHON_CONSTANTS = $(PATH_TARGET)/VirtualBox_constants.py
169
170INSTALLS += VBox-python-glue
171VBox-python-glue_INST = $(INST_SDK)installer
172VBox-python-glue_SOURCES = glue/vboxapi.py=>vboxapi/__init__.py \
173 $(VBOX_PYTHON_CONSTANTS)=>vboxapi/VirtualBox_constants.py
174
175$(VBOX_PYTHON_CONSTANTS): $(VBOX_PATH_MAIN_SRC)/glue/constants-python.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
176 $(call MSG_TOOL,xsltproc,Python constants,$<,$@)
177 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
178
179endif # VBOX_WITH_PYTHON
180
181ifndef VBOX_ONLY_SDK # Note this goes on for *very* long
182
183#
184# Generate SchemaDefs.h and SchemaDefs.cpp from XML Schema
185# These two files are used by both VBoxC and VBoxSVC.
186#
187BLDDIRS += $(PATH_TARGET)/Main
188VBOX_XML_SCHEMADEFS_H = $(PATH_TARGET)/Main/SchemaDefs.h
189VBOX_XML_SCHEMADEFS_CPP = $(PATH_TARGET)/Main/SchemaDefs.cpp
190VBOX_XML_SCHEMADEFS_XSL = $(VBOX_PATH_MAIN_SRC)/xml/SchemaDefs.xsl
191
192VBOX_AUTOGEN_EVENT_H = $(PATH_TARGET)/Main/VBoxEvents.h
193VBOX_AUTOGEN_EVENT_CPP = $(PATH_TARGET)/Main/VBoxEvents.cpp
194
195testschemadefs: $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP)
196
197
198#
199# VBoxSVC executable
200#
201PROGRAMS += VBoxSVC
202VBoxSVC_TEMPLATE = VBOXMAINEXE
203VBoxSVC_DEFS = \
204 VBOX_MAIN_SETTINGS_ADDONS \
205 IN_VMM_STATIC \
206 $(VBOX_MAIN_DEFS) \
207 $(if $(VBOX_WITH_VBOXSDL),VBOX_WITH_VBOXSDL,) \
208 $(if $(VBOX_WITH_HEADLESS),VBOX_WITH_HEADLESS,) \
209 $(if $(VBOX_WITH_QTGUI),VBOX_WITH_QTGUI,) \
210 $(if $(VBOX_WITH_COCOA_QT),VBOX_WITH_COCOA_QT,) \
211 $(if $(VBOX_WITH_HGCM),VBOX_WITH_HGCM,) \
212 $(if $(VBOX_MAIN_RELEASE_LOG),VBOX_MAIN_RELEASE_LOG LOG_ENABLED,) \
213 $(if $(VBOX_WITH_ALSA),VBOX_WITH_ALSA,) \
214 $(if $(VBOX_WITH_PULSE),VBOX_WITH_PULSE,) \
215 $(if $(VBOX_WITH_WINMM),VBOX_WITH_WINMM,) \
216 $(if $(VBOX_WITH_SOLARIS_OSS),VBOX_WITH_SOLARIS_OSS,) \
217 $(if $(VBOX_WITH_E1000),VBOX_WITH_E1000,) \
218 $(if $(VBOX_WITH_VIRTIO),VBOX_WITH_VIRTIO,) \
219 $(if $(VBOX_WITH_AHCI),VBOX_WITH_AHCI,) \
220 $(if $(VBOX_WITH_LSILOGIC),VBOX_WITH_LSILOGIC,) \
221 $(if $(VBOX_WITH_LINUX_COMPILER_H),VBOX_WITH_LINUX_COMPILER_H,) \
222 $(if $(VBOX_WITH_RESOURCE_USAGE_API),VBOX_WITH_RESOURCE_USAGE_API,) \
223 $(if $(VBOX_WITH_PDM_ASYNC_COMPLETION),VBOX_WITH_PDM_ASYNC_COMPLETION,) \
224 $(if $(VBOX_WITH_DBUS),$(if $(VBOX_USB_WITH_DBUS),VBOX_USB_WITH_DBUS,),) \
225 $(if $(VBOX_USB_WITH_SYSFS),VBOX_USB_WITH_SYSFS,) \
226 $(if $(VBOX_USB_WITH_INOTIFY),VBOX_USB_WITH_INOTIFY,) \
227 $(if $(VBOX_WITH_LIVE_MIGRATION),VBOX_WITH_LIVE_MIGRATION,) \
228 $(if $(VBOX_WITH_EXTPACK),VBOX_WITH_EXTPACK,) \
229 $(if $(VBOX_WITH_VUSB),VBOX_WITH_VUSB,) \
230 $(if $(VBOX_WITH_S3),VBOX_WITH_S3,) \
231 $(if $(VBOX_WITH_PCI_PASSTHROUGH),VBOX_WITH_PCI_PASSTHROUGH,)
232ifdef VBOX_WITH_USB
233 VBoxSVC_DEFS += \
234 VBOX_WITH_USB \
235 $(if $(VBOX_WITH_EHCI),VBOX_WITH_EHCI,) \
236 $(if $(VBOX_WITH_NEW_USB_CODE_ON_DARWIN),VBOX_WITH_NEW_USB_CODE_ON_DARWIN,)
237endif
238VBoxSVC_DEFS.win += VBOX_COM_OUTOFPROC_MODULE
239VBoxSVC_DEFS.win.x86 += _WIN32_WINNT=0x0500
240VBoxSVC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
241# Try to load and use libhal at runtime for probing removable media
242# VBoxSVC_DEFS.linux += VBOX_USE_LIBHAL
243VBoxSVC_DEFS.solaris += VBOX_USE_LIBHAL
244VBoxSVC_DEFS.freebsd += VBOX_USE_LIBHAL
245
246VBoxSVC_CXXFLAGS = $(filter-out -Wno-unused,$(TEMPLATE_VBOXMAINEXE_CXXFLAGS))
247## @todo We're disabling optimizations on FreeBSD to work around strange linker
248# errors in release builds. Figure out why and how to work around it in a
249# more optimal fashion.
250VBoxSVC_CXXFLAGS.freebsd = -O0
251
252VBoxSVC_INCS = \
253 include \
254 $(VBoxSVC_0_OUTDIR) \
255 $(dir $(VBOX_XML_SCHEMADEFS_H)) \
256 .
257VBoxSVC_INCS.win = \
258 $(VBoxCOM_0_OUTDIR)
259ifdef VBOX_WITH_USB
260 VBoxSVC_INCS.os2 = \
261 $(PATH_ROOT)/src/VBox/HostDrivers/VBoxUSB/os2
262endif
263
264VBoxSVC_LIBS += \
265 $(PATH_LIB)/SSMStandalone$(VBOX_SUFF_LIB) \
266 $(LIB_DDU)
267VBoxSVC_SDKS = VBOX_LIBPNG VBOX_ZLIB
268VBoxSVC_LIBS.solaris = \
269 adm \
270 nsl \
271 devinfo \
272 socket \
273 $(LIB_VMM)
274
275VBoxSVC_INTERMEDIATES = \
276 $(VBOX_MAIN_PREREQS) \
277 $(VBOX_XML_SCHEMADEFS_H) \
278 $(VBOX_AUTOGEN_EVENT_H)
279
280VBoxSVC_SOURCES = \
281 src-all/DisplayPNGUtil.cpp \
282 src-all/DisplayResampleImage.cpp \
283 src-all/DisplayUtils.cpp \
284 src-all/EventImpl.cpp \
285 src-all/Global.cpp \
286 src-all/Logging.cpp \
287 src-all/PciDeviceAttachmentImpl.cpp \
288 src-all/ProgressImpl.cpp \
289 src-all/SharedFolderImpl.cpp \
290 src-all/VirtualBoxBase.cpp \
291 src-all/VirtualBoxErrorInfoImpl.cpp \
292 $(if $(VBOX_WITH_EXTPACK),src-all/ExtPackManagerImpl.cpp src-all/ExtPackUtil.cpp,) \
293 src-server/ApplianceImpl.cpp \
294 src-server/ApplianceImplExport.cpp \
295 src-server/ApplianceImplImport.cpp \
296 src-server/ApplianceImplIO.cpp \
297 src-server/AudioAdapterImpl.cpp \
298 src-server/BandwidthControlImpl.cpp \
299 src-server/BandwidthGroupImpl.cpp \
300 src-server/BIOSSettingsImpl.cpp \
301 src-server/DHCPServerImpl.cpp \
302 src-server/DHCPServerRunner.cpp \
303 src-server/GuestOSTypeImpl.cpp \
304 src-server/HostImpl.cpp \
305 src-server/HostNetworkInterfaceImpl.cpp \
306 src-server/HostPower.cpp \
307 src-server/MachineImpl.cpp \
308 src-server/Matching.cpp \
309 src-server/MediumAttachmentImpl.cpp \
310 src-server/MediumFormatImpl.cpp \
311 src-server/MediumImpl.cpp \
312 src-server/MediumLock.cpp \
313 src-server/NATEngineImpl.cpp \
314 src-server/NetworkAdapterImpl.cpp \
315 src-server/ParallelPortImpl.cpp \
316 src-server/ProgressProxyImpl.cpp \
317 src-server/SerialPortImpl.cpp \
318 src-server/SnapshotImpl.cpp \
319 src-server/StorageControllerImpl.cpp \
320 src-server/SystemPropertiesImpl.cpp \
321 src-server/USBControllerImpl.cpp \
322 src-server/VFSExplorerImpl.cpp \
323 src-server/VirtualBoxImpl.cpp \
324 src-server/VRDEServerImpl.cpp \
325 xml/ovfreader.cpp \
326 xml/Settings.cpp \
327 $(VBOX_XML_SCHEMADEFS_CPP) \
328 $(VBOX_AUTOGEN_EVENT_CPP) \
329 $(if $(VBOX_WITH_XPCOM),src-server/xpcom/server.cpp,)
330
331VBoxSVC_SOURCES.darwin = \
332 src-server/darwin/iokit.cpp \
333 src-server/darwin/HostPowerDarwin.cpp
334
335ifdef VBOX_WITH_CROGL
336 ifneq ($(KBUILD_TARGET),darwin)
337 VBoxSVC_SOURCES += src-server/generic/OpenGLTest.cpp
338 endif
339 VBoxSVC_SOURCES.darwin += src-server/darwin/OpenGLTestDarwin.cpp
340endif
341
342VBoxSVC_SOURCES.win = \
343 src-server/win/svcmain.cpp \
344 src-server/win/svchlp.cpp \
345 src-server/win/HostPowerWin.cpp \
346 src-server/win/VBoxSVC.rc \
347 src-server/win/VBoxComEvents.cpp
348
349VBoxSVC_SOURCES.linux = \
350 src-server/linux/HostHardwareLinux.cpp
351
352VBoxSVC_SOURCES.solaris = \
353 src-server/linux/vbox-libhal.cpp \
354 src-server/solaris/DynLoadLibSolaris.cpp
355
356VBoxSVC_SOURCES.freebsd = \
357 src-server/freebsd/HostHardwareFreeBSD.cpp
358
359ifdef VBOX_WITH_USB
360 ifdef VBOX_WITH_SYSFS_BY_DEFAULT
361 src-server/linux/USBProxyServiceLinux.cpp_DEFS += VBOX_WITH_SYSFS_BY_DEFAULT
362 endif
363 VBoxSVC_SOURCES += \
364 src-server/USBDeviceFilterImpl.cpp \
365 src-server/USBProxyService.cpp \
366 src-server/HostUSBDeviceImpl.cpp
367 VBoxSVC_SOURCES.darwin += src-server/darwin/USBProxyServiceDarwin.cpp
368 VBoxSVC_SOURCES.linux += src-server/linux/USBProxyServiceLinux.cpp
369 VBoxSVC_SOURCES.linux += src-server/linux/USBGetDevices.cpp
370 VBoxSVC_SOURCES.os2 += src-server/os2/USBProxyServiceOs2.cpp
371 VBoxSVC_SOURCES.solaris += src-server/solaris/USBProxyServiceSolaris.cpp
372 VBoxSVC_SOURCES.win += src-server/win/USBProxyServiceWindows.cpp
373 VBoxSVC_SOURCES.freebsd += src-server/freebsd/USBProxyServiceFreeBSD.cpp
374endif
375
376ifdef VBOX_WITH_NETFLT
377 # Note! The includes from the TOOL has lower priority than the SDKs,
378 # since comdef.h is in both the DDK and VCC we want to make sure
379 # we're using the VCC since we're not using the DDK compiler/crt.
380 # Since this is potentially risky, restrict it to the source file
381 # needing it.
382 src-server/win/NetIf-win.cpp_INCS.win += $(PATH_TOOL_$(VBOX_VCC_TOOL)_INC)
383 VBoxSVC_LIBS.win += \
384 $(PATH_LIB)/WinNetConfig.lib \
385 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
386 $(PATH_SDK_WINPSDK_LIB)/WbemUuid.Lib
387 ifdef VBOX_NETFLT_ONDEMAND_BIND
388 VBoxSVC_DEFS.win += VBOX_NETFLT_ONDEMAND_BIND
389 endif
390endif
391VBoxSVC_LDFLAGS.darwin = -framework IOKit -framework SystemConfiguration
392
393ifdef VBOX_WITH_CROGL
394 VBoxSVC_LDFLAGS.darwin += -framework OpenGL
395endif
396
397ifeq ($(KBUILD_TYPE),debug)
398 VBoxSVC_LDFLAGS.linux += -rdynamic # for backtrace_symbols()
399endif
400
401ifdef VBOX_WITH_RESOURCE_USAGE_API
402 VBoxSVC_SOURCES += \
403 src-server/PerformanceImpl.cpp \
404 src-server/Performance.cpp
405 VBoxSVC_SOURCES.darwin += src-server/darwin/PerformanceDarwin.cpp
406 VBoxSVC_SOURCES.freebsd += src-server/freebsd/PerformanceFreeBSD.cpp
407 VBoxSVC_SOURCES.linux += src-server/linux/PerformanceLinux.cpp
408 VBoxSVC_SOURCES.os2 += src-server/os2/PerformanceOs2.cpp
409 VBoxSVC_SOURCES.solaris += src-server/solaris/PerformanceSolaris.cpp
410 VBoxSVC_SOURCES.win += src-server/win/PerformanceWin.cpp
411 VBoxSVC_LDFLAGS.darwin += -lproc
412 VBoxSVC_LDFLAGS.solaris += -lkstat
413 VBoxSVC_LDFLAGS.win += psapi.lib powrprof.lib
414endif
415
416ifdef VBOX_WITH_HOSTNETIF_API
417 VBoxSVC_SOURCES.win += src-server/win/NetIf-win.cpp
418 VBoxSVC_SOURCES.linux += src-server/linux/NetIf-linux.cpp
419 VBoxSVC_SOURCES.os2 += src-server/os2/NetIf-os2.cpp
420 VBoxSVC_SOURCES.darwin += src-server/darwin/NetIf-darwin.cpp
421 VBoxSVC_SOURCES.solaris += src-server/solaris/NetIf-solaris.cpp
422 VBoxSVC_SOURCES.freebsd += src-server/freebsd/NetIf-freebsd.cpp
423 VBoxSVC_DEFS += VBOX_WITH_HOSTNETIF_API
424 if1of ($(KBUILD_TARGET), linux darwin solaris freebsd)
425 VBoxSVC_SOURCES += src-server/generic/NetIf-generic.cpp
426 endif
427endif
428
429src-server/win/VBoxSVC.rc_INCS = $(VBoxSVC_0_OUTDIR)
430src-server/win/VBoxSVC.rc_DEPS = $(VBoxSVC_0_OUTDIR)/VBoxSVC.rgs $(VBoxSVC_0_OUTDIR)/VBoxSVC-icon.rc
431src-server/win/VBoxSVC.rc_CLEAN = $(VBoxSVC_0_OUTDIR)/VBoxSVC.rgs $(VBoxSVC_0_OUTDIR)/VBoxSVC-icon.rc
432
433$$(VBoxSVC_0_OUTDIR)/VBoxSVC-icon.rc: $(MAKEFILE_CURRENT) $(VBOX_WINDOWS_ICON_FILE) | $$(dir $$(@D))
434 $(APPEND) -t $@ '1 ICON DISCARDABLE "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
435
436$$(VBoxSVC_0_OUTDIR)/VBoxSVC.rgs: $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(dir $$(@D))
437 $(VBOX_XSLTPROC) --stringparam Module VBoxSVC -o $@ $< $(VBOX_XIDL_FILE)
438
439
440#
441# Embed XML Schema files to VBoxSVC
442#
443VBOX_XML_SCHEMA_COMMON = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-common.xsd
444VBOX_XML_SCHEMA.darwin = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-macosx.xsd
445VBOX_XML_SCHEMA.linux = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-linux.xsd
446VBOX_XML_SCHEMA.freebsd = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-freebsd.xsd
447VBOX_XML_SCHEMA.win = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-windows.xsd
448VBOX_XML_SCHEMA.os2 = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-os2.xsd
449VBOX_XML_SCHEMA.solaris = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-solaris.xsd
450
451VBOX_XML_CONVERTER_TEMPLATE = $(VBOX_PATH_MAIN_SRC)/xml/SettingsConverter.xsl
452
453$$(VBoxSVC_0_OUTDIR)/xml_VirtualBox_settings_xsd.h: $(VBOX_XML_SCHEMA.$(KBUILD_TARGET)) $(VBOX_BIN2C)
454 $(call MSG_TOOL,bin2c,VBoxSVC,$<,$@)
455 $(QUIET)$(VBOX_BIN2C) _xml_VirtualBox_settings_xsd $< $@
456
457$$(VBoxSVC_0_OUTDIR)/xml_VirtualBox_settings_common_xsd.h: $(VBOX_XML_SCHEMA_COMMON) $(VBOX_BIN2C)
458 $(call MSG_TOOL,bin2c,VBoxSVC,$<,$@)
459 $(QUIET)$(VBOX_BIN2C) _xml_VirtualBox_settings_common_xsd $< $@
460
461$$(VBoxSVC_0_OUTDIR)/xml_SettingsConverter_xsl.h: $(VBOX_XML_CONVERTER_TEMPLATE) $(VBOX_BIN2C)
462 $(call MSG_TOOL,bin2c,VBoxSVC,$<,$@)
463 $(QUIET)$(VBOX_BIN2C) _xml_SettingsConverter_xsl $< $@
464
465$(VBOX_XML_SCHEMADEFS_H): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(KBUILD_TARGET)) $(VBOX_XML_SCHEMA_COMMON) | $$(dir $$@)
466 $(call MSG_GENERATE,SchemaDefs,$@,$<)
467 $(QUIET)$(VBOX_XSLTPROC) --stringparam mode declare -o $@ $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(KBUILD_TARGET))
468
469$(VBOX_XML_SCHEMADEFS_CPP): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(KBUILD_TARGET)) $(VBOX_XML_SCHEMA_COMMON) | $$(dir $$@)
470 $(call MSG_GENERATE,SchemaDefs,$@,$<)
471 $(QUIET)$(VBOX_XSLTPROC) --stringparam mode define -o $@ $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(KBUILD_TARGET))
472
473OTHER_CLEAN += $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP)
474
475
476#
477# Generate some event stuff for VBoxSVC and VBoxC.
478#
479$(VBOX_AUTOGEN_EVENT_H): $(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
480 $(call MSG_TOOL,xsltproc,autogen events,$<,$@)
481 $(QUIET)$(VBOX_XSLTPROC) --stringparam G_kind VBoxEventHeader -o $@ $< $(VBOX_XIDL_FILE)
482
483$(VBOX_AUTOGEN_EVENT_CPP): $(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
484 $(call MSG_TOOL,xsltproc,autogen events,$<,$@)
485 $(QUIET)$(VBOX_XSLTPROC) --stringparam G_kind VBoxEvent -o $@ $< $(VBOX_XIDL_FILE)
486
487OTHER_CLEAN += $(VBOX_AUTOGEN_EVENT_H) $(VBOX_AUTOGEN_EVENT_CPP)
488
489
490#
491# VBoxTestOGL - OpenGL support test app.
492# Note! Doesn't link with VBOX_WITH_DEBUG_VCC_CRT defined because it uses Qt.
493#
494if ( defined(VBOX_WITH_QTGUI) \
495 && (defined(VBOX_WITH_CROGL) || defined(VBOX_WITH_VIDEOHWACCEL)) \
496 && !defined(VBOX_WITH_DEBUG_VCC_CRT))
497 ifneq ($(KBUILD_TARGET),darwin)
498 ifdef VBOX_WITH_VIDEOHWACCEL
499 USES += qt4
500 endif
501 PROGRAMS += VBoxTestOGL
502 VBoxTestOGL_TEMPLATE = $(if $(VBOX_WITH_VIDEOHWACCEL),$(if $(VBOX_WITH_HARDENING),VBOXQT4GUI,VBOXQT4GUIEXE),VBOXMAINEXE)
503 VBoxTestOGL_SOURCES = src-server/generic/OpenGLTestApp.cpp
504 VBoxTestOGL_LIBS = \
505 $(if $(VBOX_WITH_CROGL), \
506 $(PATH_LIB)/VBoxOGLhostspuload$(VBOX_SUFF_LIB) \
507 $(VBOX_LIB_OGL_HOSTCRUTIL),) \
508 $(if $(VBOX_WITH_VIDEOHWACCEL), $(PATH_LIB)/VBoxOGL2D$(VBOX_SUFF_LIB),) \
509 $(LIB_RUNTIME)
510 VBoxTestOGL_DEFS += \
511 $(if $(VBOX_WITH_CROGL), VBOX_WITH_CROGL,) \
512 $(if $(VBOX_WITH_VIDEOHWACCEL), VBOX_WITH_VIDEOHWACCEL,) \
513 VBOX_BUILD_TARGET=\"$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)\" \
514 $(if $(VBOX_BLEEDING_EDGE),VBOX_BLEEDING_EDGE=\"$(VBOX_BLEEDING_EDGE)\",)
515 ifdef VBOX_WITH_VIDEOHWACCEL
516 VBoxTestOGL_QT_MODULES += Core Gui OpenGL
517 VBoxTestOGL_LDFLAGS.darwin += -framework OpenGL
518 VBoxTestOGL_LIBS.win += $(PATH_SDK_WINPSDK_LIB)/Opengl32.lib
519 if1of ($(KBUILD_TARGET), solaris linux freebsd)
520 # must come after VBoxOGL2D, therefore don't set the arch-specific LIBS variable here!
521 VBoxTestOGL_LIBS += GL
522 endif
523 endif
524 VBoxTestOGL_LDFLAGS.win = /SUBSYSTEM:windows
525 endif
526endif
527
528
529ifdef VBOX_WITH_XPCOM
530#
531# VBoxSVCM - VBoxSVC wrapper module
532#
533DLLS += VBoxSVCM
534VBoxSVCM_TEMPLATE = VBOXMAINCOMP
535VBoxSVCM_DEFS = IN_RING3 $(VBOX_MAIN_DEFS)
536ifdef VBOX_WITH_HARDENING
537 VBoxSVCM_DEFS += VBOX_WITH_HARDENING
538endif
539VBoxSVCM_INCS = \
540 include \
541 $(VBoxC_0_OUTDIR) \
542 .
543VBoxSVCM_INTERMEDIATES = $(VBOX_MAIN_PREREQS)
544VBoxSVCM_SOURCES = \
545 src-server/xpcom/server_module.cpp
546VBoxSVCM_LDFLAGS.darwin = \
547 -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxSVCM.dylib \
548 -exported_symbols_list $(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def
549 ifeq ($(KBUILD_TARGET),darwin)
550VBoxSVCM_ORDERDEPS += $(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def
551VBoxSVCM_CLEAN += $(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def
552$$(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def:
553 $(RM) -f $@
554 $(APPEND) $@ _NSGetModule
555 endif
556VBoxSVCM_INTERMEDIATES += $(VBOX_IDL_HEADER.XPCOM)
557endif # VBOX_WITH_XPCOM
558
559
560#
561# VBoxC module
562#
563DLLS += VBoxC
564VBoxC_TEMPLATE = VBOXMAINCOMP
565VBoxC_SDKS = VBOX_LIBPNG VBOX_ZLIB
566VBoxC_DEFS = \
567 IN_RING3 \
568 $(VBOX_MAIN_DEFS) \
569 VBOX_COM_INPROC \
570 $(if $(VBOX_WITH_VRDP_VIDEO_CHANNEL),VBOX_WITH_VRDP_VIDEO_CHANNEL,) \
571 $(if $(VBOX_WITH_HGCM),VBOX_WITH_HGCM,) \
572 $(if $(VBOX_MAIN_RELEASE_LOG),VBOX_MAIN_RELEASE_LOG LOG_ENABLED,) \
573 $(if $(VBOX_WITH_ALSA),VBOX_WITH_ALSA,) \
574 $(if $(VBOX_WITH_PULSE),VBOX_WITH_PULSE,) \
575 $(if $(VBOX_WITH_WINMM),VBOX_WITH_WINMM,) \
576 $(if $(VBOX_WITH_SOLARIS_OSS),VBOX_WITH_SOLARIS_OSS,) \
577 $(if $(VBOX_WITH_CROSSBOW),VBOX_WITH_CROSSBOW,) \
578 $(if $(VBOX_WITH_E1000),VBOX_WITH_E1000,) \
579 $(if $(VBOX_WITH_VIRTIO),VBOX_WITH_VIRTIO,) \
580 $(if $(VBOX_WITH_EFI),VBOX_WITH_EFI,) \
581 $(if $(VBOX_WITH_PDM_ASYNC_COMPLETION),VBOX_WITH_PDM_ASYNC_COMPLETION,) \
582 $(if $(VBOX_WITH_LIVE_MIGRATION),VBOX_WITH_LIVE_MIGRATION,) \
583 $(if $(VBOX_WITH_VUSB),VBOX_WITH_VUSB,) \
584 $(if $(VBOX_WITH_HGSMI),VBOX_WITH_HGSMI,) \
585 $(if $(VBOX_WITH_VIDEOHWACCEL),VBOX_WITH_VIDEOHWACCEL,) \
586 $(if $(VBOX_WITH_USB),VBOX_WITH_USB,) \
587 $(if-expr defined(VBOX_WITH_EHCI) && defined(VBOX_WITH_USB),VBOX_WITH_EHCI,) \
588 $(if $(VBOX_WITH_EXTPACK),VBOX_WITH_EXTPACK,) \
589 $(if $(VBOX_WITH_PCI_PASSTHROUGH),VBOX_WITH_PCI_PASSTHROUGH,)
590
591VBoxC_DEFS.darwin.x86 = VBOX_WITH_2X_4GB_ADDR_SPACE
592VBoxC_DEFS.win.x86 += _WIN32_WINNT=0x0500
593VBoxC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
594
595VBoxC_INCS = \
596 include \
597 $(VBoxC_0_OUTDIR) \
598 $(dir $(VBOX_XML_SCHEMADEFS_H))
599VBoxC_INCS.win = \
600 $(VBoxCOM_0_OUTDIR) \
601 .
602
603VBoxC_LDFLAGS.darwin = \
604 -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxC.dylib \
605 -exported_symbols_list $(VBoxC_0_OUTDIR)/VBoxC.def \
606 -framework IOKit
607ifdef VBOX_USE_VCC80
608 VBoxC_LDFLAGS.win = /MANIFEST
609endif
610
611VBoxC_LIBS += \
612 $(LIB_VMM) \
613 $(LIB_REM)
614
615ifdef VBOX_WITH_NETFLT
616 VBoxC_LIBS.win += $(PATH_LIB)/WinNetConfig.lib \
617 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
618 $(PATH_SDK_WINPSDK_LIB)/WbemUuid.Lib
619endif
620
621VBoxC_INTERMEDIATES = \
622 $(VBOX_MAIN_PREREQS) \
623 $(VBOX_XML_SCHEMADEFS_H) \
624 $(VBOX_AUTOGEN_EVENT_H)
625
626VBoxC_SOURCES = \
627 src-all/DisplayPNGUtil.cpp \
628 src-all/DisplayResampleImage.cpp \
629 src-all/DisplayUtils.cpp \
630 src-all/EventImpl.cpp \
631 src-all/Global.cpp \
632 src-all/Logging.cpp \
633 src-all/PciDeviceAttachmentImpl.cpp \
634 src-all/ProgressImpl.cpp \
635 src-all/SharedFolderImpl.cpp \
636 src-all/VirtualBoxBase.cpp \
637 src-all/VirtualBoxErrorInfoImpl.cpp \
638 $(if $(VBOX_WITH_EXTPACK),src-all/ExtPackManagerImpl.cpp src-all/ExtPackUtil.cpp,) \
639 src-client/AdditionsFacilityImpl.cpp \
640 src-client/AudioSnifferInterface.cpp \
641 src-client/BusAssignmentManager.cpp \
642 $(if $(VBOX_WITH_PCI_PASSTHROUGH),src-client/PciRawDevImpl.cpp,) \
643 src-client/ConsoleImpl.cpp \
644 src-client/ConsoleImpl2.cpp \
645 src-client/ConsoleImplTeleporter.cpp \
646 src-client/ConsoleVRDPServer.cpp \
647 src-client/DisplayImpl.cpp \
648 src-client/GuestCtrlImpl.cpp \
649 src-client/GuestImpl.cpp \
650 src-client/KeyboardImpl.cpp \
651 src-client/MachineDebuggerImpl.cpp \
652 src-client/MouseImpl.cpp \
653 src-client/RemoteUSBDeviceImpl.cpp \
654 src-client/SessionImpl.cpp \
655 src-client/USBDeviceImpl.cpp \
656 src-client/VBoxDriversRegister.cpp \
657 src-client/VirtualBoxClientImpl.cpp \
658 src-client/VMMDevInterface.cpp \
659 $(VBOX_AUTOGEN_EVENT_CPP) \
660 $(VBOX_XML_SCHEMADEFS_CPP)
661VBoxC_SOURCES.win = \
662 src-client/win/dllmain.cpp \
663 src-client/win/VBoxC.def \
664 src-client/win/VBoxC.rc
665
666
667ifdef VBOX_WITH_XPCOM
668VBoxC_SOURCES += \
669 src-client/xpcom/module.cpp
670endif
671
672ifdef VBOX_WITH_HGCM
673VBoxC_SOURCES += \
674 src-client/HGCMObjects.cpp \
675 src-client/HGCMThread.cpp \
676 src-client/HGCM.cpp
677endif
678
679ifdef VBOX_WITH_CRHGSMI
680VBoxC_DEFS += VBOX_WITH_CRHGSMI
681endif
682
683ifdef VBOX_WITH_USB
684VBoxC_SOURCES += \
685 src-client/RemoteUSBBackend.cpp
686endif
687
688ifeq ($(KBUILD_TARGET),darwin)
689VBoxC_ORDERDEPS += $(VBoxC_0_OUTDIR)/VBoxC.def
690VBoxC_CLEAN += $(VBoxC_0_OUTDIR)/VBoxC.def
691$$(VBoxC_0_OUTDIR)/VBoxC.def: $(MAKEFILE_CURRENT)
692 $(RM) -f $@
693 $(APPEND) $@ _NSGetModule
694 $(APPEND) $@ _VBoxDriversRegister
695endif
696
697src-client/ConsoleImpl.cpp_DEFS = \
698 VBOX_BUILD_TARGET=\"$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)\" \
699 $(if $(VBOX_BLEEDING_EDGE),VBOX_BLEEDING_EDGE=\"$(VBOX_BLEEDING_EDGE)\",)
700
701
702src-client/win/VBoxC.rc_DEPS = $(VBoxC_0_OUTDIR)/VBoxC.rgs $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb
703VBoxC_CLEAN.win += $(VBoxC_0_OUTDIR)/VBoxC.rgs
704
705$$(VBoxC_0_OUTDIR)/VBoxC.rgs: $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
706 $(VBOX_XSLTPROC) --stringparam Module VBoxC -o $@ $< $(VBOX_XIDL_FILE)
707
708
709#
710# VBoxCOM - COM Abstraction Layer library
711#
712LIBRARIES += VBoxCOM
713VBoxCOM_TEMPLATE = VBOXMAINLIB
714VBoxCOM_INTERMEDIATES = $(VBOX_MAIN_PREREQS)
715VBoxCOM_SOURCES = \
716 glue/com.cpp \
717 glue/initterm.cpp \
718 glue/string.cpp \
719 glue/AutoLock.cpp \
720 glue/EventQueue.cpp \
721 glue/ErrorInfo.cpp \
722 glue/errorprint.cpp \
723 glue/VirtualBoxErrorInfo.cpp
724VBoxCOM_INCS += \
725 include
726ifeq ($(KBUILD_TARGET),win)
727 VBoxCOM_DEFS.x86 += _WIN32_WINNT=0x0500
728 VBoxCOM_DEFS.amd64 += _WIN32_WINNT=0x0510
729 VBoxCOM_SOURCES += \
730 $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c
731else # !win
732 VBoxCOM_SOURCES += \
733 glue/xpcom/helpers.cpp
734endif # !win
735
736
737#
738# The VBoxExtPackHelperApp.
739#
740ifdef VBOX_WITH_EXTPACK
741 PROGRAMS += VBoxExtPackHelperApp
742 VBoxExtPackHelperApp_TEMPLATE = VBoxR3SetUidToRoot
743 VBoxExtPackHelperApp_LDFLAGS.darwin = -framework Security
744 VBoxExtPackHelperApp_LDFLAGS.win = /SUBSYSTEM:windows
745 VBoxExtPackHelperApp_SOURCES = \
746 src-helper-apps/VBoxExtPackHelperApp.cpp \
747 src-all/ExtPackUtil.cpp
748 VBoxExtPackHelperApp_LIBS = \
749 $(LIB_RUNTIME)
750endif # VBOX_WITH_EXTPACK
751
752
753endif # !VBOX_ONLY_SDK (the ifndef is far above)
754
755
756#
757# Installs com related thing(s) to bin.
758#
759INSTALLS.win += VBoxMain-com-inst
760VBoxMain-com-inst_INST = $(INST_BIN)
761VBoxMain-com-inst_SOURCES = src-all/win/comregister.cmd
762
763
764if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "linux"
765 #
766 # Installs linux/hardening related things to components.
767 #
768 INSTALLS.linux += VBoxMain-hardening-inst
769 VBoxMain-hardening-inst_INST = $(INST_BIN)components/
770 VBoxMain-hardening-inst_SYMLINKS = \
771 VBoxDDU.so=>../VBoxDDU.so \
772 VBoxREM.so=>../VBoxREM.so \
773 VBoxRT.so=>../VBoxRT.so \
774 VBoxVMM.so=>../VBoxVMM.so \
775 VBoxXPCOM.so=>../VBoxXPCOM.so
776endif
777
778
779# generate rules
780include $(KBUILD_PATH)/subfooter.kmk
781
782
783
784#
785# Additions rules.
786#
787
788## @todo this hack ain't cutting it any longer. (the file name is abspath'ed since ages now.)
789glue/xpcom/helpers.cpp: $(VBOX_IDL_TYPELIB.XPCOM)
790
791$(VBOX_IDL_FILE.XPCOM): $(VBOX_PATH_MAIN_SRC)/idl/xpidl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
792 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
793 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
794
795$(VBOX_IDL_TYPELIB.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
796 $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
797 $(QUIET)$(VBOX_XPIDL_ENV)$(VBOX_XPIDL) -m typelib -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
798 $(CHMOD) 0644 $@
799## @todo ^^^^^^^^^^^^ fix horrible hack
800
801$(VBOX_IDL_HEADER.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
802 $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
803 $(QUIET)$(VBOX_XPIDL_ENV)$(VBOX_XPIDL) -m header -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
804
805
806VBOX_MAIN_IDL ?= $(EXEC_X86_WIN32) $(call VBOX_FN_MAKE_WIN_PATH,$(firstword $(wildcard \
807 $(PATH_SDK_WINPSDK_BIN)/Midl.Exe\
808 $(PATH_SDK_WINPSDK)/Bin/Midl.Exe\
809 $(PATH_DEVTOOLS)/win.x86/bin/midl.exe\
810 ) Sorry_Cannot_Find_The_Midl_Compiler_In_The_PSDK))
811IDL_DEFS = /nologo
812
813$(VBOX_IDL_FILE.MSCOM): $(VBOX_PATH_MAIN_SRC)/idl/midl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
814 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
815 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
816
817# Aliases for testing purposes.
818ifdef VBOX_WITH_XPCOM
819testidl: $(VBOX_IDL_FILE.XPCOM) $(VBOX_IDL_TYPELIB.XPCOM)
820testidlhdr: $(VBOX_IDL_HEADER.XPCOM)
821else
822testidl: $(VBOX_IDL_FILE.MSCOM) $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c
823endif
824
825
826## @todo r=bird: last changes to this rule showed incorrect dependencies here as it broke testcase (see testboxwin2).
827# This is kind of obvious when looking at the rule, because it's (a) not specifying all it output
828# and (b) generating more stuff *after* the main target has been completed.
829#
830# What needs to be done is to not depend on _i.c in the object subdir, but on all the final outputs.
831$(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
832+ $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox_i.c \
833+ $(VBoxCOM_0_OUTDIR)/VirtualBox.h \
834+ $(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h \
835+ $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb \
836+ $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox.tlb: $(VBOX_IDL_FILE.MSCOM) | $$(dir $$@)
837 $(VBOX_MAIN_IDL) $(IDL_DEFS) \
838 /out $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxCOM_0_OUTDIR)) \
839 /cpp_cmd $(subst $(EXEC_X86_WIN32),,$(call VBOX_FN_MAKE_WIN_PATH,$(TOOL_$(VBOX_VCC_TOOL)_CC))) \
840 /I $(call VBOX_FN_MAKE_WIN_PATH,$(PATH_SDK_WINPSDK_INC)) \
841 /I idl \
842 $(call VBOX_FN_MAKE_WIN_PATH,$<)
843 $(MKDIR) -p $(VBOX_PATH_SDK)/bindings/mscom/include
844 $(CP) $(VBoxCOM_0_OUTDIR)/VirtualBox.h $(VBOX_PATH_SDK)/bindings/mscom/include
845 $(MKDIR) -p $(VBOX_PATH_SDK)/bindings/mscom/lib
846 $(CP) $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb $(VBOX_PATH_SDK)/bindings/mscom/lib
847 $(CP) $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c $(VBOX_PATH_SDK)/bindings/mscom/lib
848
849#
850# Translation stuff
851#
852VBoxSVC_VBOX_HEADERS = \
853 include/collection.h \
854 include/MachineImpl.h
855VBoxSVC_VBOX_TRANSLATIONS = \
856 nls/VBoxSVC_de.ts
857
858VBoxC_VBOX_HEADERS = \
859 include/ConsoleImpl.h
860VBoxC_VBOX_TRANSLATIONS = \
861 nls/VBoxC_de.ts
862
863ifdef VBOX_WITH_JMSCOM
864INSTALLS += VBoxJMscom-inst-jar
865
866#
867# Java glue JAR files
868#
869VBOX_JMSCOM_JAR = $(VBoxJMscom-inst-jar_0_OUTDIR)/vboxjmscom.jar
870VBOX_JMSCOM_TARGET := $(PATH_TARGET)/vboxjmscom-gen
871VBOX_JMSCOM_GEN = $(VBOX_JMSCOM_TARGET)/jmscomgen
872VBOX_JMSCOM_JDEST := $(VBOX_JMSCOM_TARGET)/jdest
873VBOX_GLUE_XSLT_DIR := $(PATH_ROOT)/src/VBox/Main/glue
874VBOX_JACOB_DIR := $(PATH_ROOT)/src/libs/jacob-1.15-M3
875
876VBoxJMscom-inst-jar_INST = $(INST_SDK)bindings/mscom/java/
877VBoxJMscom-inst-jar_SOURCES = \
878 $(VBOX_JMSCOM_JAR)
879VBoxJMscom-inst-jar_CLEAN = \
880 $(VBOX_JMSCOM_JAR) \
881 $(VBOX_JMSCOM_GEN)/jmscomglue.list \
882 $(wildcard \
883 $(VBOX_JMSCOM_GEN)/java/*.java \
884 $(VBOX_JMSCOM_JDEST)/*.class \
885 $(VBOX_JMSCOM_JDEST)/*/*.class \
886 $(VBOX_JMSCOM_JDEST)/*/*/*.class \
887 $(VBOX_JMSCOM_JDEST)/*/*/*/*.class \
888 )
889VBoxJMscom-inst-jar_BLDDIRS += $(VBOX_JMSCOM_GEN)/java
890
891$(VBOX_JMSCOM_GEN)/jmscomglue.list: \
892 $(VBOX_XIDL_FILE) \
893 $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl \
894 $(VBOX_FILESPLIT) \
895 | $(VBOX_JMSCOM_GEN)/java/
896 $(call MSG_L1,Generating Java MSCOM glue files from XIDL)
897 $(QUIET)$(RM) -f $(wildcard $(VBOX_JMSCOM_GEN)/java/*.java)
898 $(QUIET)$(VBOX_XSLTPROC) \
899 --stringparam G_vboxApiSuffix $(VBOX_API_SUFFIX) \
900 --stringparam G_vboxGlueStyle mscom \
901 -o $(VBOX_JMSCOM_GEN)/java/merged.file $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl $<
902 $(QUIET)$(VBOX_FILESPLIT) $(VBOX_JMSCOM_GEN)/java/merged.file $(VBOX_JMSCOM_GEN)/java
903 $(QUIET)echo $(VBOX_JMSCOM_GEN)/java/*.java > $@
904
905$$(VBOX_JMSCOM_JAR): $(VBOX_JMSCOM_GEN)/jmscomglue.list | $$(dir $$@)
906 $(call MSG_TOOL,javac,$(notdir $@),jmscomgen.list,)
907 $(QUIET)$(RM) -Rf $(VBOX_JMSCOM_JDEST)
908 $(QUIET)$(MKDIR) -p $(VBOX_JMSCOM_JDEST)
909 $(call MSG_TOOL,javac,$(notdir $@),...,)
910 $(VBOX_JAVAC) $(VBOX_JAVAC_OPTS) \
911 @$(VBOX_JMSCOM_GEN)/jmscomglue.list \
912 -d $(VBOX_JMSCOM_JDEST) -classpath $(VBOX_JMSCOM_JDEST)$(VBOX_SEP)$(VBOX_JACOB_DIR)/jacob.jar
913 $(call MSG_LINK,$(notdir $@),$@)
914 $(VBOX_JAR) cf $@ -C $(VBOX_JMSCOM_JDEST) .
915
916endif # VBOX_WITH_JMSCOM
917
918#
919# Install Java glue sample code.
920#
921INSTALLS += javagluesample
922javagluesample_INST = $(INST_SDK)bindings/glue/java
923javagluesample_MODE = a+rx,u+w
924javagluesample_SOURCES = \
925 $(VBOX_PATH_MAIN_SRC)/glue/tests/TestVBox.java=>TestVBox.java \
926 $(VBOX_PATH_MAIN_SRC)/glue/tests/Makefile.kmk=>Makefile.kmk
927
928updatenls::
929 $(VBOX_LUPDATE) $(VBoxSVC_SOURCES) $(VBoxSVC_VBOX_HEADERS) -ts $(VBoxSVC_VBOX_TRANSLATIONS)
930 $(VBOX_LUPDATE) $(VBoxC_SOURCES) $(VBoxC_VBOX_HEADERS) -ts $(VBoxC_VBOX_TRANSLATIONS)
931
932testconverter:: $(VBOX_USER_HOME)/VirtualBox.xml
933 $(call MSG_TOOL,xsltproc,Test Settings Converter,$<,$(VBOX_USER_HOME)/VirtualBox.xml.test)
934 $(QUIET)$(VBOX_XSLTPROC) -o $(VBOX_USER_HOME)/VirtualBox.xml.test xml/SettingsConverter.xsl $<
935
936testconverter2:: $(VBOX_USER_HOME)/Machines/dos/dos.xml
937 $(call MSG_TOOL,xsltproc,Test Settings Converter,$<,$<.test)
938 $(QUIET)$(VBOX_XSLTPROC) -o $<.test xml/SettingsConverter.xsl $<
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