VirtualBox

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

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

added subversion revison to the IDL

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 19.8 KB
Line 
1# $Id: Makefile.kmk 12284 2008-09-09 10:26:27Z 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 += wbemuuid.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
416ifdef VBOX_WITH_USB
417VBoxC_DEFS += \
418 VBOX_WITH_USB \
419 $(if $(VBOX_WITH_EHCI),VBOX_WITH_EHCI,)
420endif
421
422VBoxC_DEFS.win.x86 += _WIN32_WINNT=0x0500
423VBoxC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
424
425VBoxC_INCS = \
426 include \
427 $(PATH_VBoxC) \
428 $(dir $(VBOX_XML_SCHEMADEFS_H))
429VBoxC_INCS.win = \
430 $(PATH_VBoxCOM) \
431 .
432
433VBoxC_LDFLAGS.darwin = \
434 -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxC.dylib \
435 -exported_symbols_list $(PATH_VBoxC)/VBoxC.def
436ifdef VBOX_USE_VCC80
437 VBoxC_LDFLAGS.win = /MANIFEST
438endif
439
440VBoxC_LIBS += \
441 $(LIB_VMM) \
442 $(LIB_REM)
443
444VBoxC_INTERMEDIATES = \
445 $(VBOX_MAIN_PREREQS) \
446 $(VBOX_XML_SCHEMADEFS_H)
447
448VBoxC_SOURCES = \
449 Global.cpp \
450 Logging.cpp \
451 AutoLock.cpp \
452 VBoxDll.cpp \
453 Version.cpp \
454 USBDeviceImpl.cpp \
455 RemoteUSBDeviceImpl.cpp \
456 VirtualBoxBase.cpp \
457 VirtualBoxErrorInfoImpl.cpp \
458 ProgressImpl.cpp \
459 SharedFolderImpl.cpp \
460 SessionImpl.cpp \
461 ConsoleImpl.cpp \
462 ConsoleImpl2.cpp \
463 ConsoleVRDPServer.cpp \
464 GuestImpl.cpp \
465 KeyboardImpl.cpp \
466 MouseImpl.cpp \
467 DisplayImpl.cpp \
468 FramebufferImpl.cpp \
469 MachineDebuggerImpl.cpp \
470 VBoxDriversRegister.cpp \
471 AudioSnifferInterface.cpp \
472 VMMDevInterface.cpp \
473 $(VBOX_XML_SCHEMADEFS_CPP)
474VBoxC_SOURCES.win = \
475 win/dllmain.cpp \
476 win/VBoxC.def \
477 win/VBoxC.rc
478
479ifdef VBOX_WITH_XPCOM
480VBoxC_SOURCES += \
481 xpcom/module.cpp
482endif
483
484ifdef VBOX_WITH_HGCM
485VBoxC_SOURCES += \
486 hgcm/HGCMObjects.cpp \
487 hgcm/HGCMThread.cpp \
488 hgcm/HGCM.cpp
489endif
490
491ifdef VBOX_WITH_USB
492VBoxC_SOURCES += \
493 RemoteUSBBackend.cpp
494endif
495
496ifeq ($(KBUILD_TARGET),darwin)
497VBoxC_ORDERDEPS += $(PATH_VBoxC)/VBoxC.def
498VBoxC_CLEAN += $(PATH_VBoxC)/VBoxC.def
499$$(PATH_VBoxC)/VBoxC.def: $(MAKEFILE_CURRENT)
500 $(RM) -f $@
501 $(APPEND) $@ _NSGetModule
502 $(APPEND) $@ _VBoxDriversRegister
503endif
504
505ConsoleImpl.cpp_DEFS = VBOX_BUILD_TARGET=\"$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)\"
506
507Version.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
508Version.cpp_DEPS = $(VBOX_SVN_REV_KMK)
509
510win/VBoxC.rc_DEPS = $(PATH_VBoxC)/VBoxC.rgs $(PATH_VBoxCOM)/VirtualBox.tlb
511VBoxC_CLEAN.win += $(PATH_VBoxC)/VBoxC.rgs
512
513$$(PATH_VBoxC)/VBoxC.rgs: $(VBOX_PATH_MAIN_SRC)/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(PATH_VBoxC)/
514 $(VBOX_XSLTPROC) --stringparam Module VBoxC -o $@ $< $(VBOX_XIDL_FILE)
515
516
517#
518# VBoxSettings
519#
520DLLS += VBoxSettings
521VBoxSettings_TEMPLATE = VBOXMAINDLL
522VBoxSettings_NAME = $(basename $(notdir $(LIB_SETTINGS)))
523VBoxSettings_SDKS = VBOX_LIBXSLT VBOX_LIBXML2 VBOX_ZLIB
524VBoxSettings_DEFS = IN_VBOXSETTINGS_R3
525VBoxSettings_INCS = \
526 include
527VBoxSettings_SOURCES = \
528 xml/Settings.cpp
529VBoxSettings_LDFLAGS.darwin = -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/$(notdir $(LIB_SETTINGS)) -Wl,-x # no debug info please.
530
531
532#
533# VBoxCOM - COM Abstraction Layer library
534#
535LIBRARIES += VBoxCOM
536VBoxCOM_TEMPLATE = VBOXMAINLIB
537VBoxCOM_INTERMEDIATES = $(VBOX_MAIN_PREREQS)
538VBoxCOM_SOURCES = \
539 glue/com.cpp \
540 glue/initterm.cpp \
541 glue/string.cpp \
542 glue/EventQueue.cpp \
543 glue/ErrorInfo.cpp
544ifeq ($(KBUILD_TARGET),win)
545 VBoxCOM_DEFS.x86 += _WIN32_WINNT=0x0500
546 VBoxCOM_DEFS.amd64 += _WIN32_WINNT=0x0510
547 VBoxCOM_SOURCES += \
548 $(PATH_VBoxCOM)/VirtualBox_i.c
549else # !win
550 VBoxCOM_INCS += \
551 include
552 VBoxCOM_SOURCES += \
553 xpcom/helpers.cpp
554endif # !win
555
556
557endif # !VBOX_ONLY_SDK (the ifndef is far above)
558
559
560#
561# Installs com related thing(s) to bin.
562#
563INSTALLS.win += VBoxMain-com-inst
564VBoxMain-com-inst_INST = $(INST_BIN)
565VBoxMain-com-inst_SOURCES = \
566 win/comregister.cmd
567
568
569# generate rules
570include $(KBUILD_PATH)/subfooter.kmk
571
572
573
574#
575# Additions rules.
576#
577
578VBOX_XIDL_FILE = $(VBOX_PATH_MAIN_SRC)/idl/VirtualBox.xidl
579
580## @todo this hack ain't cutting it any longer. (the file name is abspath'ed since ages now.)
581xpcom/helpers.cpp: $(VBOX_IDL_TYPELIB.XPCOM)
582
583$(VBOX_IDL_FILE.XPCOM): $(VBOX_PATH_MAIN_SRC)/idl/xpidl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
584 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
585 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
586
587$(VBOX_IDL_TYPELIB.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
588 $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
589 $(QUIET)$(VBOX_XPIDL) -m typelib -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
590 chmod 0644 $@
591## @todo ^^^^^^^^^^^^ fix horrible hack
592
593$(VBOX_IDL_HEADER.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
594 $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
595 $(QUIET)$(VBOX_XPIDL) -m header -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
596
597
598VBOX_MAIN_IDL ?= $(EXEC_X86_WIN32) $(call VBOX_FN_MAKE_WIN_PATH,$(firstword $(wildcard \
599 $(PATH_SDK_WINPSDK_BIN)/Midl.Exe\
600 $(PATH_SDK_WINPSDK)/Bin/Midl.Exe\
601 $(PATH_DEVTOOLS)/win.x86/bin/midl.exe\
602 ) Sorry_Cannot_Find_The_Midl_Compiler_In_The_PSDK))
603IDL_DEFS = /nologo
604ifdef VBOX_WITH_VRDP
605 IDL_DEFS += /D VBOX_WITH_VRDP
606endif
607
608$(VBOX_IDL_FILE.MSCOM): $(VBOX_PATH_MAIN_SRC)/idl/midl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
609 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
610 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
611
612
613# Aliases for testing purposes.
614ifdef VBOX_WITH_XPCOM
615testidl: $(VBOX_IDL_FILE.XPCOM) $(VBOX_IDL_TYPELIB.XPCOM)
616testidlhdr: $(VBOX_IDL_HEADER.XPCOM)
617else
618testidl: $(VBOX_IDL_FILE.MSCOM) $(PATH_VBoxCOM)/VirtualBox_i.c
619endif
620
621
622## @todo r=bird: last changes to this rule showed incorrect dependencies here as it broke testcase (see testboxwin2).
623# This is kind of obvious when looking at the rule, because it's (a) not specifing all it output
624# and (b) generating more stuff *after* the main target has been completed.
625#
626# What needs to be done is to not depend on _i.c in the object subdir, but on all the final outputs.
627$(PATH_VBoxCOM)/VirtualBox_i.c \
628+ $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox_i.c \
629+ $(PATH_VBoxCOM)/VirtualBox.h \
630+ $(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h \
631+ $(PATH_VBoxCOM)/VirtualBox.tlb \
632+ $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox.tlb: $(VBOX_IDL_FILE.MSCOM) | $(call DIRDEP,$(PATH_VBoxCOM))
633 $(VBOX_MAIN_IDL) $(IDL_DEFS) \
634 /out $(call VBOX_FN_MAKE_WIN_PATH,$(PATH_VBoxCOM)) \
635 /cpp_cmd $(subst $(EXEC_X86_WIN32),,$(call VBOX_FN_MAKE_WIN_PATH,$(TOOL_$(VBOX_VCC_TOOL)_CC))) \
636 /I $(call VBOX_FN_MAKE_WIN_PATH,$(PATH_SDK_WINPSDK_INC)) \
637 /I idl \
638 $(call VBOX_FN_MAKE_WIN_PATH,$<)
639 $(MKDIR) -p $(VBOX_PATH_SDK)/bindings/mscom/include
640 $(CP) $(PATH_VBoxCOM)/VirtualBox.h $(VBOX_PATH_SDK)/bindings/mscom/include
641 $(MKDIR) -p $(VBOX_PATH_SDK)/bindings/mscom/lib
642 $(CP) $(PATH_VBoxCOM)/VirtualBox.tlb $(VBOX_PATH_SDK)/bindings/mscom/lib
643 $(CP) $(PATH_VBoxCOM)/VirtualBox_i.c $(VBOX_PATH_SDK)/bindings/mscom/lib
644
645#
646# Translation stuff
647#
648VBoxSVC_VBOX_HEADERS = \
649 include/collection.h \
650 include/MachineImpl.h \
651 include/HostDVDDriveImpl.h \
652 include/HostFloppyDriveImpl.h
653VBoxSVC_VBOX_TRANSLATIONS = \
654 nls/VBoxSVC_de.ts
655
656VBoxC_VBOX_HEADERS = \
657 include/ConsoleImpl.h
658VBoxC_VBOX_TRANSLATIONS = \
659 nls/VBoxC_de.ts
660
661updatenls::
662 $(VBOX_LUPDATE) $(VBoxSVC_SOURCES) $(VBoxSVC_VBOX_HEADERS) -ts $(VBoxSVC_VBOX_TRANSLATIONS)
663 $(VBOX_LUPDATE) $(VBoxC_SOURCES) $(VBoxC_VBOX_HEADERS) -ts $(VBoxC_VBOX_TRANSLATIONS)
664
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