VirtualBox

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

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

SDK: refactoring Python samples

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