VirtualBox

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

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

Python: generic glue library, hiding all ugly platform details

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