VirtualBox

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

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

oops, not _SRC as cp target.

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