VirtualBox

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

Last change on this file since 23104 was 23104, checked in by vboxsync, 15 years ago

Main/USBProxyServiceLinux: VBOX_USB_SYSFS_BY_DEFAULT -> VBOX_WITH_SYSFS_BY_DEFAULT

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