VirtualBox

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

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

#3282: API, RT generic part, updated VBoxManage list hostif.

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