VirtualBox

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

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

Performance API, version 0, webservice broken.

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