VirtualBox

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

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

kmk doc: stop when doxygen is unhappy with VirtualBox.xidl

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