VirtualBox

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

Last change on this file since 21073 was 21073, checked in by vboxsync, 15 years ago

Main: move libxml2 to IPRT unconditionally (remove VBOX_WITH_LIBXML2_IN_VBOXRT); move xml classes to IPRT; introduce IPRT ministring class as base for both Utf8Str and xml.cpp, with better performance (remembers string lengths and can thus use memcpy instead of strdup); introduce some Utf8Str helpers to avoid string buffer hacks in Main code

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