VirtualBox

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

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

Main: Host interface networking on Darwin.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 18.9 KB
Line 
1# $Id: Makefile.kmk 10898 2008-07-26 02:11:55Z 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.win += wbemuuid.lib
278endif
279
280VBoxSVC_LDFLAGS.darwin = -framework IOKit
281ifeq ($(KBUILD_TYPE),debug)
282VBoxSVC_LDFLAGS.linux += -rdynamic # for backtrace_symbols()
283endif
284
285win/VBoxSVC.rc_INCS = $(PATH_TARGET)
286win/VBoxSVC.rc_DEPS = $(PATH_TARGET)/VBoxSVC.rgs $(PATH_TARGET)/VBoxSVC-icon.rc
287win/VBoxSVC.rc_CLEAN = $(PATH_TARGET)/VBoxSVC-icon.rc
288
289$(PATH_TARGET)/VBoxSVC-icon.rc: $(MAKEFILE_CURRENT) $(VBOX_WINDOWS_ICON_FILE) | $$(call DIRDEP,$$(@D))
290 $(RM) -f $@
291 $(APPEND) $@ '1 ICON DISCARDABLE "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
292
293
294#
295# VBoxSVC wrapper module
296#
297ifdef VBOX_WITH_XPCOM
298
299VBoxSVCM_TEMPLATE = VBOXMAINDLL
300ifneq ($(KBUILD_TARGET),linux)
301VBoxSVCM_INST = $(INST_BIN)components/
302endif
303VBoxSVCM_DEFS = IN_RING3 $(VBOX_MAIN_DEFS)
304VBoxSVCM_INCS = \
305 include \
306 $(PATH_VBoxC) \
307 .
308VBoxSVCM_INTERMEDIATES = $(VBOX_MAIN_PREREQS)
309VBoxSVCM_SOURCES = \
310 xpcom/server_module.cpp
311ifdef VBOX_WITH_ORIGIN
312VBoxSVCM_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$$(VBOX_ORIGIN)/..'
313endif
314VBoxSVCM_LDFLAGS.darwin = \
315 -install_name @executable_path/components/VBoxSVCM.dylib \
316 -exported_symbols_list $(PATH_TARGET)/VBoxSVCM.def
317ifeq ($(KBUILD_TARGET),darwin)
318VBoxSVCM_ORDERDEPS += $(PATH_TARGET)/VBoxSVCM.def
319VBoxSVCM_CLEAN += $(PATH_TARGET)/VBoxSVCM.def
320$(PATH_TARGET)/VBoxSVCM.def:
321 $(RM) -f $@
322 $(APPEND) $@ _NSGetModule
323endif
324VBoxSVCM_INTERMEDIATES = $(IDLHEADER)
325
326endif # VBOX_WITH_XPCOM
327
328
329#
330# VBoxC module
331#
332VBoxC_TEMPLATE = VBOXMAINDLL
333ifneq ($(filter-out linux win,$(KBUILD_TARGET)),)
334VBoxC_INST = $(INST_BIN)components/
335endif
336
337VBoxC_DEFS = IN_RING3 $(VBOX_MAIN_DEFS)
338VBoxC_DEFS += VBOX_COM_INPROC
339
340ifdef VBOX_WITH_VRDP
341VBoxC_DEFS += VBOX_VRDP
342endif
343ifdef VBOX_WITH_HGCM
344VBoxC_DEFS += VBOX_HGCM
345endif
346ifdef VBOX_MAIN_RELEASE_LOG
347VBoxC_DEFS += VBOX_MAIN_RELEASE_LOG LOG_ENABLED
348endif
349ifdef VBOX_WITH_USB
350VBoxC_DEFS += VBOX_WITH_USB
351ifdef VBOX_WITH_EHCI
352VBoxC_DEFS += VBOX_WITH_EHCI
353endif
354endif
355ifdef VBOX_WITH_ALSA
356VBoxC_DEFS += VBOX_WITH_ALSA
357endif
358ifdef VBOX_WITH_PULSE
359VBoxC_DEFS += VBOX_WITH_PULSE
360endif
361ifdef VBOX_WITH_WINMM
362VBoxC_DEFS += VBOX_WITH_WINMM
363endif
364ifdef VBOX_WITH_CROSSBOW
365VBoxC_DEFS += VBOX_WITH_CROSSBOW
366endif
367ifdef VBOX_WITH_E1000
368VBoxC_DEFS += VBOX_WITH_E1000
369endif
370
371VBoxC_DEFS.win.x86 += _WIN32_WINNT=0x0500
372VBoxC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
373
374VBoxC_INCS = \
375 include \
376 $(PATH_VBoxC)
377VBoxC_INCS.win = \
378 $(PATH_VBoxCOM) \
379 .
380
381ifdef VBOX_WITH_ORIGIN
382VBoxC_LDFLAGS = '$(VBOX_GCC_RPATH_OPT)$$(VBOX_ORIGIN)/..'
383endif
384VBoxC_LDFLAGS.darwin = \
385 -install_name @executable_path/components/VBoxSVCM.dylib \
386 -exported_symbols_list $(PATH_TARGET)/VBoxC.def
387ifdef VBOX_USE_VCC80
388 VBoxC_LDFLAGS.win = /MANIFEST
389endif
390
391VBoxC_LIBS += \
392 $(LIB_VMM) \
393 $(LIB_REM)
394
395VBoxC_INTERMEDIATES = $(VBOX_MAIN_PREREQS)
396
397VBoxC_SOURCES = \
398 Global.cpp \
399 Logging.cpp \
400 AutoLock.cpp \
401 VBoxDll.cpp \
402 Version.cpp \
403 USBDeviceImpl.cpp \
404 RemoteUSBDeviceImpl.cpp \
405 VirtualBoxBase.cpp \
406 VirtualBoxErrorInfoImpl.cpp \
407 ProgressImpl.cpp \
408 SharedFolderImpl.cpp \
409 SessionImpl.cpp \
410 ConsoleImpl.cpp \
411 ConsoleImpl2.cpp \
412 ConsoleVRDPServer.cpp \
413 GuestImpl.cpp \
414 KeyboardImpl.cpp \
415 MouseImpl.cpp \
416 DisplayImpl.cpp \
417 FramebufferImpl.cpp \
418 MachineDebuggerImpl.cpp \
419 VBoxDriversRegister.cpp \
420 AudioSnifferInterface.cpp \
421 VMMDevInterface.cpp
422VBoxC_SOURCES.win = \
423 win/dllmain.cpp \
424 win/VBoxC.def \
425 win/VBoxC.rc
426ifdef VBOX_WITH_XPCOM
427VBoxC_SOURCES += \
428 xpcom/module.cpp
429endif
430
431ifdef VBOX_WITH_HGCM
432VBoxC_SOURCES += \
433 hgcm/HGCMObjects.cpp \
434 hgcm/HGCMThread.cpp \
435 hgcm/HGCM.cpp
436endif
437
438ifdef VBOX_WITH_USB
439VBoxC_SOURCES += \
440 RemoteUSBBackend.cpp
441endif
442
443ifeq ($(KBUILD_TARGET),darwin)
444VBoxC_ORDERDEPS += $(PATH_TARGET)/VBoxC.def
445VBoxC_CLEAN += $(PATH_TARGET)/VBoxC.def
446$(PATH_TARGET)/VBoxC.def: $(MAKEFILE_CURRENT)
447 $(RM) -f $@
448 $(APPEND) $@ _NSGetModule
449 $(APPEND) $@ _VBoxDriversRegister
450endif
451
452# Version.cpp uses VBOX_SVN_REV.
453Version.cpp_DEFS = VBOX_SVN_REV=$(VBOX_SVN_REV)
454Version.cpp_DEPS = $(VBOX_SVN_REV_KMK)
455
456ConsoleImpl.cpp_DEFS = VBOX_BUILD_TARGET=\"$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)\"
457
458win/VBoxC.rc_DEPS = $(PATH_TARGET)/VBoxC.rgs $(PATH_VBoxCOM)/VirtualBox.tlb
459
460
461#
462# VBoxSettings
463#
464VBoxSettings_TEMPLATE = VBOXMAINDLL
465VBoxSettings_NAME = $(basename $(notdir $(LIB_SETTINGS)))
466VBoxSettings_SDKS = VBOX_LIBXSLT VBOX_LIBXML2 VBOX_ZLIB
467VBoxSettings_DEFS = IN_VBOXSETTINGS_R3
468VBoxSettings_INCS = \
469 include \
470 $(PATH_TARGET)
471VBoxSettings_SOURCES = \
472 xml/Settings.cpp
473VBoxSettings_LDFLAGS.darwin = -install_name @executable_path/$(notdir $(LIB_SETTINGS)) -Wl,-x # no debug info please.
474
475
476#
477# VBoxCOM - COM Abstraction Layer library
478#
479VBoxCOM_TEMPLATE = VBOXMAINLIB
480VBoxCOM_INTERMEDIATES = $(VBOX_MAIN_PREREQS)
481VBoxCOM_SOURCES = \
482 glue/com.cpp \
483 glue/initterm.cpp \
484 glue/string.cpp \
485 glue/EventQueue.cpp \
486 glue/ErrorInfo.cpp
487ifeq ($(KBUILD_TARGET),win)
488 VBoxCOM_DEFS.x86 += _WIN32_WINNT=0x0500
489 VBoxCOM_DEFS.amd64 += _WIN32_WINNT=0x0510
490 VBoxCOM_SOURCES += \
491 $(PATH_VBoxCOM)/VirtualBox_i.c
492else
493 VBoxCOM_INCS += \
494 include
495 VBoxCOM_SOURCES += \
496 xpcom/helpers.cpp
497endif
498
499
500#
501# Embed XML Schema files to VBoxSVC
502#
503VBOX_XML_SCHEMA_H = $(PATH_TARGET)/xml_VirtualBox_settings_xsd.h
504VBOX_XML_SCHEMA_COMMON_H = $(PATH_TARGET)/xml_VirtualBox_settings_common_xsd.h
505VBOX_XML_CONVERTER_TEMPLATE_H = $(PATH_TARGET)/xml_SettingsConverter_xsl.h
506
507VBOX_XML_SCHEMA_COMMON = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-common.xsd
508VBOX_XML_SCHEMA.darwin = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-macosx.xsd
509VBOX_XML_SCHEMA.linux = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-linux.xsd
510VBOX_XML_SCHEMA.freebsd = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-freebsd.xsd
511VBOX_XML_SCHEMA.win = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-windows.xsd
512VBOX_XML_SCHEMA.os2 = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-os2.xsd
513VBOX_XML_SCHEMA.solaris = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-solaris.xsd
514
515VBOX_XML_CONVERTER_TEMPLATE = $(VBOX_PATH_MAIN_SRC)/xml/SettingsConverter.xsl
516
517VirtualBoxImplExtra.cpp_DEPS = \
518 $(VBOX_XML_SCHEMA_H) $(VBOX_XML_SCHEMA_COMMON_H) $(VBOX_XML_CONVERTER_TEMPLATE_H)
519
520$(VBOX_XML_SCHEMA_H): $(VBOX_XML_SCHEMA.$(KBUILD_TARGET)) $(VBOX_BIN2C)
521 $(call MSG_TOOL,bin2c,VBoxSVC,$<,$@)
522 $(QUIET)$(VBOX_BIN2C) _xml_VirtualBox_settings_xsd $< $@
523
524$(VBOX_XML_SCHEMA_COMMON_H): $(VBOX_XML_SCHEMA_COMMON) $(VBOX_BIN2C)
525 $(call MSG_TOOL,bin2c,VBoxSVC,$<,$@)
526 $(QUIET)$(VBOX_BIN2C) _xml_VirtualBox_settings_common_xsd $< $@
527
528$(VBOX_XML_CONVERTER_TEMPLATE_H): $(VBOX_XML_CONVERTER_TEMPLATE) $(VBOX_BIN2C)
529 $(call MSG_TOOL,bin2c,VBoxSVC,$<,$@)
530 $(QUIET)$(VBOX_BIN2C) _xml_SettingsConverter_xsl $< $@
531
532OTHER_CLEAN += \
533 $(VBOX_XML_SCHEMA_H) $(VBOX_XML_SCHEMA_COMMON_H) $(VBOX_XML_CONVERTER_TEMPLATE_H)
534
535
536#
537# Generate SchemaDefs.h and SchemaDefs.cpp from XML Schema
538#
539VBOX_XML_SCHEMADEFS_H = $(PATH_TARGET)/SchemaDefs.h
540VBOX_XML_SCHEMADEFS_CPP = $(PATH_TARGET)/SchemaDefs.cpp
541VBOX_XML_SCHEMADEFS_XSL = $(VBOX_PATH_MAIN_SRC)/xml/SchemaDefs.xsl
542
543VBoxC_INTERMEDIATES += $(VBOX_XML_SCHEMADEFS_H)
544VBoxC_INCS += $(PATH_TARGET)
545VBoxC_SOURCES += $(VBOX_XML_SCHEMADEFS_CPP)
546
547VBoxSVC_INTERMEDIATES += $(VBOX_XML_SCHEMADEFS_H)
548VBoxSVC_INCS += $(PATH_TARGET)
549VBoxSVC_SOURCES += $(VBOX_XML_SCHEMADEFS_CPP)
550
551OTHER_CLEAN += $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP)
552
553$(VBOX_XML_SCHEMADEFS_H): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(KBUILD_TARGET)) $(VBOX_XML_SCHEMA_COMMON)
554 $(call MSG_TOOL,xsltproc,SchemaDefs,$<,$@)
555 $(QUIET)$(VBOX_XSLTPROC) --stringparam mode declare -o $@ $(filter-out $(VBOX_XML_SCHEMA_COMMON),$^)
556
557$(VBOX_XML_SCHEMADEFS_CPP): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(KBUILD_TARGET)) $(VBOX_XML_SCHEMA_COMMON)
558 $(call MSG_TOOL,xsltproc,SchemaDefs,$<,$@)
559 $(QUIET)$(VBOX_XSLTPROC) --stringparam mode define -o $@ $(filter-out $(VBOX_XML_SCHEMA_COMMON),$^)
560
561
562#
563# Creates the symlinks necessary for making XPCOM work.
564#
565## @todo Figure out why Linux really needs this, darwin doesn't...
566
567xpcom-components_INST = $(INST_BIN)components/
568ifeq ($(KBUILD_TARGET),linux)
569xpcom-components_SYMLINKS = \
570 VirtualBox_XPCOM.xpt=>../VirtualBox_XPCOM.xpt \
571 VBoxXPCOMBase.xpt=>../VBoxXPCOMBase.xpt \
572 VBoxC$(SUFF_DLL)=>../VBoxC$(SUFF_DLL) \
573 VBoxSVCM$(SUFF_DLL)=>../VBoxSVCM$(SUFF_DLL) \
574 VBoxXPCOMIPCC$(SUFF_DLL)=>../VBoxXPCOMIPCC$(SUFF_DLL)
575endif
576
577
578#
579# Installs com related thing(s) to bin.
580#
581VBoxMain-com-inst_INST = $(INST_BIN)
582VBoxMain-com-inst_SOURCES = \
583 win/comregister.cmd
584
585
586
587
588# generate rules
589include $(KBUILD_PATH)/subfooter.kmk
590
591
592
593
594
595#
596# Additions rules.
597#
598
599XIDLFILE = $(VBOX_PATH_MAIN_SRC)/idl/VirtualBox.xidl
600
601ifneq ($(KBUILD_TARGET),win)
602
603## @todo this hack ain't cutting it any longer. (the file name is abspath'ed since ages now.)
604xpcom/helpers.cpp: $(IDLTYPELIB)
605
606$(IDLFILE): $(VBOX_PATH_MAIN_SRC)/idl/xpidl.xsl $(XIDLFILE) | $(call DIRDEP,$(dir $(IDLFILE)))
607 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
608 $(QUIET)$(MKDIR) -p $(@D)
609 $(QUIET)$(VBOX_XSLTPROC) -o $@ $^
610
611$(IDLTYPELIB): $(IDLFILE) | $(call DIRDEP,$(dir $(IDLTYPELIB))) $(VBOX_XPIDL)
612 $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
613 $(QUIET)$(VBOX_XPIDL) -m typelib -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
614
615$(IDLHEADER): $(IDLFILE) | $(call DIRDEP,$(dir $(IDLHEADER))) $(VBOX_XPIDL)
616 $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
617 $(QUIET)$(VBOX_XPIDL) -m header -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
618
619else
620
621MAIN_IDL ?= $(EXEC_X86_WIN32) $(firstword $(wildcard \
622 $(PATH_SDK_WINPSDK_BIN)/Midl.Exe\
623 $(PATH_SDK_WINPSDK)/Bin/Midl.Exe\
624 $(PATH_DEVTOOLS)/win.x86/bin/midl.exe\
625 ) Sorry_Cannot_Find_The_Midl_Compiler_In_The_PSDK)
626IDL_DEFS = /nologo
627ifdef VBOX_WITH_VRDP
628 IDL_DEFS += /D VBOX_VRDP
629endif
630
631$(IDLFILE): $(VBOX_PATH_MAIN_SRC)/idl/midl.xsl $(XIDLFILE)
632 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
633 $(QUIET)$(MKDIR) -p $(VBOX_PATH_SDK)/idl
634 $(QUIET)$(VBOX_XSLTPROC) -o $@ $^
635
636$(PATH_TARGET)/VBoxSVC.rgs: $(VBOX_PATH_MAIN_SRC)/win/VirtualBox_rgs.xsl $(XIDLFILE)
637 $(VBOX_XSLTPROC) --stringparam Module VBoxSVC -o $@ $^
638
639$(PATH_TARGET)/VBoxC.rgs: $(VBOX_PATH_MAIN_SRC)/win/VirtualBox_rgs.xsl $(XIDLFILE)
640 $(VBOX_XSLTPROC) --stringparam Module VBoxC -o $@ $^
641
642## @todo r=bird: last changes to this rule showed incorrect dependencies here as it broke testcase (see testboxwin2).
643# This is kind of obvious when looking at the rule, because it's (a) not specifing all it output
644# and (b) generating more stuff *after* the maintarget has been completed.
645#
646# What needs to be done is to not depend on _i.c in the object subdir, but on all the final outputs.
647$(PATH_VBoxCOM)/VirtualBox_i.c \
648+ $(VBOX_PATH_SDK)/lib/VirtualBox_i.c \
649+ $(PATH_VBoxCOM)/VirtualBox.h \
650+ $(VBOX_PATH_SDK)/include/VirtualBox.h \
651+ $(PATH_VBoxCOM)/VirtualBox.tlb \
652+ $(VBOX_PATH_SDK)/lib/VirtualBox.tlb: $(IDLFILE) | $(call DIRDEP,$(PATH_VBoxCOM))
653 $(MAIN_IDL) $(IDL_DEFS) \
654 /out $(subst /,\\,$(PATH_VBoxCOM)) \
655 /cpp_cmd $(subst /,\\,$(TOOL_$(VBOX_VCC_TOOL)_CC)) \
656 /I $(subst /,\\,$(PATH_SDK_WINPSDK_INC)) \
657 /I idl \
658 $(subst /,\\,$<)
659 $(MKDIR) -p $(VBOX_PATH_SDK)/include
660 $(CP) $(PATH_VBoxCOM)/VirtualBox.h $(VBOX_PATH_SDK)/include
661 $(MKDIR) -p $(VBOX_PATH_SDK)/lib
662 $(CP) $(PATH_VBoxCOM)/VirtualBox.tlb $(VBOX_PATH_SDK)/lib
663 $(CP) $(PATH_VBoxCOM)/VirtualBox_i.c $(VBOX_PATH_SDK)/lib
664
665endif
666
667
668#
669# Translation stuff
670#
671VBoxSVC_HEADERS = \
672 include/collection.h \
673 include/MachineImpl.h \
674 include/HostDVDDriveImpl.h \
675 include/HostFloppyDriveImpl.h
676
677VBoxC_HEADERS = \
678 include/ConsoleImpl.h
679
680VBoxSVC_TRANSLATIONS = \
681 nls/VBoxSVC_de.ts
682
683VBoxC_TRANSLATIONS = \
684 nls/VBoxC_de.ts
685
686updatenls:
687 $(VBOX_LUPDATE) $(VBoxSVC_SOURCES) $(VBoxSVC_HEADERS) -ts $(VBoxSVC_TRANSLATIONS)
688 $(VBOX_LUPDATE) $(VBoxC_SOURCES) $(VBoxC_HEADERS) -ts $(VBoxC_TRANSLATIONS)
689
690ifdef VBOX_WITH_XPCOM
691
692testidl: $(IDLFILE) $(IDLTYPELIB)
693testidlhdr: $(IDLHEADER)
694
695else
696
697testidl: $(IDLFILE) $(PATH_VBoxCOM)/VirtualBox_i.c
698
699endif
700
701testschemadefs: $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP)
702
703
704# Hot fix when dependencies goes bad again...
705#.NOTPARALLEL: $(TARGET_VBoxC) $(TARGET_VBoxSVC) $(TARGET_VBoxCOM) $(IDLHEADER) $(IDLFILE) $(PATH_VBoxCOM)/VirtualBox_i.c
706
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