VirtualBox

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

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

Makefiles: fixed misbehaving 'docs' target in VBOX_SINGLE_MAKEFILE=1 mode, it was building the iprt docs and eating lot's of precious time when VBOX_WITH_ALL_DOXYGEN_TARGETS was unset.

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