VirtualBox

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

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

PerfAPI: Solaris implementation

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