VirtualBox

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

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

#3569: DHCP Server is now started from VBoxSVC and terminates with it.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 23.0 KB
Line 
1# $Id: Makefile.kmk 18208 2009-03-24 17:01:32Z 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 DHCPServerRunner.cpp \
283 GuestOSTypeImpl.cpp \
284 NetworkAdapterImpl.cpp \
285 SerialPortImpl.cpp \
286 ParallelPortImpl.cpp \
287 USBControllerImpl.cpp \
288 StorageControllerImpl.cpp \
289 AudioAdapterImpl.cpp \
290 SharedFolderImpl.cpp \
291 SystemPropertiesImpl.cpp \
292 BIOSSettingsImpl.cpp \
293 Version.cpp \
294 HostPower.cpp \
295 $(if $(VBOX_WITH_VRDP),VRDPServerImpl.cpp,) \
296 $(if $(VBOX_WITH_XPCOM),xpcom/server.cpp,) \
297 $(VBOX_XML_SCHEMADEFS_CPP)
298
299VBoxSVC_SOURCES.darwin = \
300 darwin/iokit.cpp \
301 darwin/HostPowerDarwin.cpp
302
303VBoxSVC_SOURCES.win = \
304 win/svcmain.cpp \
305 win/svchlp.cpp \
306 win/HostPowerWin.cpp \
307 win/VBoxSVC.rc
308
309VBoxSVC_SOURCES.linux = \
310 linux/HostHardwareLinux.cpp
311
312ifdef VBOX_WITH_DBUS
313 VBoxSVC_SOURCES.linux += linux/vbox-dbus.cpp
314endif
315
316VBoxSVC_SOURCES.solaris = \
317 linux/vbox-libhal.cpp \
318 solaris/DynLoadLibSolaris.cpp
319
320ifdef VBOX_WITH_USB
321 VBoxSVC_SOURCES += \
322 USBDeviceFilterImpl.cpp \
323 USBProxyService.cpp \
324 HostUSBDeviceImpl.cpp
325 VBoxSVC_SOURCES.darwin += darwin/USBProxyServiceDarwin.cpp
326 VBoxSVC_SOURCES.linux += linux/USBProxyServiceLinux.cpp
327 VBoxSVC_SOURCES.os2 += os2/USBProxyServiceOs2.cpp
328 VBoxSVC_SOURCES.solaris += solaris/USBProxyServiceSolaris.cpp
329 VBoxSVC_SOURCES.win += win/USBProxyServiceWindows.cpp
330endif
331
332ifdef VBOX_WITH_NETFLT
333 # Note! The includes from the TOOL has lower priority than the SDKs,
334 # since comdef.h is in both the DDK and VCC we want to make sure
335 # we're using the VCC since we're not using the DDK compiler/crt.
336 # Since this is potentially risky, restrict it to the source file
337 # needing it.
338 win/NetIfList-win.cpp_INCS.win += $(PATH_TOOL_$(VBOX_VCC_TOOL)_INC)
339 VBoxSVC_LIBS.win += \
340 $(PATH_LIB)/WinNetConfig.lib \
341 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
342 $(PATH_SDK_WINPSDK_LIB)/WbemUuid.Lib
343 ifdef VBOX_NETFLT_ONDEMAND_BIND
344 VBoxSVC_DEFS.win += VBOX_NETFLT_ONDEMAND_BIND
345 endif
346endif
347VBoxSVC_LDFLAGS.darwin = -framework IOKit -framework SystemConfiguration
348ifeq ($(KBUILD_TYPE),debug)
349 VBoxSVC_LDFLAGS.linux += -rdynamic # for backtrace_symbols()
350endif
351
352ifdef VBOX_WITH_RESOURCE_USAGE_API
353 VBoxSVC_SOURCES += \
354 PerformanceImpl.cpp \
355 Performance.cpp
356 VBoxSVC_SOURCES.darwin += darwin/PerformanceDarwin.cpp
357 VBoxSVC_SOURCES.freebsd += freebsd/PerformanceFreeBSD.cpp
358 VBoxSVC_SOURCES.linux += linux/PerformanceLinux.cpp
359 VBoxSVC_SOURCES.os2 += os2/PerformanceOs2.cpp
360 VBoxSVC_SOURCES.solaris += solaris/PerformanceSolaris.cpp
361 VBoxSVC_SOURCES.win += win/PerformanceWin.cpp
362 VBoxSVC_LDFLAGS.darwin += -lproc
363 VBoxSVC_LDFLAGS.solaris += -lkstat
364 VBoxSVC_LDFLAGS.win += psapi.lib powrprof.lib
365endif
366
367ifdef VBOX_WITH_HOSTNETIF_API
368 VBoxSVC_SOURCES.win += win/NetIfList-win.cpp
369 VBoxSVC_SOURCES.linux += linux/NetIfList-linux.cpp
370 VBoxSVC_SOURCES.os2 += os2/NetIfList-os2.cpp
371 VBoxSVC_SOURCES.darwin += darwin/NetIfList-darwin.cpp
372 VBoxSVC_SOURCES.solaris += solaris/NetIfList-solaris.cpp
373 VBoxSVC_DEFS += VBOX_WITH_HOSTNETIF_API
374 if1of ($(KBUILD_TARGET), linux darwin solaris)
375 VBoxSVC_SOURCES += generic/NetIf-generic.cpp
376 endif
377endif
378
379
380win/VBoxSVC.rc_INCS = $(PATH_VBoxSVC)
381win/VBoxSVC.rc_DEPS = $(PATH_VBoxSVC)/VBoxSVC.rgs $(PATH_VBoxSVC)/VBoxSVC-icon.rc
382win/VBoxSVC.rc_CLEAN = $(PATH_VBoxSVC)/VBoxSVC.rgs $(PATH_VBoxSVC)/VBoxSVC-icon.rc
383
384$$(PATH_VBoxSVC)/VBoxSVC-icon.rc: $(MAKEFILE_CURRENT) $(VBOX_WINDOWS_ICON_FILE) | $$(dir $$(@D))
385 $(APPEND) -t $@ '1 ICON DISCARDABLE "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
386
387$$(PATH_VBoxSVC)/VBoxSVC.rgs: $(VBOX_PATH_MAIN_SRC)/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(dir $$(@D))
388 $(VBOX_XSLTPROC) --stringparam Module VBoxSVC -o $@ $< $(VBOX_XIDL_FILE)
389
390#
391# Embed XML Schema files to VBoxSVC
392#
393VBOX_XML_SCHEMA_COMMON = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-common.xsd
394VBOX_XML_SCHEMA.darwin = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-macosx.xsd
395VBOX_XML_SCHEMA.linux = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-linux.xsd
396VBOX_XML_SCHEMA.freebsd = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-freebsd.xsd
397VBOX_XML_SCHEMA.win = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-windows.xsd
398VBOX_XML_SCHEMA.os2 = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-os2.xsd
399VBOX_XML_SCHEMA.solaris = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-solaris.xsd
400
401VBOX_XML_CONVERTER_TEMPLATE = $(VBOX_PATH_MAIN_SRC)/xml/SettingsConverter.xsl
402
403$$(PATH_VBoxSVC)/xml_VirtualBox_settings_xsd.h: $(VBOX_XML_SCHEMA.$(KBUILD_TARGET)) $(VBOX_BIN2C)
404 $(call MSG_TOOL,bin2c,VBoxSVC,$<,$@)
405 $(QUIET)$(VBOX_BIN2C) _xml_VirtualBox_settings_xsd $< $@
406
407$$(PATH_VBoxSVC)/xml_VirtualBox_settings_common_xsd.h: $(VBOX_XML_SCHEMA_COMMON) $(VBOX_BIN2C)
408 $(call MSG_TOOL,bin2c,VBoxSVC,$<,$@)
409 $(QUIET)$(VBOX_BIN2C) _xml_VirtualBox_settings_common_xsd $< $@
410
411$$(PATH_VBoxSVC)/xml_SettingsConverter_xsl.h: $(VBOX_XML_CONVERTER_TEMPLATE) $(VBOX_BIN2C)
412 $(call MSG_TOOL,bin2c,VBoxSVC,$<,$@)
413 $(QUIET)$(VBOX_BIN2C) _xml_SettingsConverter_xsl $< $@
414
415VirtualBoxImplExtra.cpp_DEPS = \
416 $(PATH_VBoxSVC)/xml_VirtualBox_settings_xsd.h \
417 $(PATH_VBoxSVC)/xml_VirtualBox_settings_common_xsd.h \
418 $(PATH_VBoxSVC)/xml_SettingsConverter_xsl.h
419VBoxSVC_CLEAN += $(VirtualBoxImplExtra.cpp_DEPS)
420
421$(VBOX_XML_SCHEMADEFS_H): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(KBUILD_TARGET)) $(VBOX_XML_SCHEMA_COMMON) | $$(dir $$@)
422 $(call MSG_GENERATE,SchemaDefs,$@,$<)
423 $(VBOX_XSLTPROC) --stringparam mode declare -o $@ $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(KBUILD_TARGET))
424
425$(VBOX_XML_SCHEMADEFS_CPP): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(KBUILD_TARGET)) $(VBOX_XML_SCHEMA_COMMON) | $$(dir $$@)
426 $(call MSG_GENERATE,SchemaDefs,$@,$<)
427 $(VBOX_XSLTPROC) --stringparam mode define -o $@ $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(KBUILD_TARGET))
428
429OTHER_CLEAN += $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP)
430
431
432ifdef VBOX_WITH_XPCOM
433#
434# VBoxSVCM - VBoxSVC wrapper module
435#
436DLLS += VBoxSVCM
437VBoxSVCM_TEMPLATE = VBOXMAINCOMP
438VBoxSVCM_DEFS = IN_RING3 $(VBOX_MAIN_DEFS)
439VBoxSVCM_INCS = \
440 include \
441 $(PATH_VBoxC) \
442 .
443VBoxSVCM_INTERMEDIATES = $(VBOX_MAIN_PREREQS)
444VBoxSVCM_SOURCES = \
445 xpcom/server_module.cpp
446VBoxSVCM_LDFLAGS.darwin = \
447 -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxSVCM.dylib \
448 -exported_symbols_list $(PATH_VBoxSVCM)/VBoxSVCM.def
449 ifeq ($(KBUILD_TARGET),darwin)
450VBoxSVCM_ORDERDEPS += $(PATH_VBoxSVCM)/VBoxSVCM.def
451VBoxSVCM_CLEAN += $(PATH_VBoxSVCM)/VBoxSVCM.def
452$$(PATH_VBoxSVCM)/VBoxSVCM.def:
453 $(RM) -f $@
454 $(APPEND) $@ _NSGetModule
455 endif
456VBoxSVCM_INTERMEDIATES += $(VBOX_IDL_HEADER.XPCOM)
457
458endif # VBOX_WITH_XPCOM
459
460
461#
462# VBoxSettings
463#
464DLLS += VBoxSettings
465VBoxSettings_TEMPLATE = VBOXMAINDLL
466VBoxSettings_NAME = $(basename $(notdir $(LIB_SETTINGS)))
467VBoxSettings_SDKS = VBOX_LIBXSLT VBOX_LIBXML2 VBOX_ZLIB VBOX_BOOST
468VBoxSettings_DEFS = IN_VBOXXML_R3
469VBoxSettings_INCS = \
470 include
471VBoxSettings_SOURCES = \
472 xml/xml.cpp \
473 xml/Settings.cpp
474VBoxSettings_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/$(notdir $(LIB_SETTINGS)) -Wl,-x # no debug info please.
475
476
477#
478# VBoxC module
479#
480DLLS += VBoxC
481VBoxC_TEMPLATE = VBOXMAINCOMP
482VBoxC_DEFS = \
483 IN_RING3 \
484 $(VBOX_MAIN_DEFS) \
485 VBOX_COM_INPROC \
486 $(if $(VBOX_WITH_VRDP),VBOX_WITH_VRDP,) \
487 $(if $(VBOX_WITH_HGCM),VBOX_WITH_HGCM,) \
488 $(if $(VBOX_MAIN_RELEASE_LOG),VBOX_MAIN_RELEASE_LOG LOG_ENABLED,) \
489 $(if $(VBOX_WITH_ALSA),VBOX_WITH_ALSA,) \
490 $(if $(VBOX_WITH_PULSE),VBOX_WITH_PULSE,) \
491 $(if $(VBOX_WITH_WINMM),VBOX_WITH_WINMM,) \
492 $(if $(VBOX_WITH_CROSSBOW),VBOX_WITH_CROSSBOW,) \
493 $(if $(VBOX_WITH_E1000),VBOX_WITH_E1000,) \
494 $(if $(VBOX_WITH_EFI),VBOX_WITH_EFI,) \
495 $(if $(VBOX_WITH_HPET),VBOX_WITH_HPET,) \
496 $(if $(VBOX_WITH_SMC),VBOX_WITH_SMC,) \
497 $(if $(VBOX_WITH_LPC),VBOX_WITH_LPC,) \
498 $(if $(VBOX_WITH_PDM_ASYNC_COMPLETION),VBOX_WITH_PDM_ASYNC_COMPLETION,)
499ifdef VBOX_WITH_USB
500VBoxC_DEFS += \
501 VBOX_WITH_USB \
502 $(if $(VBOX_WITH_EHCI),VBOX_WITH_EHCI,)
503endif
504VBoxC_DEFS.darwin.x86 = VBOX_WITH_2X_4GB_ADDR_SPACE
505VBoxC_DEFS.win.x86 += _WIN32_WINNT=0x0500
506VBoxC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
507
508VBoxC_INCS = \
509 include \
510 $(PATH_VBoxC) \
511 $(dir $(VBOX_XML_SCHEMADEFS_H))
512VBoxC_INCS.win = \
513 $(PATH_VBoxCOM) \
514 .
515
516VBoxC_LDFLAGS.darwin = \
517 -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxC.dylib \
518 -exported_symbols_list $(PATH_VBoxC)/VBoxC.def
519ifdef VBOX_USE_VCC80
520 VBoxC_LDFLAGS.win = /MANIFEST
521endif
522
523VBoxC_LIBS += \
524 $(LIB_VMM) \
525 $(LIB_REM)
526
527ifdef VBOX_WITH_NETFLT
528 VBoxC_LIBS.win += $(PATH_LIB)/WinNetConfig.lib
529endif
530
531VBoxC_INTERMEDIATES = \
532 $(VBOX_MAIN_PREREQS) \
533 $(VBOX_XML_SCHEMADEFS_H)
534
535VBoxC_SOURCES = \
536 Global.cpp \
537 Logging.cpp \
538 AutoLock.cpp \
539 VBoxDll.cpp \
540 Version.cpp \
541 USBDeviceImpl.cpp \
542 RemoteUSBDeviceImpl.cpp \
543 VirtualBoxBase.cpp \
544 VirtualBoxErrorInfoImpl.cpp \
545 ProgressImpl.cpp \
546 SharedFolderImpl.cpp \
547 SessionImpl.cpp \
548 ConsoleImpl.cpp \
549 ConsoleImpl2.cpp \
550 ConsoleVRDPServer.cpp \
551 GuestImpl.cpp \
552 KeyboardImpl.cpp \
553 MouseImpl.cpp \
554 DisplayImpl.cpp \
555 FramebufferImpl.cpp \
556 MachineDebuggerImpl.cpp \
557 VBoxDriversRegister.cpp \
558 AudioSnifferInterface.cpp \
559 VMMDevInterface.cpp \
560 $(VBOX_XML_SCHEMADEFS_CPP)
561VBoxC_SOURCES.win = \
562 win/dllmain.cpp \
563 win/VBoxC.def \
564 win/VBoxC.rc
565
566ifdef VBOX_WITH_XPCOM
567VBoxC_SOURCES += \
568 xpcom/module.cpp
569endif
570
571ifdef VBOX_WITH_HGCM
572VBoxC_SOURCES += \
573 hgcm/HGCMObjects.cpp \
574 hgcm/HGCMThread.cpp \
575 hgcm/HGCM.cpp
576endif
577
578ifdef VBOX_WITH_USB
579VBoxC_SOURCES += \
580 RemoteUSBBackend.cpp
581endif
582
583ifeq ($(KBUILD_TARGET),darwin)
584VBoxC_ORDERDEPS += $(PATH_VBoxC)/VBoxC.def
585VBoxC_CLEAN += $(PATH_VBoxC)/VBoxC.def
586$$(PATH_VBoxC)/VBoxC.def: $(MAKEFILE_CURRENT)
587 $(RM) -f $@
588 $(APPEND) $@ _NSGetModule
589 $(APPEND) $@ _VBoxDriversRegister
590endif
591
592ConsoleImpl.cpp_DEFS = \
593 VBOX_BUILD_TARGET=\"$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)\"
594
595
596Version.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
597Version.cpp_DEPS = $(VBOX_SVN_REV_KMK)
598
599win/VBoxC.rc_DEPS = $(PATH_VBoxC)/VBoxC.rgs $(PATH_VBoxCOM)/VirtualBox.tlb
600VBoxC_CLEAN.win += $(PATH_VBoxC)/VBoxC.rgs
601
602$$(PATH_VBoxC)/VBoxC.rgs: $(VBOX_PATH_MAIN_SRC)/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(PATH_VBoxC)/
603 $(VBOX_XSLTPROC) --stringparam Module VBoxC -o $@ $< $(VBOX_XIDL_FILE)
604
605
606#
607# VBoxCOM - COM Abstraction Layer library
608#
609LIBRARIES += VBoxCOM
610VBoxCOM_TEMPLATE = VBOXMAINLIB
611VBoxCOM_INTERMEDIATES = $(VBOX_MAIN_PREREQS)
612VBoxCOM_SOURCES = \
613 glue/com.cpp \
614 glue/initterm.cpp \
615 glue/string.cpp \
616 glue/EventQueue.cpp \
617 glue/ErrorInfo.cpp \
618 glue/errorprint2.cpp \
619 glue/SupportErrorInfo.cpp \
620 glue/VirtualBoxErrorInfo.cpp
621ifeq ($(KBUILD_TARGET),win)
622 VBoxCOM_DEFS.x86 += _WIN32_WINNT=0x0500
623 VBoxCOM_DEFS.amd64 += _WIN32_WINNT=0x0510
624 VBoxCOM_SOURCES += \
625 $(PATH_VBoxCOM)/VirtualBox_i.c
626else # !win
627 VBoxCOM_INCS += \
628 include
629 VBoxCOM_SOURCES += \
630 xpcom/helpers.cpp
631endif # !win
632
633
634endif # !VBOX_ONLY_SDK (the ifndef is far above)
635
636
637#
638# Installs com related thing(s) to bin.
639#
640INSTALLS.win += VBoxMain-com-inst
641VBoxMain-com-inst_INST = $(INST_BIN)
642VBoxMain-com-inst_SOURCES = \
643 win/comregister.cmd
644
645
646# generate rules
647include $(KBUILD_PATH)/subfooter.kmk
648
649
650
651#
652# Additions rules.
653#
654
655## @todo this hack ain't cutting it any longer. (the file name is abspath'ed since ages now.)
656xpcom/helpers.cpp: $(VBOX_IDL_TYPELIB.XPCOM)
657
658$(VBOX_IDL_FILE.XPCOM): $(VBOX_PATH_MAIN_SRC)/idl/xpidl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
659 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
660 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
661
662$(VBOX_IDL_TYPELIB.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
663 $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
664 $(QUIET)$(VBOX_XPIDL_ENV)$(VBOX_XPIDL) -m typelib -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
665 chmod 0644 $@
666## @todo ^^^^^^^^^^^^ fix horrible hack
667
668$(VBOX_IDL_HEADER.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
669 $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
670 $(QUIET)$(VBOX_XPIDL_ENV)$(VBOX_XPIDL) -m header -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
671
672
673VBOX_MAIN_IDL ?= $(EXEC_X86_WIN32) $(call VBOX_FN_MAKE_WIN_PATH,$(firstword $(wildcard \
674 $(PATH_SDK_WINPSDK_BIN)/Midl.Exe\
675 $(PATH_SDK_WINPSDK)/Bin/Midl.Exe\
676 $(PATH_DEVTOOLS)/win.x86/bin/midl.exe\
677 ) Sorry_Cannot_Find_The_Midl_Compiler_In_The_PSDK))
678IDL_DEFS = /nologo
679ifdef VBOX_WITH_VRDP
680 IDL_DEFS += /D VBOX_WITH_VRDP
681endif
682
683$(VBOX_IDL_FILE.MSCOM): $(VBOX_PATH_MAIN_SRC)/idl/midl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
684 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
685 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
686
687
688# Aliases for testing purposes.
689ifdef VBOX_WITH_XPCOM
690testidl: $(VBOX_IDL_FILE.XPCOM) $(VBOX_IDL_TYPELIB.XPCOM)
691testidlhdr: $(VBOX_IDL_HEADER.XPCOM)
692else
693testidl: $(VBOX_IDL_FILE.MSCOM) $(PATH_VBoxCOM)/VirtualBox_i.c
694endif
695
696
697## @todo r=bird: last changes to this rule showed incorrect dependencies here as it broke testcase (see testboxwin2).
698# This is kind of obvious when looking at the rule, because it's (a) not specifying all it output
699# and (b) generating more stuff *after* the main target has been completed.
700#
701# What needs to be done is to not depend on _i.c in the object subdir, but on all the final outputs.
702$(PATH_VBoxCOM)/VirtualBox_i.c \
703+ $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox_i.c \
704+ $(PATH_VBoxCOM)/VirtualBox.h \
705+ $(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h \
706+ $(PATH_VBoxCOM)/VirtualBox.tlb \
707+ $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox.tlb: $(VBOX_IDL_FILE.MSCOM) | $(call DIRDEP,$(PATH_VBoxCOM))
708 $(VBOX_MAIN_IDL) $(IDL_DEFS) \
709 /out $(call VBOX_FN_MAKE_WIN_PATH,$(PATH_VBoxCOM)) \
710 /cpp_cmd $(subst $(EXEC_X86_WIN32),,$(call VBOX_FN_MAKE_WIN_PATH,$(TOOL_$(VBOX_VCC_TOOL)_CC))) \
711 /I $(call VBOX_FN_MAKE_WIN_PATH,$(PATH_SDK_WINPSDK_INC)) \
712 /I idl \
713 $(call VBOX_FN_MAKE_WIN_PATH,$<)
714 $(MKDIR) -p $(VBOX_PATH_SDK)/bindings/mscom/include
715 $(CP) $(PATH_VBoxCOM)/VirtualBox.h $(VBOX_PATH_SDK)/bindings/mscom/include
716 $(MKDIR) -p $(VBOX_PATH_SDK)/bindings/mscom/lib
717 $(CP) $(PATH_VBoxCOM)/VirtualBox.tlb $(VBOX_PATH_SDK)/bindings/mscom/lib
718 $(CP) $(PATH_VBoxCOM)/VirtualBox_i.c $(VBOX_PATH_SDK)/bindings/mscom/lib
719
720#
721# Translation stuff
722#
723VBoxSVC_VBOX_HEADERS = \
724 include/collection.h \
725 include/MachineImpl.h \
726 include/HostDVDDriveImpl.h \
727 include/HostFloppyDriveImpl.h
728VBoxSVC_VBOX_TRANSLATIONS = \
729 nls/VBoxSVC_de.ts
730
731VBoxC_VBOX_HEADERS = \
732 include/ConsoleImpl.h
733VBoxC_VBOX_TRANSLATIONS = \
734 nls/VBoxC_de.ts
735
736updatenls::
737 $(VBOX_LUPDATE) $(VBoxSVC_SOURCES) $(VBoxSVC_VBOX_HEADERS) -ts $(VBoxSVC_VBOX_TRANSLATIONS)
738 $(VBOX_LUPDATE) $(VBoxC_SOURCES) $(VBoxC_VBOX_HEADERS) -ts $(VBoxC_VBOX_TRANSLATIONS)
739
740testconverter:: $(VBOX_USER_HOME)/VirtualBox.xml
741 $(call MSG_TOOL,xsltproc,Test Settings Converter,$<,$(VBOX_USER_HOME)/VirtualBox.xml.test)
742 $(QUIET)$(VBOX_XSLTPROC) -o $(VBOX_USER_HOME)/VirtualBox.xml.test xml/SettingsConverter.xsl $<
743
744testconverter2:: $(VBOX_USER_HOME)/Machines/dos/dos.xml
745 $(call MSG_TOOL,xsltproc,Test Settings Converter,$<,$<.test)
746 $(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