VirtualBox

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

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

use the header

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 19.9 KB
Line 
1# $Id: Makefile.kmk 12523 2008-09-17 07:33:07Z 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#
27# Include sub-makefile(s).
28#
29ifdef VBOX_WITH_WEBSERVICES
30 include $(PATH_SUB_CURRENT)/webservice/Makefile.kmk
31endif
32include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
33
34
35#
36# Targets and globals (bit of a mess...)
37#
38VBOX_PATH_MAIN_SRC := $(PATH_SUB_CURRENT)
39
40ifndef VBOX_ONLY_SDK
41 VBOX_FN_MAKE_WIN_PATH = $(subst /,\\,$(1))
42else
43 # used by some rules
44 PATH_VBoxCOM = $(PATH_TARGET)/VBoxCOM
45 BLDDIRS += $(PATH_VBoxCOM) $(PATH_BIN)/components
46 # I'm Evil! Dr. Evil.
47 include $(KBUILD_PATH)/tools/VCC70.kmk
48 include $(KBUILD_PATH)/sdks/WINPSDK.kmk
49 # on Wine Z: is always FS root
50 VBOX_FN_MAKE_WIN_PATH = $(subst /,\\,$(patsubst /%,Z:/%,$(1)))
51endif #!VBOX_ONLY_SDK
52
53
54# Construct VBOX_MAIN_DEFS
55## @todo eliminate or expand VBOX_MAIN_DEFS.
56VBOX_MAIN_DEFS =
57ifneq ($(KBUILD_TARGET),win)
58 ifndef VBOX_WITH_XPCOM
59 $(error "VBox: VBOX_WITH_XPCOM isn't defined")
60 endif
61 ifneq ($(KBUILD_TARGET),os2)
62 VBOX_MAIN_DEFS+= VBOX_WITH_SYS_V_IPC_SESSION_WATCHER
63 endif
64 ifndef VBOX_WITH_NETFLT
65 VBOX_MAIN_DEFS += VBOX_WITH_UNIXY_TAP_NETWORKING
66 endif
67endif
68ifdef VBOX_WITH_NETFLT
69 VBOX_MAIN_DEFS += VBOX_WITH_NETFLT
70endif
71ifdef VBOX_WITH_GUEST_PROPS
72 VBOX_MAIN_DEFS += VBOX_WITH_GUEST_PROPS
73endif
74if1of ($(KBUILD_TARGET), linux freebsd solaris)
75 VBOX_MAIN_DEFS += VBOX_MAIN_USE_SEMRW
76#else
77# if1of ($(VBOX_VERSION_BUILD),1 3 5 7 9)
78# VBOX_MAIN_DEFS += VBOX_MAIN_AUTOLOCK_TRAP
79# endif
80endif
81
82VBOX_IDL_FILE.MSCOM = $(VBOX_PATH_SDK)/bindings/mscom/idl/VirtualBox.idl
83VBOX_IDL_FILE.XPCOM = $(VBOX_PATH_SDK)/bindings/xpcom/idl/VirtualBox_XPCOM.idl
84
85VBOX_IDL_TYPELIB.XPCOM = $(PATH_BIN)/components/VirtualBox_XPCOM.xpt
86VBOX_IDL_HEADER.XPCOM = $(VBOX_PATH_SDK)/bindings/xpcom/include/VirtualBox_XPCOM.h
87
88# The MS COM specific stuff.
89if defined(VBOX_ONLY_SDK) || "$(KBUILD_TARGET)" == "win"
90 OTHERS += \
91 $(VBOX_IDL_FILE.MSCOM) \
92 $(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h \
93 $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox.tlb \
94 $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox_i.c
95 OTHER_CLEAN += \
96 $(VBOX_IDL_FILE.MSCOM) \
97 $(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h \
98 $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox.tlb \
99 $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox_i.c \
100 $(PATH_VBoxCOM)/VirtualBox.h \
101 $(PATH_VBoxCOM)/VirtualBox_i.c \
102 $(PATH_VBoxCOM)/VirtualBox.tlb
103 VBOX_MAIN_PREREQS += $(PATH_VBoxCOM)/VirtualBox_i.c
104 BLDDIRS += $(VBOX_PATH_SDK)/bindings/mscom/idl
105endif
106
107# The XPCOM specific stuff.
108if defined(VBOX_ONLY_SDK) || "$(KBUILD_TARGET)" != "win"
109 OTHERS += $(VBOX_IDL_FILE.XPCOM) $(VBOX_IDL_TYPELIB.XPCOM) $(VBOX_IDL_HEADER.XPCOM)
110 OTHER_CLEAN += \
111 $(VBOX_IDL_FILE.XPCOM) \
112 $(VBOX_IDL_HEADER.XPCOM) \
113 $(VBOX_IDL_TYPELIB.XPCOM)
114
115 VBOX_MAIN_PREREQS += $(VBOX_IDL_TYPELIB.XPCOM) $(VBOX_IDL_HEADER.XPCOM)
116 BLDDIRS += $(VBOX_PATH_SDK)/bindings/xpcom/idl
117endif # xpcom
118
119
120#
121# The Main API documentation
122#
123VBOX_MAIN_DOC_DIR = $(VBOX_PATH_SDK)/docs
124BLDDIRS += $(VBOX_MAIN_DOC_DIR)
125
126docs: $(PATH_TARGET)/docs.Main
127
128$(PATH_TARGET)/docs.Main: \
129 $(VBOX_PATH_MAIN_SRC)/Doxyfile.Main \
130 $(VBOX_PATH_MAIN_SRC)/idl/doxygen.xsl \
131 $(VBOX_PATH_MAIN_SRC)/idl/VirtualBox.xidl \
132 | $(PATH_TARGET)/ \
133 $(VBOX_MAIN_DOC_DIR)/
134 $(RM) -f $(wildcard $(VBOX_MAIN_DOC_DIR)/html/*) $(PATH_TARGET)/docs.Main
135 $(VBOX_XSLTPROC) -o $(PATH_TARGET)/VirtualBox.idl $(VBOX_PATH_MAIN_SRC)/idl/doxygen.xsl $(VBOX_PATH_MAIN_SRC)/idl/VirtualBox.xidl
136 $(REDIRECT) -E 'DOCDIR=$(VBOX_MAIN_DOC_DIR)' -E 'PATH_TARGET=$(PATH_TARGET)' -E 'PATH_CHM=$(subst /,\,$(VBOX_MAIN_DOC_DIR)/VirtualBoxAPI.chm)' \
137 -- doxygen $(VBOX_PATH_MAIN_SRC)/Doxyfile.Main
138 -$(EXEC_X86_WIN32) $(VBOX_PATH_HTML_HELP_WORKSHOP)/hhc.exe $(subst /,\\,$(VBOX_MAIN_DOC_DIR)/html/index.hhp)
139 $(APPEND) $(PATH_TARGET)/docs.Main
140
141
142#
143# Some SDK bit.
144#
145INSTALLS += VBox-main-xidl
146VBox-main-xidl_INST = $(INST_SDK)bindings/
147VBox-main-xidl_SOURCES = idl/VirtualBox.xidl
148
149
150ifndef VBOX_ONLY_SDK # Note this goes on for *very* long
151
152#
153# Generate SchemaDefs.h and SchemaDefs.cpp from XML Schema
154# These two files are used by both VBoxC and VBoxSVC.
155#
156BLDDIRS += $(PATH_TARGET)/Main
157VBOX_XML_SCHEMADEFS_H = $(PATH_TARGET)/Main/SchemaDefs.h
158VBOX_XML_SCHEMADEFS_CPP = $(PATH_TARGET)/Main/SchemaDefs.cpp
159VBOX_XML_SCHEMADEFS_XSL = $(VBOX_PATH_MAIN_SRC)/xml/SchemaDefs.xsl
160
161OTHER_CLEAN += $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP)
162
163$(VBOX_XML_SCHEMADEFS_H): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(KBUILD_TARGET)) $(VBOX_XML_SCHEMA_COMMON) | $$(dir $$@)
164 $(call MSG_GENERATE,SchemaDefs,$<,$@)
165 $(VBOX_XSLTPROC) --stringparam mode declare -o $@ $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(KBUILD_TARGET))
166
167$(VBOX_XML_SCHEMADEFS_CPP): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(KBUILD_TARGET)) $(VBOX_XML_SCHEMA_COMMON) | $$(dir $$@)
168 $(call MSG_GENERATE,SchemaDefs,$<,$@)
169 $(VBOX_XSLTPROC) --stringparam mode define -o $@ $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(KBUILD_TARGET))
170
171testschemadefs: $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP)
172
173
174#
175# VBoxSVC executable
176#
177PROGRAMS += VBoxSVC
178VBoxSVC_TEMPLATE = VBOXMAINEXE
179VBoxSVC_DEFS = \
180 VBOX_MAIN_SETTINGS_ADDONS \
181 $(VBOX_MAIN_DEFS) \
182 $(if $(VBOX_WITH_VRDP),VBOX_WITH_VRDP,) \
183 $(if $(VBOX_WITH_HEADLESS),VBOX_WITH_HEADLESS,) \
184 $(if $(VBOX_WITH_QTGUI),VBOX_WITH_QTGUI,) \
185 $(if $(VBOX_WITH_QT4GUI),VBOX_WITH_QT4GUI,) \
186 $(if $(VBOX_WITH_HGCM),VBOX_WITH_HGCM,) \
187 $(if $(VBOX_MAIN_RELEASE_LOG),VBOX_MAIN_RELEASE_LOG LOG_ENABLED,) \
188 $(if $(VBOX_WITH_ALSA),VBOX_WITH_ALSA,) \
189 $(if $(VBOX_WITH_PULSE),VBOX_WITH_PULSE,) \
190 $(if $(VBOX_WITH_WINMM),VBOX_WITH_WINMM,) \
191 $(if $(VBOX_WITH_E1000),VBOX_WITH_E1000,) \
192 $(if $(VBOX_WITH_AHCI),VBOX_WITH_AHCI,) \
193 $(if $(VBOX_WITHOUT_LINUX_COMPILER_H),VBOX_WITHOUT_LINUX_COMPILER_H,) \
194 $(if $(VBOX_WITH_RESOURCE_USAGE_API),VBOX_WITH_RESOURCE_USAGE_API,) \
195 $(if $(VBOX_WITH_PDM_ASYNC_COMPLETION),VBOX_WITH_PDM_ASYNC_COMPLETION,)
196
197ifdef VBOX_WITH_USB
198 VBoxSVC_DEFS += \
199 VBOX_WITH_USB \
200 $(if $(VBOX_WITH_EHCI),VBOX_WITH_EHCI,) \
201 $(if $(VBOX_WITH_NEW_USB_CODE_ON_DARWIN),VBOX_WITH_NEW_USB_CODE_ON_DARWIN,)
202endif
203
204
205VBoxSVC_DEFS.win += VBOX_COM_OUTOFPROC_MODULE
206VBoxSVC_DEFS.win.x86 += _WIN32_WINNT=0x0500
207VBoxSVC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
208VBoxSVC_DEFS.linux += VBOX_USE_LIBHAL
209VBoxSVC_DEFS.solaris += VBOX_USE_LIBHAL
210
211VBoxSVC_INCS = \
212 include \
213 $(PATH_VBoxSVC) \
214 $(dir $(VBOX_XML_SCHEMADEFS_H)) \
215 .
216VBoxSVC_INCS.win = \
217 $(PATH_VBoxCOM)
218ifdef VBOX_WITH_USB
219 VBoxSVC_INCS.os2 = \
220 $(PATH_ROOT)/src/VBox/HostDrivers/VBoxUSB/os2
221endif
222
223VBoxSVC_LIBS += \
224 $(LIB_DDU) \
225 $(LIB_SETTINGS)
226VBoxSVC_LIBS.darwin = \
227 $(LIB_VMM) \
228 $(LIB_REM)
229VBoxSVC_LIBS.solaris = \
230 adm
231ifdef VBOX_WITH_NETFLT
232 VBoxSVC_LIBS.solaris += \
233 socket
234endif
235ifdef VBOX_WITH_USB
236 VBoxSVC_LIBS.solaris += \
237 devinfo
238endif
239
240VBoxSVC_INTERMEDIATES = \
241 $(VBOX_MAIN_PREREQS) \
242 $(VBOX_XML_SCHEMADEFS_H)
243
244VBoxSVC_SOURCES = \
245 Global.cpp \
246 Logging.cpp \
247 AutoLock.cpp \
248 Matching.cpp \
249 VirtualBoxBase.cpp \
250 VirtualBoxErrorInfoImpl.cpp \
251 VirtualBoxImpl.cpp \
252 VirtualBoxImplExtra.cpp \
253 MachineImpl.cpp \
254 SnapshotImpl.cpp \
255 HardDiskImpl.cpp \
256 HardDiskAttachmentImpl.cpp \
257 ProgressImpl.cpp \
258 DVDDriveImpl.cpp \
259 DVDImageImpl.cpp \
260 FloppyDriveImpl.cpp \
261 FloppyImageImpl.cpp \
262 HostImpl.cpp \
263 HostDVDDriveImpl.cpp \
264 HostFloppyDriveImpl.cpp \
265 HostNetworkInterfaceImpl.cpp \
266 GuestOSTypeImpl.cpp \
267 NetworkAdapterImpl.cpp \
268 SerialPortImpl.cpp \
269 ParallelPortImpl.cpp \
270 USBControllerImpl.cpp \
271 SATAControllerImpl.cpp \
272 AudioAdapterImpl.cpp \
273 SharedFolderImpl.cpp \
274 SystemPropertiesImpl.cpp \
275 BIOSSettingsImpl.cpp \
276 Version.cpp \
277 $(if $(VBOX_WITH_VRDP),VRDPServerImpl.cpp,) \
278 $(if $(VBOX_WITH_XPCOM),xpcom/server.cpp,) \
279 $(VBOX_XML_SCHEMADEFS_CPP)
280
281VBoxSVC_SOURCES.darwin = \
282 darwin/iokit.cpp
283
284VBoxSVC_SOURCES.win = \
285 win/svcmain.cpp \
286 win/svchlp.cpp \
287 win/VBoxSVC.rc
288
289VBoxSVC_SOURCES.linux = \
290 linux/vbox-libhal.cpp
291
292VBoxSVC_SOURCES.solaris = \
293 linux/vbox-libhal.cpp
294
295ifdef VBOX_WITH_USB
296 VBoxSVC_SOURCES += \
297 USBDeviceFilterImpl.cpp \
298 USBProxyService.cpp \
299 HostUSBDeviceImpl.cpp
300 VBoxSVC_SOURCES.darwin += darwin/USBProxyServiceDarwin.cpp
301 VBoxSVC_SOURCES.linux += linux/USBProxyServiceLinux.cpp
302 VBoxSVC_SOURCES.os2 += os2/USBProxyServiceOs2.cpp
303 VBoxSVC_SOURCES.solaris += solaris/USBProxyServiceSolaris.cpp
304 VBoxSVC_SOURCES.win += win/USBProxyServiceWindows.cpp
305endif
306
307VBoxSVC_LDFLAGS.darwin = -framework IOKit -framework SystemConfiguration
308ifeq ($(KBUILD_TYPE),debug)
309 VBoxSVC_LDFLAGS.linux += -rdynamic # for backtrace_symbols()
310endif
311
312ifdef VBOX_WITH_RESOURCE_USAGE_API
313 VBoxSVC_SOURCES += \
314 PerformanceImpl.cpp \
315 Performance.cpp
316 VBoxSVC_SOURCES.darwin += darwin/PerformanceDarwin.cpp
317 VBoxSVC_SOURCES.linux += linux/PerformanceLinux.cpp
318 VBoxSVC_SOURCES.os2 += os2/PerformanceOs2.cpp
319 VBoxSVC_SOURCES.solaris += solaris/PerformanceSolaris.cpp
320 VBoxSVC_SOURCES.win += win/PerformanceWin.cpp
321 VBoxSVC_LDFLAGS.darwin += -lproc
322 VBoxSVC_LDFLAGS.solaris += -lkstat
323 VBoxSVC_LDFLAGS.win += psapi.lib powrprof.lib
324endif
325
326win/VBoxSVC.rc_INCS = $(PATH_VBoxSVC)
327win/VBoxSVC.rc_DEPS = $(PATH_VBoxSVC)/VBoxSVC.rgs $(PATH_VBoxSVC)/VBoxSVC-icon.rc
328win/VBoxSVC.rc_CLEAN = $(PATH_VBoxSVC)/VBoxSVC.rgs $(PATH_VBoxSVC)/VBoxSVC-icon.rc
329
330$$(PATH_VBoxSVC)/VBoxSVC-icon.rc: $(MAKEFILE_CURRENT) $(VBOX_WINDOWS_ICON_FILE) | $$(dir $$(@D))
331 $(APPEND) -t $@ '1 ICON DISCARDABLE "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
332
333$$(PATH_VBoxSVC)/VBoxSVC.rgs: $(VBOX_PATH_MAIN_SRC)/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(dir $$(@D))
334 $(VBOX_XSLTPROC) --stringparam Module VBoxSVC -o $@ $< $(VBOX_XIDL_FILE)
335
336#
337# Embed XML Schema files to VBoxSVC
338#
339VBOX_XML_SCHEMA_COMMON = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-common.xsd
340VBOX_XML_SCHEMA.darwin = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-macosx.xsd
341VBOX_XML_SCHEMA.linux = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-linux.xsd
342VBOX_XML_SCHEMA.freebsd = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-freebsd.xsd
343VBOX_XML_SCHEMA.win = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-windows.xsd
344VBOX_XML_SCHEMA.os2 = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-os2.xsd
345VBOX_XML_SCHEMA.solaris = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-solaris.xsd
346
347VBOX_XML_CONVERTER_TEMPLATE = $(VBOX_PATH_MAIN_SRC)/xml/SettingsConverter.xsl
348
349$$(PATH_VBoxSVC)/xml_VirtualBox_settings_xsd.h: $(VBOX_XML_SCHEMA.$(KBUILD_TARGET)) $(VBOX_BIN2C)
350 $(call MSG_TOOL,bin2c,VBoxSVC,$<,$@)
351 $(QUIET)$(VBOX_BIN2C) _xml_VirtualBox_settings_xsd $< $@
352
353$$(PATH_VBoxSVC)/xml_VirtualBox_settings_common_xsd.h: $(VBOX_XML_SCHEMA_COMMON) $(VBOX_BIN2C)
354 $(call MSG_TOOL,bin2c,VBoxSVC,$<,$@)
355 $(QUIET)$(VBOX_BIN2C) _xml_VirtualBox_settings_common_xsd $< $@
356
357$$(PATH_VBoxSVC)/xml_SettingsConverter_xsl.h: $(VBOX_XML_CONVERTER_TEMPLATE) $(VBOX_BIN2C)
358 $(call MSG_TOOL,bin2c,VBoxSVC,$<,$@)
359 $(QUIET)$(VBOX_BIN2C) _xml_SettingsConverter_xsl $< $@
360
361VirtualBoxImplExtra.cpp_DEPS = \
362 $(PATH_VBoxSVC)/xml_VirtualBox_settings_xsd.h \
363 $(PATH_VBoxSVC)/xml_VirtualBox_settings_common_xsd.h \
364 $(PATH_VBoxSVC)/xml_SettingsConverter_xsl.h
365VBoxSVC_CLEAN += $(VirtualBoxImplExtra.cpp_DEPS)
366
367
368
369ifdef VBOX_WITH_XPCOM
370#
371# VBoxSVCM - VBoxSVC wrapper module
372#
373DLLS += VBoxSVCM
374VBoxSVCM_TEMPLATE = VBOXMAINCOMP
375VBoxSVCM_DEFS = IN_RING3 $(VBOX_MAIN_DEFS)
376VBoxSVCM_INCS = \
377 include \
378 $(PATH_VBoxC) \
379 .
380VBoxSVCM_INTERMEDIATES = $(VBOX_MAIN_PREREQS)
381VBoxSVCM_SOURCES = \
382 xpcom/server_module.cpp
383VBoxSVCM_LDFLAGS.darwin = \
384 -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxSVCM.dylib \
385 -exported_symbols_list $(PATH_VBoxSVCM)/VBoxSVCM.def
386 ifeq ($(KBUILD_TARGET),darwin)
387VBoxSVCM_ORDERDEPS += $(PATH_VBoxSVCM)/VBoxSVCM.def
388VBoxSVCM_CLEAN += $(PATH_VBoxSVCM)/VBoxSVCM.def
389$$(PATH_VBoxSVCM)/VBoxSVCM.def:
390 $(RM) -f $@
391 $(APPEND) $@ _NSGetModule
392 endif
393VBoxSVCM_INTERMEDIATES += $(VBOX_IDL_HEADER.XPCOM)
394
395endif # VBOX_WITH_XPCOM
396
397
398#
399# VBoxC module
400#
401DLLS += VBoxC
402VBoxC_TEMPLATE = VBOXMAINCOMP
403VBoxC_DEFS = \
404 IN_RING3 \
405 $(VBOX_MAIN_DEFS) \
406 VBOX_COM_INPROC \
407 $(if $(VBOX_WITH_VRDP),VBOX_WITH_VRDP,) \
408 $(if $(VBOX_WITH_HGCM),VBOX_WITH_HGCM,) \
409 $(if $(VBOX_MAIN_RELEASE_LOG),VBOX_MAIN_RELEASE_LOG LOG_ENABLED,) \
410 $(if $(VBOX_WITH_ALSA),VBOX_WITH_ALSA,) \
411 $(if $(VBOX_WITH_PULSE),VBOX_WITH_PULSE,) \
412 $(if $(VBOX_WITH_WINMM),VBOX_WITH_WINMM,) \
413 $(if $(VBOX_WITH_CROSSBOW),VBOX_WITH_CROSSBOW,) \
414 $(if $(VBOX_WITH_E1000),VBOX_WITH_E1000,) \
415 $(if $(VBOX_WITH_PDM_ASYNC_COMPLETION),VBOX_WITH_PDM_ASYNC_COMPLETION,)
416
417ifdef VBOX_WITH_USB
418VBoxC_DEFS += \
419 VBOX_WITH_USB \
420 $(if $(VBOX_WITH_EHCI),VBOX_WITH_EHCI,)
421endif
422
423VBoxC_DEFS.win.x86 += _WIN32_WINNT=0x0500
424VBoxC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
425
426VBoxC_INCS = \
427 include \
428 $(PATH_VBoxC) \
429 $(dir $(VBOX_XML_SCHEMADEFS_H))
430VBoxC_INCS.win = \
431 $(PATH_VBoxCOM) \
432 .
433
434VBoxC_LDFLAGS.darwin = \
435 -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxC.dylib \
436 -exported_symbols_list $(PATH_VBoxC)/VBoxC.def
437ifdef VBOX_USE_VCC80
438 VBoxC_LDFLAGS.win = /MANIFEST
439endif
440
441VBoxC_LIBS += \
442 $(LIB_VMM) \
443 $(LIB_REM)
444
445VBoxC_INTERMEDIATES = \
446 $(VBOX_MAIN_PREREQS) \
447 $(VBOX_XML_SCHEMADEFS_H)
448
449VBoxC_SOURCES = \
450 Global.cpp \
451 Logging.cpp \
452 AutoLock.cpp \
453 VBoxDll.cpp \
454 Version.cpp \
455 USBDeviceImpl.cpp \
456 RemoteUSBDeviceImpl.cpp \
457 VirtualBoxBase.cpp \
458 VirtualBoxErrorInfoImpl.cpp \
459 ProgressImpl.cpp \
460 SharedFolderImpl.cpp \
461 SessionImpl.cpp \
462 ConsoleImpl.cpp \
463 ConsoleImpl2.cpp \
464 ConsoleVRDPServer.cpp \
465 GuestImpl.cpp \
466 KeyboardImpl.cpp \
467 MouseImpl.cpp \
468 DisplayImpl.cpp \
469 FramebufferImpl.cpp \
470 MachineDebuggerImpl.cpp \
471 VBoxDriversRegister.cpp \
472 AudioSnifferInterface.cpp \
473 VMMDevInterface.cpp \
474 $(VBOX_XML_SCHEMADEFS_CPP)
475VBoxC_SOURCES.win = \
476 win/dllmain.cpp \
477 win/VBoxC.def \
478 win/VBoxC.rc
479
480ifdef VBOX_WITH_XPCOM
481VBoxC_SOURCES += \
482 xpcom/module.cpp
483endif
484
485ifdef VBOX_WITH_HGCM
486VBoxC_SOURCES += \
487 hgcm/HGCMObjects.cpp \
488 hgcm/HGCMThread.cpp \
489 hgcm/HGCM.cpp
490endif
491
492ifdef VBOX_WITH_USB
493VBoxC_SOURCES += \
494 RemoteUSBBackend.cpp
495endif
496
497ifeq ($(KBUILD_TARGET),darwin)
498VBoxC_ORDERDEPS += $(PATH_VBoxC)/VBoxC.def
499VBoxC_CLEAN += $(PATH_VBoxC)/VBoxC.def
500$$(PATH_VBoxC)/VBoxC.def: $(MAKEFILE_CURRENT)
501 $(RM) -f $@
502 $(APPEND) $@ _NSGetModule
503 $(APPEND) $@ _VBoxDriversRegister
504endif
505
506ConsoleImpl.cpp_DEFS = \
507 VBOX_BUILD_TARGET=\"$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)\"
508
509
510Version.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
511Version.cpp_DEPS = $(VBOX_SVN_REV_KMK)
512
513win/VBoxC.rc_DEPS = $(PATH_VBoxC)/VBoxC.rgs $(PATH_VBoxCOM)/VirtualBox.tlb
514VBoxC_CLEAN.win += $(PATH_VBoxC)/VBoxC.rgs
515
516$$(PATH_VBoxC)/VBoxC.rgs: $(VBOX_PATH_MAIN_SRC)/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(PATH_VBoxC)/
517 $(VBOX_XSLTPROC) --stringparam Module VBoxC -o $@ $< $(VBOX_XIDL_FILE)
518
519
520#
521# VBoxSettings
522#
523DLLS += VBoxSettings
524VBoxSettings_TEMPLATE = VBOXMAINDLL
525VBoxSettings_NAME = $(basename $(notdir $(LIB_SETTINGS)))
526VBoxSettings_SDKS = VBOX_LIBXSLT VBOX_LIBXML2 VBOX_ZLIB
527VBoxSettings_DEFS = IN_VBOXSETTINGS_R3
528VBoxSettings_INCS = \
529 include
530VBoxSettings_SOURCES = \
531 xml/Settings.cpp
532VBoxSettings_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/$(notdir $(LIB_SETTINGS)) -Wl,-x # no debug info please.
533
534
535#
536# VBoxCOM - COM Abstraction Layer library
537#
538LIBRARIES += VBoxCOM
539VBoxCOM_TEMPLATE = VBOXMAINLIB
540VBoxCOM_INTERMEDIATES = $(VBOX_MAIN_PREREQS)
541VBoxCOM_SOURCES = \
542 glue/com.cpp \
543 glue/initterm.cpp \
544 glue/string.cpp \
545 glue/EventQueue.cpp \
546 glue/ErrorInfo.cpp
547ifeq ($(KBUILD_TARGET),win)
548 VBoxCOM_DEFS.x86 += _WIN32_WINNT=0x0500
549 VBoxCOM_DEFS.amd64 += _WIN32_WINNT=0x0510
550 VBoxCOM_SOURCES += \
551 $(PATH_VBoxCOM)/VirtualBox_i.c
552else # !win
553 VBoxCOM_INCS += \
554 include
555 VBoxCOM_SOURCES += \
556 xpcom/helpers.cpp
557endif # !win
558
559
560endif # !VBOX_ONLY_SDK (the ifndef is far above)
561
562
563#
564# Installs com related thing(s) to bin.
565#
566INSTALLS.win += VBoxMain-com-inst
567VBoxMain-com-inst_INST = $(INST_BIN)
568VBoxMain-com-inst_SOURCES = \
569 win/comregister.cmd
570
571
572# generate rules
573include $(KBUILD_PATH)/subfooter.kmk
574
575
576
577#
578# Additions rules.
579#
580
581VBOX_XIDL_FILE = $(VBOX_PATH_MAIN_SRC)/idl/VirtualBox.xidl
582
583## @todo this hack ain't cutting it any longer. (the file name is abspath'ed since ages now.)
584xpcom/helpers.cpp: $(VBOX_IDL_TYPELIB.XPCOM)
585
586$(VBOX_IDL_FILE.XPCOM): $(VBOX_PATH_MAIN_SRC)/idl/xpidl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
587 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
588 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
589
590$(VBOX_IDL_TYPELIB.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
591 $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
592 $(QUIET)$(VBOX_XPIDL) -m typelib -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
593 chmod 0644 $@
594## @todo ^^^^^^^^^^^^ fix horrible hack
595
596$(VBOX_IDL_HEADER.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
597 $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
598 $(QUIET)$(VBOX_XPIDL) -m header -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
599
600
601VBOX_MAIN_IDL ?= $(EXEC_X86_WIN32) $(call VBOX_FN_MAKE_WIN_PATH,$(firstword $(wildcard \
602 $(PATH_SDK_WINPSDK_BIN)/Midl.Exe\
603 $(PATH_SDK_WINPSDK)/Bin/Midl.Exe\
604 $(PATH_DEVTOOLS)/win.x86/bin/midl.exe\
605 ) Sorry_Cannot_Find_The_Midl_Compiler_In_The_PSDK))
606IDL_DEFS = /nologo
607ifdef VBOX_WITH_VRDP
608 IDL_DEFS += /D VBOX_WITH_VRDP
609endif
610
611$(VBOX_IDL_FILE.MSCOM): $(VBOX_PATH_MAIN_SRC)/idl/midl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
612 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
613 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
614
615
616# Aliases for testing purposes.
617ifdef VBOX_WITH_XPCOM
618testidl: $(VBOX_IDL_FILE.XPCOM) $(VBOX_IDL_TYPELIB.XPCOM)
619testidlhdr: $(VBOX_IDL_HEADER.XPCOM)
620else
621testidl: $(VBOX_IDL_FILE.MSCOM) $(PATH_VBoxCOM)/VirtualBox_i.c
622endif
623
624
625## @todo r=bird: last changes to this rule showed incorrect dependencies here as it broke testcase (see testboxwin2).
626# This is kind of obvious when looking at the rule, because it's (a) not specifing all it output
627# and (b) generating more stuff *after* the main target has been completed.
628#
629# What needs to be done is to not depend on _i.c in the object subdir, but on all the final outputs.
630$(PATH_VBoxCOM)/VirtualBox_i.c \
631+ $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox_i.c \
632+ $(PATH_VBoxCOM)/VirtualBox.h \
633+ $(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h \
634+ $(PATH_VBoxCOM)/VirtualBox.tlb \
635+ $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox.tlb: $(VBOX_IDL_FILE.MSCOM) | $(call DIRDEP,$(PATH_VBoxCOM))
636 $(VBOX_MAIN_IDL) $(IDL_DEFS) \
637 /out $(call VBOX_FN_MAKE_WIN_PATH,$(PATH_VBoxCOM)) \
638 /cpp_cmd $(subst $(EXEC_X86_WIN32),,$(call VBOX_FN_MAKE_WIN_PATH,$(TOOL_$(VBOX_VCC_TOOL)_CC))) \
639 /I $(call VBOX_FN_MAKE_WIN_PATH,$(PATH_SDK_WINPSDK_INC)) \
640 /I idl \
641 $(call VBOX_FN_MAKE_WIN_PATH,$<)
642 $(MKDIR) -p $(VBOX_PATH_SDK)/bindings/mscom/include
643 $(CP) $(PATH_VBoxCOM)/VirtualBox.h $(VBOX_PATH_SDK)/bindings/mscom/include
644 $(MKDIR) -p $(VBOX_PATH_SDK)/bindings/mscom/lib
645 $(CP) $(PATH_VBoxCOM)/VirtualBox.tlb $(VBOX_PATH_SDK)/bindings/mscom/lib
646 $(CP) $(PATH_VBoxCOM)/VirtualBox_i.c $(VBOX_PATH_SDK)/bindings/mscom/lib
647
648#
649# Translation stuff
650#
651VBoxSVC_VBOX_HEADERS = \
652 include/collection.h \
653 include/MachineImpl.h \
654 include/HostDVDDriveImpl.h \
655 include/HostFloppyDriveImpl.h
656VBoxSVC_VBOX_TRANSLATIONS = \
657 nls/VBoxSVC_de.ts
658
659VBoxC_VBOX_HEADERS = \
660 include/ConsoleImpl.h
661VBoxC_VBOX_TRANSLATIONS = \
662 nls/VBoxC_de.ts
663
664updatenls::
665 $(VBOX_LUPDATE) $(VBoxSVC_SOURCES) $(VBoxSVC_VBOX_HEADERS) -ts $(VBoxSVC_VBOX_TRANSLATIONS)
666 $(VBOX_LUPDATE) $(VBoxC_SOURCES) $(VBoxC_VBOX_HEADERS) -ts $(VBoxC_VBOX_TRANSLATIONS)
667
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