VirtualBox

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

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

#1869: Use the SCNetworkInterfaceCopyAll / SCNetworkInterfaceGetLocalizedDisplayName APIs for getting the correct interface name.

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