VirtualBox

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

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