VirtualBox

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

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

Main/dhcp API, E_NOTIMPL yet

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