VirtualBox

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

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

Dhcp->DHCP

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