VirtualBox

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

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

SDK: refactoring

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