VirtualBox

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

Last change on this file since 38796 was 38796, checked in by vboxsync, 13 years ago

Main/glue: Add javadoc comments to the java glue code, use them to generate a documentation jar file. Add an OSGi compliant manifest file to the webservice jar.

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