VirtualBox

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

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

cbindings to OSE

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