VirtualBox

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

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

Python: generate constants, instead of relying on (*)COM mechanisms (WIP)

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