VirtualBox

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

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

Backed out 40454

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