VirtualBox

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

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

GuestCtrl: Update.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 33.1 KB
Line 
1# $Id: Makefile.kmk 38235 2011-07-29 10:07:03Z 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
680endif
681
682ifdef VBOX_WITH_XPCOM
683VBoxC_SOURCES += \
684 src-client/xpcom/module.cpp
685endif
686
687ifdef VBOX_WITH_HGCM
688VBoxC_SOURCES += \
689 src-client/HGCMObjects.cpp \
690 src-client/HGCMThread.cpp \
691 src-client/HGCM.cpp
692endif
693
694ifdef VBOX_WITH_CRHGSMI
695VBoxC_DEFS += VBOX_WITH_CRHGSMI
696endif
697
698ifdef VBOX_WITH_USB
699VBoxC_SOURCES += \
700 src-client/RemoteUSBBackend.cpp
701endif
702
703ifeq ($(KBUILD_TARGET),darwin)
704VBoxC_ORDERDEPS += $(VBoxC_0_OUTDIR)/VBoxC.def
705VBoxC_CLEAN += $(VBoxC_0_OUTDIR)/VBoxC.def
706$$(VBoxC_0_OUTDIR)/VBoxC.def: $(MAKEFILE_CURRENT)
707 $(RM) -f $@
708 $(APPEND) $@ _NSGetModule
709 $(APPEND) $@ _VBoxDriversRegister
710endif
711
712src-client/ConsoleImpl.cpp_DEFS = \
713 VBOX_BUILD_TARGET=\"$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)\" \
714 $(if $(VBOX_BLEEDING_EDGE),VBOX_BLEEDING_EDGE=\"$(VBOX_BLEEDING_EDGE)\",)
715
716
717src-client/win/VBoxC.rc_DEPS = $(VBoxC_0_OUTDIR)/VBoxC.rgs $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb
718VBoxC_CLEAN.win += $(VBoxC_0_OUTDIR)/VBoxC.rgs
719
720$$(VBoxC_0_OUTDIR)/VBoxC.rgs: $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
721 $(VBOX_XSLTPROC) --stringparam Module VBoxC -o $@ $< $(VBOX_XIDL_FILE)
722
723
724#
725# VBoxCOM - COM Abstraction Layer library
726#
727LIBRARIES += VBoxCOM
728VBoxCOM_TEMPLATE = VBOXMAINLIB
729VBoxCOM_INTERMEDIATES = $(VBOX_MAIN_PREREQS)
730VBoxCOM_SOURCES = \
731 glue/com.cpp \
732 glue/initterm.cpp \
733 glue/string.cpp \
734 glue/AutoLock.cpp \
735 glue/EventQueue.cpp \
736 glue/ErrorInfo.cpp \
737 glue/errorprint.cpp \
738 glue/VirtualBoxErrorInfo.cpp
739VBoxCOM_INCS += \
740 include
741ifeq ($(KBUILD_TARGET),win)
742 VBoxCOM_DEFS.x86 += _WIN32_WINNT=0x0500
743 VBoxCOM_DEFS.amd64 += _WIN32_WINNT=0x0510
744 VBoxCOM_SOURCES += \
745 $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c
746else # !win
747 VBoxCOM_SOURCES += \
748 glue/xpcom/helpers.cpp
749endif # !win
750
751
752#
753# The VBoxExtPackHelperApp.
754#
755ifdef VBOX_WITH_EXTPACK
756 PROGRAMS += VBoxExtPackHelperApp
757 VBoxExtPackHelperApp_TEMPLATE = VBoxR3SetUidToRoot
758 VBoxExtPackHelperApp_LDFLAGS.darwin = -framework Security
759 VBoxExtPackHelperApp_LDFLAGS.win = /SUBSYSTEM:windows
760 VBoxExtPackHelperApp_SOURCES = \
761 src-helper-apps/VBoxExtPackHelperApp.cpp \
762 src-all/ExtPackUtil.cpp
763 VBoxExtPackHelperApp_LIBS = \
764 $(LIB_RUNTIME)
765endif # VBOX_WITH_EXTPACK
766
767
768endif # !VBOX_ONLY_SDK (the ifndef is far above)
769
770
771#
772# Installs com related thing(s) to bin.
773#
774INSTALLS.win += VBoxMain-com-inst
775VBoxMain-com-inst_INST = $(INST_BIN)
776VBoxMain-com-inst_MODE = a+r,u+w
777VBoxMain-com-inst_SOURCES = src-all/win/comregister.cmd
778
779
780if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "linux"
781 #
782 # Installs linux/hardening related things to components.
783 #
784 INSTALLS.linux += VBoxMain-hardening-inst
785 VBoxMain-hardening-inst_INST = $(INST_BIN)components/
786 VBoxMain-hardening-inst_SYMLINKS = \
787 VBoxDDU.so=>../VBoxDDU.so \
788 VBoxREM.so=>../VBoxREM.so \
789 VBoxRT.so=>../VBoxRT.so \
790 VBoxVMM.so=>../VBoxVMM.so \
791 VBoxXPCOM.so=>../VBoxXPCOM.so
792endif
793
794
795# generate rules
796include $(KBUILD_PATH)/subfooter.kmk
797
798
799
800#
801# Additions rules.
802#
803
804## @todo this hack ain't cutting it any longer. (the file name is abspath'ed since ages now.)
805glue/xpcom/helpers.cpp: $(VBOX_IDL_TYPELIB.XPCOM)
806
807$(VBOX_IDL_FILE.XPCOM): $(VBOX_PATH_MAIN_SRC)/idl/xpidl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
808 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
809 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
810
811$(VBOX_IDL_TYPELIB.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
812 $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
813 $(QUIET)$(VBOX_XPIDL_ENV)$(VBOX_XPIDL) -m typelib -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
814 $(CHMOD) 0644 $@
815## @todo ^^^^^^^^^^^^ fix horrible hack
816
817$(VBOX_IDL_HEADER.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
818 $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
819 $(QUIET)$(VBOX_XPIDL_ENV)$(VBOX_XPIDL) -m header -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
820
821
822VBOX_MAIN_IDL ?= $(EXEC_X86_WIN32) $(call VBOX_FN_MAKE_WIN_PATH,$(firstword $(wildcard \
823 $(PATH_SDK_WINPSDK_BIN)/Midl.Exe\
824 $(PATH_SDK_WINPSDK)/Bin/Midl.Exe\
825 $(PATH_DEVTOOLS)/win.x86/bin/midl.exe\
826 ) Sorry_Cannot_Find_The_Midl_Compiler_In_The_PSDK))
827IDL_DEFS = /nologo
828
829$(VBOX_IDL_FILE.MSCOM): $(VBOX_PATH_MAIN_SRC)/idl/midl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
830 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
831 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
832
833# Aliases for testing purposes.
834ifdef VBOX_WITH_XPCOM
835testidl: $(VBOX_IDL_FILE.XPCOM) $(VBOX_IDL_TYPELIB.XPCOM)
836testidlhdr: $(VBOX_IDL_HEADER.XPCOM)
837else
838testidl: $(VBOX_IDL_FILE.MSCOM) $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c
839endif
840
841
842## @todo r=bird: last changes to this rule showed incorrect dependencies here as it broke testcase (see testboxwin2).
843# This is kind of obvious when looking at the rule, because it's (a) not specifying all it output
844# and (b) generating more stuff *after* the main target has been completed.
845#
846# What needs to be done is to not depend on _i.c in the object subdir, but on all the final outputs.
847$(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
848+ $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox_i.c \
849+ $(VBoxCOM_0_OUTDIR)/VirtualBox.h \
850+ $(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h \
851+ $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb \
852+ $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox.tlb: $(VBOX_IDL_FILE.MSCOM) | $$(dir $$@)
853 $(VBOX_MAIN_IDL) $(IDL_DEFS) \
854 /out $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxCOM_0_OUTDIR)) \
855 /cpp_cmd $(subst $(EXEC_X86_WIN32),,$(call VBOX_FN_MAKE_WIN_PATH,$(TOOL_$(VBOX_VCC_TOOL)_CC))) \
856 /I $(call VBOX_FN_MAKE_WIN_PATH,$(PATH_SDK_WINPSDK_INC)) \
857 /I idl \
858 $(call VBOX_FN_MAKE_WIN_PATH,$<)
859 $(MKDIR) -p $(VBOX_PATH_SDK)/bindings/mscom/include
860 $(CP) $(VBoxCOM_0_OUTDIR)/VirtualBox.h $(VBOX_PATH_SDK)/bindings/mscom/include
861 $(MKDIR) -p $(VBOX_PATH_SDK)/bindings/mscom/lib
862 $(CP) $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb $(VBOX_PATH_SDK)/bindings/mscom/lib
863 $(CP) $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c $(VBOX_PATH_SDK)/bindings/mscom/lib
864
865#
866# Translation stuff
867#
868VBoxSVC_VBOX_HEADERS = \
869 include/collection.h \
870 include/MachineImpl.h
871VBoxSVC_VBOX_TRANSLATIONS = \
872 nls/VBoxSVC_de.ts
873
874VBoxC_VBOX_HEADERS = \
875 include/ConsoleImpl.h
876VBoxC_VBOX_TRANSLATIONS = \
877 nls/VBoxC_de.ts
878
879ifdef VBOX_WITH_JMSCOM
880
881#
882# Java glue JAR files
883#
884VBOX_JMSCOM_JAR = $(VBoxJMscom-inst-jar_0_OUTDIR)/vboxjmscom.jar
885VBOX_JMSCOM_TARGET := $(PATH_TARGET)/vboxjmscom-gen
886VBOX_JMSCOM_GEN = $(VBOX_JMSCOM_TARGET)/jmscomgen
887VBOX_JMSCOM_JDEST := $(VBOX_JMSCOM_TARGET)/jdest
888VBOX_GLUE_XSLT_DIR := $(PATH_ROOT)/src/VBox/Main/glue
889VBOX_JACOB_DIR := $(PATH_ROOT)/src/libs/jacob-1.15-M3
890
891INSTALLS += VBoxJMscom-inst-jar
892VBoxJMscom-inst-jar_INST = $(INST_SDK)bindings/mscom/java/
893VBoxJMscom-inst-jar_MODE = a+r,u+w
894VBoxJMscom-inst-jar_SOURCES = \
895 $(VBOX_JMSCOM_JAR)
896VBoxJMscom-inst-jar_CLEAN = \
897 $(VBOX_JMSCOM_JAR) \
898 $(VBOX_JMSCOM_GEN)/jmscomglue.list \
899 $(wildcard \
900 $(VBOX_JMSCOM_GEN)/java/*.java \
901 $(VBOX_JMSCOM_JDEST)/*.class \
902 $(VBOX_JMSCOM_JDEST)/*/*.class \
903 $(VBOX_JMSCOM_JDEST)/*/*/*.class \
904 $(VBOX_JMSCOM_JDEST)/*/*/*/*.class \
905 )
906VBoxJMscom-inst-jar_BLDDIRS += $(VBOX_JMSCOM_GEN)/java
907
908$(VBOX_JMSCOM_GEN)/jmscomglue.list: \
909 $(VBOX_XIDL_FILE) \
910 $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl \
911 $(VBOX_FILESPLIT) \
912 | $(VBOX_JMSCOM_GEN)/java/
913 $(call MSG_L1,Generating Java MSCOM glue files from XIDL)
914 $(QUIET)$(RM) -f $(wildcard $(VBOX_JMSCOM_GEN)/java/*.java)
915 $(QUIET)$(VBOX_XSLTPROC) \
916 --stringparam G_vboxApiSuffix $(VBOX_API_SUFFIX) \
917 --stringparam G_vboxGlueStyle mscom \
918 -o $(VBOX_JMSCOM_GEN)/java/merged.file $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl $<
919 $(QUIET)$(VBOX_FILESPLIT) $(VBOX_JMSCOM_GEN)/java/merged.file $(VBOX_JMSCOM_GEN)/java
920 $(QUIET)echo $(VBOX_JMSCOM_GEN)/java/*.java > $@
921
922$$(VBOX_JMSCOM_JAR): $(VBOX_JMSCOM_GEN)/jmscomglue.list | $$(dir $$@)
923 $(call MSG_TOOL,javac,$(notdir $@),jmscomgen.list,)
924 $(QUIET)$(RM) -Rf $(VBOX_JMSCOM_JDEST)
925 $(QUIET)$(MKDIR) -p $(VBOX_JMSCOM_JDEST)
926 $(call MSG_TOOL,javac,$(notdir $@),...,)
927 $(VBOX_JAVAC) $(VBOX_JAVAC_OPTS) \
928 @$(VBOX_JMSCOM_GEN)/jmscomglue.list \
929 -d $(VBOX_JMSCOM_JDEST) -classpath $(VBOX_JMSCOM_JDEST)$(VBOX_SEP)$(VBOX_JACOB_DIR)/jacob.jar
930 $(call MSG_LINK,$(notdir $@),$@)
931 $(VBOX_JAR) cf $@ -C $(VBOX_JMSCOM_JDEST) .
932
933endif # VBOX_WITH_JMSCOM
934
935#
936# Install Java glue sample code.
937#
938INSTALLS += javagluesample
939javagluesample_INST = $(INST_SDK)bindings/glue/java/
940javagluesample_MODE = a+r,u+w
941javagluesample_SOURCES = \
942 $(VBOX_PATH_MAIN_SRC)/glue/tests/TestVBox.java=>TestVBox.java \
943 $(VBOX_PATH_MAIN_SRC)/glue/tests/Makefile.kmk=>Makefile.kmk
944
945updatenls::
946 $(VBOX_LUPDATE) $(VBoxSVC_SOURCES) $(VBoxSVC_VBOX_HEADERS) -ts $(VBoxSVC_VBOX_TRANSLATIONS)
947 $(VBOX_LUPDATE) $(VBoxC_SOURCES) $(VBoxC_VBOX_HEADERS) -ts $(VBoxC_VBOX_TRANSLATIONS)
948
949testconverter:: $(VBOX_USER_HOME)/VirtualBox.xml
950 $(call MSG_TOOL,xsltproc,Test Settings Converter,$<,$(VBOX_USER_HOME)/VirtualBox.xml.test)
951 $(QUIET)$(VBOX_XSLTPROC) -o $(VBOX_USER_HOME)/VirtualBox.xml.test xml/SettingsConverter.xsl $<
952
953testconverter2:: $(VBOX_USER_HOME)/Machines/dos/dos.xml
954 $(call MSG_TOOL,xsltproc,Test Settings Converter,$<,$<.test)
955 $(QUIET)$(VBOX_XSLTPROC) -o $<.test xml/SettingsConverter.xsl $<
956
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