VirtualBox

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

Last change on this file since 10253 was 10245, checked in by vboxsync, 17 years ago

Fixed few more dependencies on Makefile.kmk.

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