VirtualBox

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

Last change on this file since 19844 was 19844, checked in by vboxsync, 16 years ago

HGSMI: post host VBVA commands to display; Video HW Accel: mechanism for passing/processing commands to framebuffer

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 25.5 KB
Line 
1# $Id: Makefile.kmk 19844 2009-05-19 23:12:55Z vboxsync $
2## @file
3# Makefile for the VBox Main module.
4#
5
6#
7# Copyright (C) 2006-2007 Sun Microsystems, Inc.
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# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
18# Clara, CA 95054 USA or visit http://www.sun.com if you need
19# additional information or have any questions.
20#
21
22SUB_DEPTH = ../../..
23include $(KBUILD_PATH)/subheader.kmk
24
25#
26# Include sub-makefile(s).
27#
28ifdef VBOX_WITH_WEBSERVICES
29 include $(PATH_SUB_CURRENT)/webservice/Makefile.kmk
30endif
31include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
32include $(PATH_SUB_CURRENT)/cbinding/Makefile.kmk
33
34
35#
36# Targets and globals (bit of a mess...)
37#
38VBOX_PATH_MAIN_SRC := $(PATH_SUB_CURRENT)
39
40ifdef VBOX_ONLY_SDK
41 # used by some rules
42 PATH_VBoxCOM = $(PATH_TARGET)/VBoxCOM
43 BLDDIRS += $(PATH_VBoxCOM) $(PATH_BIN)/components
44 # I'm Evil! Dr. Evil.
45 include $(KBUILD_PATH)/tools/VCC70.kmk
46 include $(KBUILD_PATH)/sdks/WINPSDK.kmk
47endif #!VBOX_ONLY_SDK
48
49
50# Construct VBOX_MAIN_DEFS
51## @todo eliminate or expand VBOX_MAIN_DEFS.
52VBOX_MAIN_DEFS =
53ifneq ($(KBUILD_TARGET),win)
54 ifndef VBOX_WITH_XPCOM
55 $(error "VBox: VBOX_WITH_XPCOM isn't defined")
56 endif
57 ifneq ($(KBUILD_TARGET),os2)
58 VBOX_MAIN_DEFS+= VBOX_WITH_SYS_V_IPC_SESSION_WATCHER
59 endif
60endif
61VBOX_MAIN_DEFS += \
62 $(if $(VBOX_WITH_NETFLT),VBOX_WITH_NETFLT,) \
63 $(if $(VBOX_WITH_CROGL),VBOX_WITH_CROGL,) \
64 $(if $(VBOX_WITH_GUEST_PROPS),VBOX_WITH_GUEST_PROPS,) \
65 $(if $(VBOX_WITH_HOSTNETIF_API),VBOX_WITH_HOSTNETIF_API,)
66
67if1of ($(KBUILD_TARGET), linux freebsd solaris)
68 VBOX_MAIN_DEFS += VBOX_MAIN_USE_SEMRW
69#else
70# if1of ($(VBOX_VERSION_BUILD),1 3 5 7 9)
71# VBOX_MAIN_DEFS += VBOX_MAIN_AUTOLOCK_TRAP
72# endif
73endif
74
75# Unconditionally enable the new semaphore key generation code
76VBOX_MAIN_DEFS += VBOX_WITH_NEW_SYS_V_KEYGEN
77
78VBOX_IDL_FILE.MSCOM = $(VBOX_PATH_SDK)/bindings/mscom/idl/VirtualBox.idl
79VBOX_IDL_FILE.XPCOM = $(VBOX_PATH_SDK)/bindings/xpcom/idl/VirtualBox_XPCOM.idl
80
81VBOX_IDL_TYPELIB.XPCOM = $(PATH_BIN)/components/VirtualBox_XPCOM.xpt
82VBOX_IDL_HEADER.XPCOM = $(VBOX_PATH_SDK)/bindings/xpcom/include/VirtualBox_XPCOM.h
83
84# The MS COM specific stuff.
85if defined(VBOX_ONLY_SDK) || "$(KBUILD_TARGET)" == "win"
86 OTHERS += \
87 $(VBOX_IDL_FILE.MSCOM) \
88 $(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h \
89 $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox.tlb \
90 $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox_i.c \
91 $(VBOX_PATH_SDK)/bindings/mscom/python/samples/vboxshell.py \
92 $(VBOX_PATH_SDK)/bindings/mscom/python/samples/shellcommon.py
93 OTHER_CLEAN += \
94 $(VBOX_IDL_FILE.MSCOM) \
95 $(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h \
96 $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox.tlb \
97 $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox_i.c \
98 $(PATH_VBoxCOM)/VirtualBox.h \
99 $(PATH_VBoxCOM)/VirtualBox_i.c \
100 $(PATH_VBoxCOM)/VirtualBox.tlb \
101 $(VBOX_PATH_SDK)/bindings/mscom/python/samples/vboxshell.py \
102 $(VBOX_PATH_SDK)/bindings/mscom/python/samples/shellcommon.py
103
104 VBOX_MAIN_PREREQS += $(PATH_VBoxCOM)/VirtualBox_i.c
105 BLDDIRS += $(VBOX_PATH_SDK)/bindings/mscom/idl
106endif
107
108# The XPCOM specific stuff.
109if defined(VBOX_ONLY_SDK) || "$(KBUILD_TARGET)" != "win"
110 OTHERS += $(VBOX_IDL_FILE.XPCOM) $(VBOX_IDL_TYPELIB.XPCOM) $(VBOX_IDL_HEADER.XPCOM)
111 OTHER_CLEAN += \
112 $(VBOX_IDL_FILE.XPCOM) \
113 $(VBOX_IDL_HEADER.XPCOM) \
114 $(VBOX_IDL_TYPELIB.XPCOM)
115
116 VBOX_MAIN_PREREQS += $(VBOX_IDL_TYPELIB.XPCOM) $(VBOX_IDL_HEADER.XPCOM)
117 BLDDIRS += \
118 $(VBOX_PATH_SDK)/bindings/xpcom/idl \
119 $(VBOX_PATH_SDK)/bindings/xpcom/include
120endif # xpcom
121
122
123#
124# Strip documentation from source XIDL so that we don't get a full
125# recompile every time a comma in the documentation is changed.
126#
127$(VBOX_XIDL_FILE).ts |+ $(VBOX_XIDL_FILE): \
128 $(VBOX_XIDL_FILE_SRC) \
129 $(VBOX_PATH_MAIN_SRC)/idl/docstrip.xsl \
130 | $$(dir $$@)
131# $(CP) -fv $< $(VBOX_XIDL_FILE).ts
132 $(VBOX_XSLTPROC) -o $(VBOX_XIDL_FILE).ts $(VBOX_PATH_MAIN_SRC)/idl/docstrip.xsl $<
133 $(CP) --changed -fv $(VBOX_XIDL_FILE).ts $(VBOX_XIDL_FILE)
134
135
136#
137# The Main API documentation
138#
139VBOX_MAIN_DOC_DIR = $(VBOX_PATH_SDK)/docs
140BLDDIRS += $(VBOX_MAIN_DOC_DIR)
141
142$(PATH_TARGET)/docs.Main: \
143 $(VBOX_PATH_MAIN_SRC)/Doxyfile.Main \
144 $(VBOX_PATH_MAIN_SRC)/idl/doxygen.xsl \
145 $(VBOX_XIDL_FILE_SRC) \
146 | $(PATH_TARGET)/ \
147 $(VBOX_MAIN_DOC_DIR)/
148 $(RM) -f $(wildcard $(VBOX_MAIN_DOC_DIR)/html/*) $(PATH_TARGET)/docs.Main
149 $(VBOX_XSLTPROC) -o $(PATH_TARGET)/VirtualBox.idl $(VBOX_PATH_MAIN_SRC)/idl/doxygen.xsl $(VBOX_XIDL_FILE_SRC)
150 $(REDIRECT) -E 'DOCDIR=$(VBOX_MAIN_DOC_DIR)' -E 'PATH_TARGET=$(PATH_TARGET)' -E 'PATH_CHM=$(subst /,\,$(VBOX_MAIN_DOC_DIR)/VirtualBoxAPI.chm)' \
151 -- doxygen $(VBOX_PATH_MAIN_SRC)/Doxyfile.Main
152 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) ">>>>>>>>>>>>>>>>>>>> Main.err: >>>>>>>>>>>>>>>>>>>>>>>>"
153 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(CAT) "$(PATH_TARGET)/Main.err"
154 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "<<<<<<<<<<<<<<<<<<<< Main.err <<<<<<<<<<<<<<<<<<<<<<<<<"
155 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "===> **************************************************"
156 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "===> Please fix above doxygen errors/warnings listed in"
157 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "===> $(PATH_TARGET)/Main.err"
158 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "===> **************************************************"
159 -$(EXEC_X86_WIN32) $(VBOX_PATH_HTML_HELP_WORKSHOP)/hhc.exe $(subst /,\\,$(VBOX_MAIN_DOC_DIR)/html/index.hhp)
160 $(APPEND) $(PATH_TARGET)/docs.Main
161# aliases
162docs.main docs.Main: $(PATH_TARGET)/docs.Main
163if !defined(VBOX_ONLY_DOCS)
164docs: $(PATH_TARGET)/docs.Main
165endif
166
167
168#
169# Some SDK bit.
170#
171INSTALLS += VBox-main-xidl
172VBox-main-xidl_INST = $(INST_SDK)bindings/
173VBox-main-xidl_SOURCES = $(VBOX_XIDL_FILE_SRC)
174
175
176ifndef VBOX_ONLY_SDK # Note this goes on for *very* long
177
178#
179# Generate SchemaDefs.h and SchemaDefs.cpp from XML Schema
180# These two files are used by both VBoxC and VBoxSVC.
181#
182BLDDIRS += $(PATH_TARGET)/Main
183VBOX_XML_SCHEMADEFS_H = $(PATH_TARGET)/Main/SchemaDefs.h
184VBOX_XML_SCHEMADEFS_CPP = $(PATH_TARGET)/Main/SchemaDefs.cpp
185VBOX_XML_SCHEMADEFS_XSL = $(VBOX_PATH_MAIN_SRC)/xml/SchemaDefs.xsl
186
187testschemadefs: $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP)
188
189
190#
191# VBoxSVC executable
192#
193PROGRAMS += VBoxSVC
194VBoxSVC_TEMPLATE = VBOXMAINEXE
195VBoxSVC_DEFS = \
196 VBOX_MAIN_SETTINGS_ADDONS \
197 $(VBOX_MAIN_DEFS) \
198 $(if $(VBOX_WITH_VBOXSDL),VBOX_WITH_VBOXSDL,) \
199 $(if $(VBOX_WITH_VRDP),VBOX_WITH_VRDP,) \
200 $(if $(VBOX_WITH_HEADLESS),VBOX_WITH_HEADLESS,) \
201 $(if $(VBOX_WITH_QTGUI),VBOX_WITH_QTGUI,) \
202 $(if $(VBOX_WITH_HGCM),VBOX_WITH_HGCM,) \
203 $(if $(VBOX_MAIN_RELEASE_LOG),VBOX_MAIN_RELEASE_LOG LOG_ENABLED,) \
204 $(if $(VBOX_WITH_ALSA),VBOX_WITH_ALSA,) \
205 $(if $(VBOX_WITH_PULSE),VBOX_WITH_PULSE,) \
206 $(if $(VBOX_WITH_WINMM),VBOX_WITH_WINMM,) \
207 $(if $(VBOX_WITH_E1000),VBOX_WITH_E1000,) \
208 $(if $(VBOX_WITH_AHCI),VBOX_WITH_AHCI,) \
209 $(if $(VBOX_WITH_LINUX_COMPILER_H),VBOX_WITH_LINUX_COMPILER_H,) \
210 $(if $(VBOX_WITH_RESOURCE_USAGE_API),VBOX_WITH_RESOURCE_USAGE_API,) \
211 $(if $(VBOX_WITH_PDM_ASYNC_COMPLETION),VBOX_WITH_PDM_ASYNC_COMPLETION,) \
212 $(if $(VBOX_WITH_DBUS),VBOX_WITH_DBUS,) \
213 $(if $(VBOX_USB_WITH_SYSFS),VBOX_USB_WITH_SYSFS,)
214ifdef VBOX_WITH_USB
215 VBoxSVC_DEFS += \
216 VBOX_WITH_USB \
217 $(if $(VBOX_WITH_EHCI),VBOX_WITH_EHCI,) \
218 $(if $(VBOX_WITH_NEW_USB_CODE_ON_DARWIN),VBOX_WITH_NEW_USB_CODE_ON_DARWIN,)
219endif
220VBoxSVC_DEFS.win += VBOX_COM_OUTOFPROC_MODULE
221VBoxSVC_DEFS.win.x86 += _WIN32_WINNT=0x0500
222VBoxSVC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
223# Try to load and use libhal at runtime for probing removable media
224# VBoxSVC_DEFS.linux += VBOX_USE_LIBHAL
225VBoxSVC_DEFS.solaris += VBOX_USE_LIBHAL
226ifdef VBOX_SOLARIS_NSL_RESOLVED
227 VBoxSVC_DEFS.solaris += VBOX_SOLARIS_NSL_RESOLVED
228endif
229
230VBoxSVC_CXXFLAGS = $(filter-out -Wno-unused,$(TEMPLATE_VBOXMAINEXE_CXXFLAGS))
231## @todo We're disabling optimizations on FreeBSD to work around strange linker
232# errors in release builds. Figure out why and how to work around it in a
233# more optimal fashion.
234VBoxSVC_CXXFLAGS.freebsd = -O0
235
236VBoxSVC_INCS = \
237 include \
238 $(PATH_VBoxSVC) \
239 $(dir $(VBOX_XML_SCHEMADEFS_H)) \
240 .
241VBoxSVC_INCS.win = \
242 $(PATH_VBoxCOM)
243ifdef VBOX_WITH_USB
244 VBoxSVC_INCS.os2 = \
245 $(PATH_ROOT)/src/VBox/HostDrivers/VBoxUSB/os2
246endif
247
248VBoxSVC_LIBS += \
249 $(LIB_DDU) \
250 $(LIB_SETTINGS)
251VBoxSVC_LIBS.darwin = \
252 $(LIB_VMM) \
253 $(LIB_REM)
254VBoxSVC_LIBS.solaris = \
255 adm \
256 nsl
257ifdef VBOX_WITH_NETFLT
258 ifdef VBOX_SOLARIS_NSL_RESOLVED
259 VBoxSVC_LIBS.solaris += devinfo
260 endif
261 VBoxSVC_LIBS.solaris += socket
262endif
263ifdef VBOX_WITH_USB
264 VBoxSVC_LIBS.solaris += \
265 devinfo
266endif
267
268VBoxSVC_INTERMEDIATES = \
269 $(VBOX_MAIN_PREREQS) \
270 $(VBOX_XML_SCHEMADEFS_H)
271
272VBoxSVC_SOURCES = \
273 Global.cpp \
274 Logging.cpp \
275 AutoLock.cpp \
276 Matching.cpp \
277 VirtualBoxBase.cpp \
278 VirtualBoxErrorInfoImpl.cpp \
279 VirtualBoxImpl.cpp \
280 VirtualBoxImplExtra.cpp \
281 ApplianceImpl.cpp \
282 MachineImpl.cpp \
283 SnapshotImpl.cpp \
284 MediumImpl.cpp \
285 HardDiskImpl.cpp \
286 HardDiskAttachmentImpl.cpp \
287 HardDiskFormatImpl.cpp \
288 ProgressImpl.cpp \
289 DVDDriveImpl.cpp \
290 FloppyDriveImpl.cpp \
291 HostImpl.cpp \
292 HostDVDDriveImpl.cpp \
293 HostFloppyDriveImpl.cpp \
294 HostNetworkInterfaceImpl.cpp \
295 DHCPServerImpl.cpp \
296 DHCPServerRunner.cpp \
297 GuestOSTypeImpl.cpp \
298 NetworkAdapterImpl.cpp \
299 SerialPortImpl.cpp \
300 ParallelPortImpl.cpp \
301 USBControllerImpl.cpp \
302 StorageControllerImpl.cpp \
303 AudioAdapterImpl.cpp \
304 SharedFolderImpl.cpp \
305 SystemPropertiesImpl.cpp \
306 BIOSSettingsImpl.cpp \
307 Version.cpp \
308 HostPower.cpp \
309 $(if $(VBOX_WITH_VRDP),VRDPServerImpl.cpp,) \
310 $(if $(VBOX_WITH_XPCOM),xpcom/server.cpp,) \
311 $(VBOX_XML_SCHEMADEFS_CPP)
312
313VBoxSVC_SOURCES.darwin = \
314 darwin/iokit.cpp \
315 darwin/HostPowerDarwin.cpp
316
317VBoxSVC_SOURCES.win = \
318 win/svcmain.cpp \
319 win/svchlp.cpp \
320 win/HostPowerWin.cpp \
321 win/VBoxSVC.rc
322
323VBoxSVC_SOURCES.linux = \
324 linux/HostHardwareLinux.cpp
325
326ifdef VBOX_WITH_DBUS
327 VBoxSVC_SOURCES.linux += linux/vbox-dbus.cpp
328endif
329
330VBoxSVC_SOURCES.solaris = \
331 linux/vbox-libhal.cpp \
332 solaris/DynLoadLibSolaris.cpp
333
334ifdef VBOX_WITH_USB
335 VBoxSVC_SOURCES += \
336 USBDeviceFilterImpl.cpp \
337 USBProxyService.cpp \
338 HostUSBDeviceImpl.cpp
339 VBoxSVC_SOURCES.darwin += darwin/USBProxyServiceDarwin.cpp
340 VBoxSVC_SOURCES.linux += linux/USBProxyServiceLinux.cpp
341 VBoxSVC_SOURCES.os2 += os2/USBProxyServiceOs2.cpp
342 VBoxSVC_SOURCES.solaris += solaris/USBProxyServiceSolaris.cpp
343 VBoxSVC_SOURCES.win += win/USBProxyServiceWindows.cpp
344endif
345
346ifdef VBOX_WITH_NETFLT
347 # Note! The includes from the TOOL has lower priority than the SDKs,
348 # since comdef.h is in both the DDK and VCC we want to make sure
349 # we're using the VCC since we're not using the DDK compiler/crt.
350 # Since this is potentially risky, restrict it to the source file
351 # needing it.
352 win/NetIf-win.cpp_INCS.win += $(PATH_TOOL_$(VBOX_VCC_TOOL)_INC)
353 VBoxSVC_LIBS.win += \
354 $(PATH_LIB)/WinNetConfig.lib \
355 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
356 $(PATH_SDK_WINPSDK_LIB)/WbemUuid.Lib
357 ifdef VBOX_NETFLT_ONDEMAND_BIND
358 VBoxSVC_DEFS.win += VBOX_NETFLT_ONDEMAND_BIND
359 endif
360endif
361VBoxSVC_LDFLAGS.darwin = -framework IOKit -framework SystemConfiguration
362ifeq ($(KBUILD_TYPE),debug)
363 VBoxSVC_LDFLAGS.linux += -rdynamic # for backtrace_symbols()
364endif
365
366ifdef VBOX_WITH_RESOURCE_USAGE_API
367 VBoxSVC_SOURCES += \
368 PerformanceImpl.cpp \
369 Performance.cpp
370 VBoxSVC_SOURCES.darwin += darwin/PerformanceDarwin.cpp
371 VBoxSVC_SOURCES.freebsd += freebsd/PerformanceFreeBSD.cpp
372 VBoxSVC_SOURCES.linux += linux/PerformanceLinux.cpp
373 VBoxSVC_SOURCES.os2 += os2/PerformanceOs2.cpp
374 VBoxSVC_SOURCES.solaris += solaris/PerformanceSolaris.cpp
375 VBoxSVC_SOURCES.win += win/PerformanceWin.cpp
376 VBoxSVC_LDFLAGS.darwin += -lproc
377 VBoxSVC_LDFLAGS.solaris += -lkstat
378 VBoxSVC_LDFLAGS.win += psapi.lib powrprof.lib
379endif
380
381ifdef VBOX_WITH_HOSTNETIF_API
382 VBoxSVC_SOURCES.win += win/NetIf-win.cpp
383 VBoxSVC_SOURCES.linux += linux/NetIf-linux.cpp
384 VBoxSVC_SOURCES.os2 += os2/NetIf-os2.cpp
385 VBoxSVC_SOURCES.darwin += darwin/NetIf-darwin.cpp
386 VBoxSVC_SOURCES.solaris += solaris/NetIf-solaris.cpp
387 VBoxSVC_SOURCES.freebsd += freebsd/NetIf-freebsd.cpp
388 VBoxSVC_DEFS += VBOX_WITH_HOSTNETIF_API
389 if1of ($(KBUILD_TARGET), linux darwin solaris freebsd)
390 VBoxSVC_SOURCES += generic/NetIf-generic.cpp
391 endif
392endif
393
394
395win/VBoxSVC.rc_INCS = $(PATH_VBoxSVC)
396win/VBoxSVC.rc_DEPS = $(PATH_VBoxSVC)/VBoxSVC.rgs $(PATH_VBoxSVC)/VBoxSVC-icon.rc
397win/VBoxSVC.rc_CLEAN = $(PATH_VBoxSVC)/VBoxSVC.rgs $(PATH_VBoxSVC)/VBoxSVC-icon.rc
398
399$$(PATH_VBoxSVC)/VBoxSVC-icon.rc: $(MAKEFILE_CURRENT) $(VBOX_WINDOWS_ICON_FILE) | $$(dir $$(@D))
400 $(APPEND) -t $@ '1 ICON DISCARDABLE "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
401
402$$(PATH_VBoxSVC)/VBoxSVC.rgs: $(VBOX_PATH_MAIN_SRC)/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(dir $$(@D))
403 $(VBOX_XSLTPROC) --stringparam Module VBoxSVC -o $@ $< $(VBOX_XIDL_FILE)
404
405#
406# Embed XML Schema files to VBoxSVC
407#
408VBOX_XML_SCHEMA_COMMON = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-common.xsd
409VBOX_XML_SCHEMA.darwin = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-macosx.xsd
410VBOX_XML_SCHEMA.linux = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-linux.xsd
411VBOX_XML_SCHEMA.freebsd = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-freebsd.xsd
412VBOX_XML_SCHEMA.win = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-windows.xsd
413VBOX_XML_SCHEMA.os2 = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-os2.xsd
414VBOX_XML_SCHEMA.solaris = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-solaris.xsd
415
416VBOX_XML_CONVERTER_TEMPLATE = $(VBOX_PATH_MAIN_SRC)/xml/SettingsConverter.xsl
417
418$$(PATH_VBoxSVC)/xml_VirtualBox_settings_xsd.h: $(VBOX_XML_SCHEMA.$(KBUILD_TARGET)) $(VBOX_BIN2C)
419 $(call MSG_TOOL,bin2c,VBoxSVC,$<,$@)
420 $(QUIET)$(VBOX_BIN2C) _xml_VirtualBox_settings_xsd $< $@
421
422$$(PATH_VBoxSVC)/xml_VirtualBox_settings_common_xsd.h: $(VBOX_XML_SCHEMA_COMMON) $(VBOX_BIN2C)
423 $(call MSG_TOOL,bin2c,VBoxSVC,$<,$@)
424 $(QUIET)$(VBOX_BIN2C) _xml_VirtualBox_settings_common_xsd $< $@
425
426$$(PATH_VBoxSVC)/xml_SettingsConverter_xsl.h: $(VBOX_XML_CONVERTER_TEMPLATE) $(VBOX_BIN2C)
427 $(call MSG_TOOL,bin2c,VBoxSVC,$<,$@)
428 $(QUIET)$(VBOX_BIN2C) _xml_SettingsConverter_xsl $< $@
429
430VirtualBoxImplExtra.cpp_DEPS = \
431 $(PATH_VBoxSVC)/xml_VirtualBox_settings_xsd.h \
432 $(PATH_VBoxSVC)/xml_VirtualBox_settings_common_xsd.h \
433 $(PATH_VBoxSVC)/xml_SettingsConverter_xsl.h
434VBoxSVC_CLEAN += $(VirtualBoxImplExtra.cpp_DEPS)
435
436$(VBOX_XML_SCHEMADEFS_H): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(KBUILD_TARGET)) $(VBOX_XML_SCHEMA_COMMON) | $$(dir $$@)
437 $(call MSG_GENERATE,SchemaDefs,$@,$<)
438 $(VBOX_XSLTPROC) --stringparam mode declare -o $@ $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(KBUILD_TARGET))
439
440$(VBOX_XML_SCHEMADEFS_CPP): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(KBUILD_TARGET)) $(VBOX_XML_SCHEMA_COMMON) | $$(dir $$@)
441 $(call MSG_GENERATE,SchemaDefs,$@,$<)
442 $(VBOX_XSLTPROC) --stringparam mode define -o $@ $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(KBUILD_TARGET))
443
444OTHER_CLEAN += $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP)
445
446
447ifdef VBOX_WITH_XPCOM
448#
449# VBoxSVCM - VBoxSVC wrapper module
450#
451DLLS += VBoxSVCM
452VBoxSVCM_TEMPLATE = VBOXMAINCOMP
453VBoxSVCM_DEFS = IN_RING3 $(VBOX_MAIN_DEFS)
454VBoxSVCM_INCS = \
455 include \
456 $(PATH_VBoxC) \
457 .
458VBoxSVCM_INTERMEDIATES = $(VBOX_MAIN_PREREQS)
459VBoxSVCM_SOURCES = \
460 xpcom/server_module.cpp
461VBoxSVCM_LDFLAGS.darwin = \
462 -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxSVCM.dylib \
463 -exported_symbols_list $(PATH_VBoxSVCM)/VBoxSVCM.def
464 ifeq ($(KBUILD_TARGET),darwin)
465VBoxSVCM_ORDERDEPS += $(PATH_VBoxSVCM)/VBoxSVCM.def
466VBoxSVCM_CLEAN += $(PATH_VBoxSVCM)/VBoxSVCM.def
467$$(PATH_VBoxSVCM)/VBoxSVCM.def:
468 $(RM) -f $@
469 $(APPEND) $@ _NSGetModule
470 endif
471VBoxSVCM_INTERMEDIATES += $(VBOX_IDL_HEADER.XPCOM)
472
473endif # VBOX_WITH_XPCOM
474
475
476#
477# VBoxSettings
478#
479DLLS += VBoxSettings
480VBoxSettings_TEMPLATE = VBOXMAINDLL
481VBoxSettings_NAME = $(basename $(notdir $(LIB_SETTINGS)))
482VBoxSettings_SDKS = VBOX_LIBXSLT VBOX_LIBXML2 VBOX_ZLIB VBOX_BOOST
483VBoxSettings_DEFS = IN_VBOXXML_R3
484VBoxSettings_INCS = \
485 include
486VBoxSettings_SOURCES = \
487 xml/xml.cpp \
488 xml/Settings.cpp
489VBoxSettings_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/$(notdir $(LIB_SETTINGS)) -Wl,-x # no debug info please.
490
491
492#
493# VBoxC module
494#
495DLLS += VBoxC
496VBoxC_TEMPLATE = VBOXMAINCOMP
497VBoxC_DEFS = \
498 IN_RING3 \
499 $(VBOX_MAIN_DEFS) \
500 VBOX_COM_INPROC \
501 $(if $(VBOX_WITH_VRDP),VBOX_WITH_VRDP,) \
502 $(if $(VBOX_WITH_HGCM),VBOX_WITH_HGCM,) \
503 $(if $(VBOX_MAIN_RELEASE_LOG),VBOX_MAIN_RELEASE_LOG LOG_ENABLED,) \
504 $(if $(VBOX_WITH_ALSA),VBOX_WITH_ALSA,) \
505 $(if $(VBOX_WITH_PULSE),VBOX_WITH_PULSE,) \
506 $(if $(VBOX_WITH_WINMM),VBOX_WITH_WINMM,) \
507 $(if $(VBOX_WITH_CROSSBOW),VBOX_WITH_CROSSBOW,) \
508 $(if $(VBOX_WITH_E1000),VBOX_WITH_E1000,) \
509 $(if $(VBOX_WITH_EFI),VBOX_WITH_EFI,) \
510 $(if $(VBOX_WITH_HPET),VBOX_WITH_HPET,) \
511 $(if $(VBOX_WITH_SMC),VBOX_WITH_SMC,) \
512 $(if $(VBOX_WITH_LPC),VBOX_WITH_LPC,) \
513 $(if $(VBOX_WITH_PDM_ASYNC_COMPLETION),VBOX_WITH_PDM_ASYNC_COMPLETION,)
514ifdef VBOX_WITH_USB
515VBoxC_DEFS += \
516 VBOX_WITH_USB \
517 $(if $(VBOX_WITH_EHCI),VBOX_WITH_EHCI,)
518endif
519VBoxC_DEFS.darwin.x86 = VBOX_WITH_2X_4GB_ADDR_SPACE
520VBoxC_DEFS.win.x86 += _WIN32_WINNT=0x0500
521VBoxC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
522
523VBoxC_INCS = \
524 include \
525 $(PATH_VBoxC) \
526 $(dir $(VBOX_XML_SCHEMADEFS_H))
527VBoxC_INCS.win = \
528 $(PATH_VBoxCOM) \
529 .
530
531VBoxC_LDFLAGS.darwin = \
532 -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxC.dylib \
533 -exported_symbols_list $(PATH_VBoxC)/VBoxC.def
534ifdef VBOX_USE_VCC80
535 VBoxC_LDFLAGS.win = /MANIFEST
536endif
537
538VBoxC_LIBS += \
539 $(LIB_VMM) \
540 $(LIB_REM)
541
542ifdef VBOX_WITH_NETFLT
543 VBoxC_LIBS.win += $(PATH_LIB)/WinNetConfig.lib \
544 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
545 $(PATH_SDK_WINPSDK_LIB)/WbemUuid.Lib
546endif
547
548VBoxC_INTERMEDIATES = \
549 $(VBOX_MAIN_PREREQS) \
550 $(VBOX_XML_SCHEMADEFS_H)
551
552VBoxC_SOURCES = \
553 Global.cpp \
554 Logging.cpp \
555 AutoLock.cpp \
556 VBoxDll.cpp \
557 Version.cpp \
558 USBDeviceImpl.cpp \
559 RemoteUSBDeviceImpl.cpp \
560 VirtualBoxBase.cpp \
561 VirtualBoxErrorInfoImpl.cpp \
562 ProgressImpl.cpp \
563 SharedFolderImpl.cpp \
564 SessionImpl.cpp \
565 ConsoleImpl.cpp \
566 ConsoleImpl2.cpp \
567 ConsoleVRDPServer.cpp \
568 GuestImpl.cpp \
569 KeyboardImpl.cpp \
570 MouseImpl.cpp \
571 DisplayImpl.cpp \
572 MachineDebuggerImpl.cpp \
573 VBoxDriversRegister.cpp \
574 AudioSnifferInterface.cpp \
575 VMMDevInterface.cpp \
576 $(VBOX_XML_SCHEMADEFS_CPP)
577VBoxC_SOURCES.win = \
578 win/dllmain.cpp \
579 win/VBoxC.def \
580 win/VBoxC.rc
581
582ifdef VBOX_WITH_XPCOM
583VBoxC_SOURCES += \
584 xpcom/module.cpp
585endif
586
587ifdef VBOX_WITH_HGCM
588VBoxC_SOURCES += \
589 hgcm/HGCMObjects.cpp \
590 hgcm/HGCMThread.cpp \
591 hgcm/HGCM.cpp
592endif
593
594ifdef VBOX_WITH_VIDEOHWACCEL
595VBoxC_DEFS += VBOX_WITH_VIDEOHWACCEL
596endif
597
598ifdef VBOX_WITH_USB
599VBoxC_SOURCES += \
600 RemoteUSBBackend.cpp
601endif
602
603ifeq ($(KBUILD_TARGET),darwin)
604VBoxC_ORDERDEPS += $(PATH_VBoxC)/VBoxC.def
605VBoxC_CLEAN += $(PATH_VBoxC)/VBoxC.def
606$$(PATH_VBoxC)/VBoxC.def: $(MAKEFILE_CURRENT)
607 $(RM) -f $@
608 $(APPEND) $@ _NSGetModule
609 $(APPEND) $@ _VBoxDriversRegister
610endif
611
612ConsoleImpl.cpp_DEFS = \
613 VBOX_BUILD_TARGET=\"$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)\"
614
615
616Version.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
617Version.cpp_DEPS = $(VBOX_SVN_REV_KMK)
618
619win/VBoxC.rc_DEPS = $(PATH_VBoxC)/VBoxC.rgs $(PATH_VBoxCOM)/VirtualBox.tlb
620VBoxC_CLEAN.win += $(PATH_VBoxC)/VBoxC.rgs
621
622$$(PATH_VBoxC)/VBoxC.rgs: $(VBOX_PATH_MAIN_SRC)/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(PATH_VBoxC)/
623 $(VBOX_XSLTPROC) --stringparam Module VBoxC -o $@ $< $(VBOX_XIDL_FILE)
624
625
626#
627# VBoxCOM - COM Abstraction Layer library
628#
629LIBRARIES += VBoxCOM
630VBoxCOM_TEMPLATE = VBOXMAINLIB
631VBoxCOM_INTERMEDIATES = $(VBOX_MAIN_PREREQS)
632VBoxCOM_SOURCES = \
633 glue/com.cpp \
634 glue/initterm.cpp \
635 glue/string.cpp \
636 glue/EventQueue.cpp \
637 glue/ErrorInfo.cpp \
638 glue/errorprint2.cpp \
639 glue/SupportErrorInfo.cpp \
640 glue/VirtualBoxErrorInfo.cpp
641ifeq ($(KBUILD_TARGET),win)
642 VBoxCOM_DEFS.x86 += _WIN32_WINNT=0x0500
643 VBoxCOM_DEFS.amd64 += _WIN32_WINNT=0x0510
644 VBoxCOM_SOURCES += \
645 $(PATH_VBoxCOM)/VirtualBox_i.c
646else # !win
647 VBoxCOM_INCS += \
648 include
649 VBoxCOM_SOURCES += \
650 xpcom/helpers.cpp
651endif # !win
652
653
654endif # !VBOX_ONLY_SDK (the ifndef is far above)
655
656
657#
658# Installs com related thing(s) to bin.
659#
660INSTALLS.win += VBoxMain-com-inst
661VBoxMain-com-inst_INST = $(INST_BIN)
662VBoxMain-com-inst_SOURCES = \
663 win/comregister.cmd
664
665
666if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "linux"
667 #
668 # Installs linux/hardening related things to components.
669 #
670 INSTALLS.linux += VBoxMain-hardening-inst
671 VBoxMain-hardening-inst_INST = $(INST_BIN)components/
672 VBoxMain-hardening-inst_SYMLINKS = \
673 VBoxDDU.so=>../VBoxDDU.so \
674 VBoxREM.so=>../VBoxREM.so \
675 VBoxRT.so=>../VBoxRT.so \
676 VBoxVMM.so=>../VBoxVMM.so \
677 VBoxXPCOM.so=>../VBoxXPCOM.so
678endif
679
680
681# generate rules
682include $(KBUILD_PATH)/subfooter.kmk
683
684
685
686#
687# Additions rules.
688#
689
690## @todo this hack ain't cutting it any longer. (the file name is abspath'ed since ages now.)
691xpcom/helpers.cpp: $(VBOX_IDL_TYPELIB.XPCOM)
692
693$(VBOX_IDL_FILE.XPCOM): $(VBOX_PATH_MAIN_SRC)/idl/xpidl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
694 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
695 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
696
697$(VBOX_IDL_TYPELIB.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
698 $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
699 $(QUIET)$(VBOX_XPIDL_ENV)$(VBOX_XPIDL) -m typelib -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
700 $(CHMOD) 0644 $@
701## @todo ^^^^^^^^^^^^ fix horrible hack
702
703$(VBOX_IDL_HEADER.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
704 $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
705 $(QUIET)$(VBOX_XPIDL_ENV)$(VBOX_XPIDL) -m header -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
706
707
708VBOX_MAIN_IDL ?= $(EXEC_X86_WIN32) $(call VBOX_FN_MAKE_WIN_PATH,$(firstword $(wildcard \
709 $(PATH_SDK_WINPSDK_BIN)/Midl.Exe\
710 $(PATH_SDK_WINPSDK)/Bin/Midl.Exe\
711 $(PATH_DEVTOOLS)/win.x86/bin/midl.exe\
712 ) Sorry_Cannot_Find_The_Midl_Compiler_In_The_PSDK))
713IDL_DEFS = /nologo
714ifdef VBOX_WITH_VRDP
715 IDL_DEFS += /D VBOX_WITH_VRDP
716endif
717
718$(VBOX_IDL_FILE.MSCOM): $(VBOX_PATH_MAIN_SRC)/idl/midl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
719 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
720 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
721
722
723# Aliases for testing purposes.
724ifdef VBOX_WITH_XPCOM
725testidl: $(VBOX_IDL_FILE.XPCOM) $(VBOX_IDL_TYPELIB.XPCOM)
726testidlhdr: $(VBOX_IDL_HEADER.XPCOM)
727else
728testidl: $(VBOX_IDL_FILE.MSCOM) $(PATH_VBoxCOM)/VirtualBox_i.c
729endif
730
731
732## @todo r=bird: last changes to this rule showed incorrect dependencies here as it broke testcase (see testboxwin2).
733# This is kind of obvious when looking at the rule, because it's (a) not specifying all it output
734# and (b) generating more stuff *after* the main target has been completed.
735#
736# What needs to be done is to not depend on _i.c in the object subdir, but on all the final outputs.
737$(PATH_VBoxCOM)/VirtualBox_i.c \
738+ $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox_i.c \
739+ $(PATH_VBoxCOM)/VirtualBox.h \
740+ $(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h \
741+ $(PATH_VBoxCOM)/VirtualBox.tlb \
742+ $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox.tlb: $(VBOX_IDL_FILE.MSCOM) | $(call DIRDEP,$(PATH_VBoxCOM))
743 $(VBOX_MAIN_IDL) $(IDL_DEFS) \
744 /out $(call VBOX_FN_MAKE_WIN_PATH,$(PATH_VBoxCOM)) \
745 /cpp_cmd $(subst $(EXEC_X86_WIN32),,$(call VBOX_FN_MAKE_WIN_PATH,$(TOOL_$(VBOX_VCC_TOOL)_CC))) \
746 /I $(call VBOX_FN_MAKE_WIN_PATH,$(PATH_SDK_WINPSDK_INC)) \
747 /I idl \
748 $(call VBOX_FN_MAKE_WIN_PATH,$<)
749 $(MKDIR) -p $(VBOX_PATH_SDK)/bindings/mscom/include
750 $(CP) $(PATH_VBoxCOM)/VirtualBox.h $(VBOX_PATH_SDK)/bindings/mscom/include
751 $(MKDIR) -p $(VBOX_PATH_SDK)/bindings/mscom/lib
752 $(CP) $(PATH_VBoxCOM)/VirtualBox.tlb $(VBOX_PATH_SDK)/bindings/mscom/lib
753 $(CP) $(PATH_VBoxCOM)/VirtualBox_i.c $(VBOX_PATH_SDK)/bindings/mscom/lib
754
755
756## @todo Use install targets, please.
757# Actually, what on earth is this stuff doing? Why copy two files like this?
758$(VBOX_PATH_SDK)/bindings/mscom/python/samples/shellcommon.py \
759+ $(VBOX_PATH_SDK)/bindings/mscom/python/samples/vboxshell.py: \
760 $(PATH_ROOT)/src/VBox/Frontends/VBoxShell/shellcommon.py \
761 $(PATH_ROOT)/src/VBox/Frontends/VBoxShell/mscom/vboxshell.py
762 $(MKDIR) -p $(VBOX_PATH_SDK)/bindings/mscom/python/samples
763 $(CP) $(PATH_ROOT)/src/VBox/Frontends/VBoxShell/shellcommon.py $(VBOX_PATH_SDK)/bindings/mscom/python/samples/shellcommon.py
764 $(CP) $(PATH_ROOT)/src/VBox/Frontends/VBoxShell/mscom/vboxshell.py $(VBOX_PATH_SDK)/bindings/mscom/python/samples/vboxshell.py
765
766#
767# Translation stuff
768#
769VBoxSVC_VBOX_HEADERS = \
770 include/collection.h \
771 include/MachineImpl.h \
772 include/HostDVDDriveImpl.h \
773 include/HostFloppyDriveImpl.h
774VBoxSVC_VBOX_TRANSLATIONS = \
775 nls/VBoxSVC_de.ts
776
777VBoxC_VBOX_HEADERS = \
778 include/ConsoleImpl.h
779VBoxC_VBOX_TRANSLATIONS = \
780 nls/VBoxC_de.ts
781
782updatenls::
783 $(VBOX_LUPDATE) $(VBoxSVC_SOURCES) $(VBoxSVC_VBOX_HEADERS) -ts $(VBoxSVC_VBOX_TRANSLATIONS)
784 $(VBOX_LUPDATE) $(VBoxC_SOURCES) $(VBoxC_VBOX_HEADERS) -ts $(VBoxC_VBOX_TRANSLATIONS)
785
786testconverter:: $(VBOX_USER_HOME)/VirtualBox.xml
787 $(call MSG_TOOL,xsltproc,Test Settings Converter,$<,$(VBOX_USER_HOME)/VirtualBox.xml.test)
788 $(QUIET)$(VBOX_XSLTPROC) -o $(VBOX_USER_HOME)/VirtualBox.xml.test xml/SettingsConverter.xsl $<
789
790testconverter2:: $(VBOX_USER_HOME)/Machines/dos/dos.xml
791 $(call MSG_TOOL,xsltproc,Test Settings Converter,$<,$<.test)
792 $(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