VirtualBox

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

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

made Qt4 the default GUI; VBOX_VRDP => VBOX_WITH_VRDP; VBOX_HGCM => VBOX_WITH_HGCM; Makefile cleanup

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