VirtualBox

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

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

minor SDK tweaks

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