VirtualBox

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

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

Dropped the non-working webservices hack; just include sub-makefiles first like eveywhere else.

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