VirtualBox

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

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

Stubs for all platforms. Implementation of host CPU load and RAM usage counters for Windows. Locking. Fixes.

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