VirtualBox

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

Last change on this file since 38100 was 38096, checked in by vboxsync, 14 years ago

build fix

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 32.8 KB
Line 
1# $Id: Makefile.kmk 38096 2011-07-21 13:09:55Z vboxsync $
2## @file
3# Makefile for the VBox Main module.
4#
5
6#
7# Copyright (C) 2006-2011 Oracle Corporation
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
18SUB_DEPTH = ../../..
19include $(KBUILD_PATH)/subheader.kmk
20
21#
22# Include sub-makefile(s).
23#
24ifdef VBOX_WITH_WEBSERVICES
25 include $(PATH_SUB_CURRENT)/webservice/Makefile.kmk
26endif
27include $(PATH_SUB_CURRENT)/testcase/Makefile.kmk
28include $(PATH_SUB_CURRENT)/cbinding/Makefile.kmk
29
30
31#
32# Targets and globals (bit of a mess...)
33#
34VBOX_PATH_MAIN_SRC := $(PATH_SUB_CURRENT)
35
36ifdef VBOX_ONLY_SDK
37 # I'm Evil! Dr. Evil.
38 VBoxCOM_0_OUTDIR = $(PATH_TARGET)/VBoxCOM
39 BLDDIRS += $(VBoxCOM_0_OUTDIR) $(PATH_STAGE_BIN)/components
40 include $(KBUILD_PATH)/tools/VCC70.kmk
41 include $(KBUILD_PATH)/sdks/WINPSDK.kmk
42endif # !VBOX_ONLY_SDK
43
44
45# Construct VBOX_MAIN_DEFS
46## @todo eliminate or expand VBOX_MAIN_DEFS.
47VBOX_MAIN_DEFS =
48ifneq ($(KBUILD_TARGET),win)
49 ifndef VBOX_WITH_XPCOM
50 $(error "VBox: VBOX_WITH_XPCOM isn't defined")
51 endif
52 ifneq ($(KBUILD_TARGET),os2)
53 VBOX_MAIN_DEFS += VBOX_WITH_SYS_V_IPC_SESSION_WATCHER
54 endif
55endif
56VBOX_MAIN_DEFS += \
57 $(if $(VBOX_WITH_RAW_MODE),VBOX_WITH_RAW_MODE,) \
58 $(if $(VBOX_WITH_NETFLT),VBOX_WITH_NETFLT,) \
59 $(if $(VBOX_WITH_COPYTOGUEST),VBOX_WITH_COPYTOGUEST,) \
60 $(if $(VBOX_WITH_CROGL),VBOX_WITH_CROGL,) \
61 $(if $(VBOX_WITH_GUEST_PROPS),VBOX_WITH_GUEST_PROPS,) \
62 $(if $(VBOX_WITH_GUEST_PROPS_RDONLY_GUEST),VBOX_WITH_GUEST_PROPS_RDONLY_GUEST,) \
63 $(if $(VBOX_WITH_GUEST_CONTROL),VBOX_WITH_GUEST_CONTROL,) \
64 $(if $(VBOX_WITH_USB_VIDEO),VBOX_WITH_USB_VIDEO,) \
65 $(if $(VBOX_WITH_HOSTNETIF_API),VBOX_WITH_HOSTNETIF_API,)
66
67# Unconditionally enable the new semaphore key generation code
68VBOX_MAIN_DEFS += VBOX_WITH_NEW_SYS_V_KEYGEN
69
70VBOX_IDL_FILE.MSCOM = $(VBOX_PATH_SDK)/bindings/mscom/idl/VirtualBox.idl
71VBOX_IDL_FILE.XPCOM = $(VBOX_PATH_SDK)/bindings/xpcom/idl/VirtualBox_XPCOM.idl
72
73VBOX_IDL_TYPELIB.XPCOM = $(PATH_STAGE_BIN)/components/VirtualBox_XPCOM.xpt
74VBOX_IDL_HEADER.XPCOM = $(VBOX_PATH_SDK)/bindings/xpcom/include/VirtualBox_XPCOM.h
75
76# The MS COM specific stuff.
77if defined(VBOX_ONLY_SDK) || "$(KBUILD_TARGET)" == "win"
78 OTHERS += \
79 $(VBOX_IDL_FILE.MSCOM) \
80 $(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h \
81 $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox.tlb \
82 $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox_i.c
83 OTHER_CLEAN += \
84 $(VBOX_IDL_FILE.MSCOM) \
85 $(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h \
86 $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox.tlb \
87 $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox_i.c \
88 $(VBoxCOM_0_OUTDIR)/VirtualBox.h \
89 $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
90 $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb
91
92 VBOX_MAIN_PREREQS += $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c
93 BLDDIRS += $(VBOX_PATH_SDK)/bindings/mscom/idl
94endif
95
96# The XPCOM specific stuff.
97if defined(VBOX_ONLY_SDK) || "$(KBUILD_TARGET)" != "win"
98 OTHERS += $(VBOX_IDL_FILE.XPCOM) $(VBOX_IDL_TYPELIB.XPCOM) $(VBOX_IDL_HEADER.XPCOM)
99 OTHER_CLEAN += \
100 $(VBOX_IDL_FILE.XPCOM) \
101 $(VBOX_IDL_HEADER.XPCOM) \
102 $(VBOX_IDL_TYPELIB.XPCOM)
103
104 VBOX_MAIN_PREREQS += $(VBOX_IDL_TYPELIB.XPCOM) $(VBOX_IDL_HEADER.XPCOM)
105 BLDDIRS += \
106 $(VBOX_PATH_SDK)/bindings/xpcom/idl \
107 $(VBOX_PATH_SDK)/bindings/xpcom/include
108endif # xpcom
109
110
111#
112# Strip documentation from source XIDL so that we don't get a full
113# recompile every time a comma in the documentation is changed.
114#
115$(VBOX_XIDL_FILE).ts +| $(VBOX_XIDL_FILE): \
116 $(VBOX_XIDL_FILE_SRC) \
117 $(VBOX_PATH_MAIN_SRC)/idl/docstrip.xsl \
118 | $$(dir $$@)
119# $(CP) -fv $< $(VBOX_XIDL_FILE).ts
120 $(QUIET)$(VBOX_XSLTPROC) -o $(VBOX_XIDL_FILE).ts $(VBOX_PATH_MAIN_SRC)/idl/docstrip.xsl $<
121 $(QUIET)$(CP) --changed -fv $(VBOX_XIDL_FILE).ts $(VBOX_XIDL_FILE)
122
123OTHER_CLEAN += $(VBOX_XIDL_FILE) $(VBOX_XIDL_FILE).ts
124
125#
126# The Main API documentation
127#
128VBOX_MAIN_DOC_DIR = $(VBOX_PATH_SDK)/docs
129BLDDIRS += $(VBOX_MAIN_DOC_DIR)
130
131$(PATH_TARGET)/docs.Main: \
132 $(VBOX_PATH_MAIN_SRC)/Doxyfile.Main \
133 $(VBOX_PATH_MAIN_SRC)/idl/doxygen.xsl \
134 $(VBOX_XIDL_FILE_SRC) \
135 | $(PATH_TARGET)/ \
136 $(VBOX_MAIN_DOC_DIR)/
137 $(call MSG_TOOL,xsltproc,doxygen input,$<,$@)
138 $(QUIET)$(RM) -f $(wildcard $(VBOX_MAIN_DOC_DIR)/html/*) $(PATH_TARGET)/docs.Main
139 $(QUIET)$(VBOX_XSLTPROC) -o $(PATH_TARGET)/VirtualBox.idl $(VBOX_PATH_MAIN_SRC)/idl/doxygen.xsl $(VBOX_XIDL_FILE_SRC)
140 $(QUIET)$(REDIRECT) -E 'DOCDIR=$(VBOX_MAIN_DOC_DIR)' -E 'PATH_TARGET=$(PATH_TARGET)' -E 'PATH_CHM=$(subst /,\,$(VBOX_MAIN_DOC_DIR)/VirtualBoxAPI.chm)' \
141 -- doxygen $(VBOX_PATH_MAIN_SRC)/Doxyfile.Main
142 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) ">>>>>>>>>>>>>>>>>>>> Main.err: >>>>>>>>>>>>>>>>>>>>>>>>"
143 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(CAT) "$(PATH_TARGET)/Main.err"
144 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "<<<<<<<<<<<<<<<<<<<< Main.err <<<<<<<<<<<<<<<<<<<<<<<<<"
145 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "===> **************************************************"
146 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "===> Please fix above doxygen errors/warnings listed in"
147 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "===> $(PATH_TARGET)/Main.err"
148 $(QUIET)$(TEST) -s "$(PATH_TARGET)/Main.err" -- $(ECHO_EXT) "===> **************************************************"
149 -$(EXEC_X86_WIN32) $(VBOX_PATH_HTML_HELP_WORKSHOP)/hhc.exe $(subst /,\\,$(VBOX_MAIN_DOC_DIR)/html/index.hhp)
150 $(APPEND) $(PATH_TARGET)/docs.Main
151# aliases
152docs.main docs.Main: $(PATH_TARGET)/docs.Main
153if !defined(VBOX_ONLY_DOCS)
154docs: $(PATH_TARGET)/docs.Main
155endif
156
157
158#
159# Some SDK bit.
160#
161INSTALLS += VBox-main-xidl
162VBox-main-xidl_INST = $(INST_SDK)bindings/
163VBox-main-xidl_MODE = a+r,u+w
164VBox-main-xidl_SOURCES = $(VBOX_XIDL_FILE_SRC)
165
166ifdef VBOX_WITH_PYTHON
167INSTALLS += VBox-python-glue
168VBox-python-glue_INST = $(INST_SDK)installer/vboxapi/
169VBox-python-glue_MODE = a+r,u+w
170VBox-python-glue_SOURCES = \
171 glue/vboxapi.py=>__init__.py \
172 $(VBox-python-glue_0_OUTDIR)/VirtualBox_constants.py
173VBox-python-glue_CLEAN = \
174 $(VBox-python-glue_0_OUTDIR)/VirtualBox_constants.py
175
176$$(VBox-python-glue_0_OUTDIR)/VirtualBox_constants.py: \
177 $(VBOX_PATH_MAIN_SRC)/glue/constants-python.xsl \
178 $(VBOX_XIDL_FILE) \
179 | $$(dir $$@)
180 $(call MSG_TOOL,xsltproc,Python constants,$<,$@)
181 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
182
183endif # VBOX_WITH_PYTHON
184
185ifndef VBOX_ONLY_SDK # Note this goes on for *very* long
186
187#
188# Generate SchemaDefs.h and SchemaDefs.cpp from XML Schema
189# These two files are used by both VBoxC and VBoxSVC.
190#
191BLDDIRS += $(PATH_TARGET)/Main
192VBOX_XML_SCHEMADEFS_H = $(PATH_TARGET)/Main/SchemaDefs.h
193VBOX_XML_SCHEMADEFS_CPP = $(PATH_TARGET)/Main/SchemaDefs.cpp
194VBOX_XML_SCHEMADEFS_XSL = $(VBOX_PATH_MAIN_SRC)/xml/SchemaDefs.xsl
195
196VBOX_AUTOGEN_EVENT_H = $(PATH_TARGET)/Main/VBoxEvents.h
197VBOX_AUTOGEN_EVENT_CPP = $(PATH_TARGET)/Main/VBoxEvents.cpp
198
199testschemadefs: $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP)
200
201
202#
203# VBoxSVC executable
204#
205PROGRAMS += VBoxSVC
206VBoxSVC_TEMPLATE = VBOXMAINEXE
207VBoxSVC_DEFS = \
208 VBOX_MAIN_SETTINGS_ADDONS \
209 IN_VMM_STATIC \
210 $(VBOX_MAIN_DEFS) \
211 $(if $(VBOX_WITH_VBOXSDL),VBOX_WITH_VBOXSDL,) \
212 $(if $(VBOX_WITH_HEADLESS),VBOX_WITH_HEADLESS,) \
213 $(if $(VBOX_WITH_QTGUI),VBOX_WITH_QTGUI,) \
214 $(if $(VBOX_WITH_COCOA_QT),VBOX_WITH_COCOA_QT,) \
215 $(if $(VBOX_WITH_HGCM),VBOX_WITH_HGCM,) \
216 $(if $(VBOX_WITH_ALSA),VBOX_WITH_ALSA,) \
217 $(if $(VBOX_WITH_PULSE),VBOX_WITH_PULSE,) \
218 $(if $(VBOX_WITH_WINMM),VBOX_WITH_WINMM,) \
219 $(if $(VBOX_WITH_SOLARIS_OSS),VBOX_WITH_SOLARIS_OSS,) \
220 $(if $(VBOX_WITH_E1000),VBOX_WITH_E1000,) \
221 $(if $(VBOX_WITH_VIRTIO),VBOX_WITH_VIRTIO,) \
222 $(if $(VBOX_WITH_AHCI),VBOX_WITH_AHCI,) \
223 $(if $(VBOX_WITH_LSILOGIC),VBOX_WITH_LSILOGIC,) \
224 $(if $(VBOX_WITH_LINUX_COMPILER_H),VBOX_WITH_LINUX_COMPILER_H,) \
225 $(if $(VBOX_WITH_RESOURCE_USAGE_API),VBOX_WITH_RESOURCE_USAGE_API,) \
226 $(if $(VBOX_WITH_PDM_ASYNC_COMPLETION),VBOX_WITH_PDM_ASYNC_COMPLETION,) \
227 $(if $(VBOX_WITH_DBUS),$(if $(VBOX_USB_WITH_DBUS),VBOX_USB_WITH_DBUS,),) \
228 $(if $(VBOX_USB_WITH_SYSFS),VBOX_USB_WITH_SYSFS,) \
229 $(if $(VBOX_USB_WITH_INOTIFY),VBOX_USB_WITH_INOTIFY,) \
230 $(if $(VBOX_WITH_LIVE_MIGRATION),VBOX_WITH_LIVE_MIGRATION,) \
231 $(if $(VBOX_WITH_EXTPACK),VBOX_WITH_EXTPACK,) \
232 $(if $(VBOX_WITH_VUSB),VBOX_WITH_VUSB,) \
233 $(if $(VBOX_WITH_S3),VBOX_WITH_S3,) \
234 $(if $(VBOX_WITH_PCI_PASSTHROUGH),VBOX_WITH_PCI_PASSTHROUGH,)
235ifdef VBOX_WITH_USB
236 VBoxSVC_DEFS += \
237 VBOX_WITH_USB \
238 $(if $(VBOX_WITH_EHCI),VBOX_WITH_EHCI,) \
239 $(if $(VBOX_WITH_NEW_USB_CODE_ON_DARWIN),VBOX_WITH_NEW_USB_CODE_ON_DARWIN,)
240endif
241VBoxSVC_DEFS.win += VBOX_COM_OUTOFPROC_MODULE
242VBoxSVC_DEFS.win.x86 += _WIN32_WINNT=0x0500
243VBoxSVC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
244# Try to load and use libhal at runtime for probing removable media
245# VBoxSVC_DEFS.linux += VBOX_USE_LIBHAL
246VBoxSVC_DEFS.solaris += VBOX_USE_LIBHAL
247VBoxSVC_DEFS.freebsd += VBOX_USE_LIBHAL
248
249VBoxSVC_CXXFLAGS = $(filter-out -Wno-unused,$(TEMPLATE_VBOXMAINEXE_CXXFLAGS))
250
251VBoxSVC_INCS = \
252 include \
253 $(VBoxSVC_0_OUTDIR) \
254 $(dir $(VBOX_XML_SCHEMADEFS_H)) \
255 .
256VBoxSVC_INCS.win = \
257 $(VBoxCOM_0_OUTDIR)
258ifdef VBOX_WITH_USB
259 VBoxSVC_INCS.os2 = \
260 $(PATH_ROOT)/src/VBox/HostDrivers/VBoxUSB/os2
261endif
262
263VBoxSVC_LIBS += \
264 $(PATH_STAGE_LIB)/SSMStandalone$(VBOX_SUFF_LIB) \
265 $(LIB_DDU)
266VBoxSVC_SDKS = VBOX_LIBPNG VBOX_ZLIB
267VBoxSVC_LIBS.solaris = \
268 adm \
269 nsl \
270 devinfo \
271 socket \
272 $(LIB_VMM)
273
274VBoxSVC_INTERMEDIATES = \
275 $(VBOX_MAIN_PREREQS) \
276 $(VBOX_XML_SCHEMADEFS_H) \
277 $(VBOX_AUTOGEN_EVENT_H)
278
279VBoxSVC_SOURCES = \
280 src-all/DisplayPNGUtil.cpp \
281 src-all/DisplayResampleImage.cpp \
282 src-all/DisplayUtils.cpp \
283 src-all/EventImpl.cpp \
284 src-all/Global.cpp \
285 src-all/Logging.cpp \
286 src-all/PciDeviceAttachmentImpl.cpp \
287 src-all/ProgressImpl.cpp \
288 src-all/SharedFolderImpl.cpp \
289 src-all/VirtualBoxBase.cpp \
290 src-all/VirtualBoxErrorInfoImpl.cpp \
291 $(if $(VBOX_WITH_EXTPACK),src-all/ExtPackManagerImpl.cpp src-all/ExtPackUtil.cpp,) \
292 src-server/ApplianceImpl.cpp \
293 src-server/ApplianceImplExport.cpp \
294 src-server/ApplianceImplImport.cpp \
295 src-server/ApplianceImplIO.cpp \
296 src-server/AudioAdapterImpl.cpp \
297 src-server/BandwidthControlImpl.cpp \
298 src-server/BandwidthGroupImpl.cpp \
299 src-server/BIOSSettingsImpl.cpp \
300 src-server/DHCPServerImpl.cpp \
301 src-server/DHCPServerRunner.cpp \
302 src-server/GuestOSTypeImpl.cpp \
303 src-server/HostImpl.cpp \
304 src-server/HostNetworkInterfaceImpl.cpp \
305 src-server/HostPower.cpp \
306 src-server/Logging.cpp \
307 src-server/MachineImpl.cpp \
308 src-server/MachineImplCloneVM.cpp \
309 src-server/Matching.cpp \
310 src-server/MediumAttachmentImpl.cpp \
311 src-server/MediumFormatImpl.cpp \
312 src-server/MediumImpl.cpp \
313 src-server/MediumLock.cpp \
314 src-server/NATEngineImpl.cpp \
315 src-server/NetworkAdapterImpl.cpp \
316 src-server/ParallelPortImpl.cpp \
317 src-server/ProgressProxyImpl.cpp \
318 src-server/SerialPortImpl.cpp \
319 src-server/SnapshotImpl.cpp \
320 src-server/StorageControllerImpl.cpp \
321 src-server/SystemPropertiesImpl.cpp \
322 src-server/USBControllerImpl.cpp \
323 src-server/VFSExplorerImpl.cpp \
324 src-server/VirtualBoxImpl.cpp \
325 src-server/VRDEServerImpl.cpp \
326 xml/ovfreader.cpp \
327 xml/Settings.cpp \
328 $(VBOX_XML_SCHEMADEFS_CPP) \
329 $(VBOX_AUTOGEN_EVENT_CPP) \
330 $(if $(VBOX_WITH_XPCOM),src-server/xpcom/server.cpp,)
331
332VBoxSVC_SOURCES.darwin = \
333 src-server/darwin/iokit.cpp \
334 src-server/darwin/HostPowerDarwin.cpp
335
336ifdef VBOX_WITH_CROGL
337 ifneq ($(KBUILD_TARGET),darwin)
338 VBoxSVC_SOURCES += src-server/generic/OpenGLTest.cpp
339 endif
340 VBoxSVC_SOURCES.darwin += src-server/darwin/OpenGLTestDarwin.cpp
341endif
342
343VBoxSVC_SOURCES.win = \
344 src-server/win/svcmain.cpp \
345 src-server/win/svchlp.cpp \
346 src-server/win/HostPowerWin.cpp \
347 src-server/win/VBoxSVC.rc \
348 src-server/win/VBoxComEvents.cpp
349
350VBoxSVC_SOURCES.linux = \
351 src-server/linux/HostHardwareLinux.cpp
352
353VBoxSVC_SOURCES.solaris = \
354 src-server/linux/vbox-libhal.cpp \
355 src-server/solaris/DynLoadLibSolaris.cpp
356
357VBoxSVC_SOURCES.freebsd = \
358 src-server/freebsd/HostHardwareFreeBSD.cpp
359
360src-server/Logging.cpp_DEFS = \
361 VBOX_BUILD_TARGET=\"$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)\" \
362 $(if $(VBOX_BLEEDING_EDGE),VBOX_BLEEDING_EDGE=\"$(VBOX_BLEEDING_EDGE)\",)
363
364
365ifdef VBOX_WITH_USB
366 ifdef VBOX_WITH_SYSFS_BY_DEFAULT
367 src-server/linux/USBProxyServiceLinux.cpp_DEFS += VBOX_WITH_SYSFS_BY_DEFAULT
368 endif
369 VBoxSVC_SOURCES += \
370 src-server/USBDeviceFilterImpl.cpp \
371 src-server/USBProxyService.cpp \
372 src-server/HostUSBDeviceImpl.cpp
373 VBoxSVC_SOURCES.darwin += src-server/darwin/USBProxyServiceDarwin.cpp
374 VBoxSVC_SOURCES.linux += src-server/linux/USBProxyServiceLinux.cpp
375 VBoxSVC_SOURCES.linux += src-server/linux/USBGetDevices.cpp
376 VBoxSVC_SOURCES.os2 += src-server/os2/USBProxyServiceOs2.cpp
377 VBoxSVC_SOURCES.solaris += src-server/solaris/USBProxyServiceSolaris.cpp
378 VBoxSVC_SOURCES.win += src-server/win/USBProxyServiceWindows.cpp
379 VBoxSVC_SOURCES.freebsd += src-server/freebsd/USBProxyServiceFreeBSD.cpp
380endif
381
382ifdef VBOX_WITH_NETFLT
383 # Note! The includes from the TOOL has lower priority than the SDKs,
384 # since comdef.h is in both the DDK and VCC we want to make sure
385 # we're using the VCC since we're not using the DDK compiler/crt.
386 # Since this is potentially risky, restrict it to the source file
387 # needing it.
388 src-server/win/NetIf-win.cpp_INCS.win += $(PATH_TOOL_$(VBOX_VCC_TOOL)_INC)
389 VBoxSVC_LIBS.win += \
390 $(WinNetConfig_1_TARGET) \
391 $(VBoxDrvCfg_1_TARGET) \
392 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
393 $(PATH_SDK_WINPSDK_LIB)/WbemUuid.Lib
394endif
395VBoxSVC_LDFLAGS.darwin = -framework IOKit -framework SystemConfiguration
396
397ifdef VBOX_WITH_CROGL
398 VBoxSVC_LDFLAGS.darwin += -framework OpenGL
399endif
400
401ifeq ($(KBUILD_TYPE),debug)
402 VBoxSVC_LDFLAGS.linux += -rdynamic # for backtrace_symbols()
403endif
404
405ifdef VBOX_WITH_RESOURCE_USAGE_API
406 VBoxSVC_SOURCES += \
407 src-server/PerformanceImpl.cpp \
408 src-server/Performance.cpp
409 VBoxSVC_SOURCES.darwin += src-server/darwin/PerformanceDarwin.cpp
410 VBoxSVC_SOURCES.freebsd += src-server/freebsd/PerformanceFreeBSD.cpp
411 VBoxSVC_SOURCES.linux += src-server/linux/PerformanceLinux.cpp
412 VBoxSVC_SOURCES.os2 += src-server/os2/PerformanceOs2.cpp
413 VBoxSVC_SOURCES.solaris += src-server/solaris/PerformanceSolaris.cpp
414 VBoxSVC_SOURCES.win += src-server/win/PerformanceWin.cpp
415 VBoxSVC_LDFLAGS.darwin += -lproc
416 VBoxSVC_LDFLAGS.solaris += -lkstat
417 VBoxSVC_LDFLAGS.win += psapi.lib powrprof.lib
418endif
419
420ifdef VBOX_WITH_HOSTNETIF_API
421 VBoxSVC_SOURCES.win += src-server/win/NetIf-win.cpp
422 VBoxSVC_SOURCES.linux += src-server/linux/NetIf-linux.cpp
423 VBoxSVC_SOURCES.os2 += src-server/os2/NetIf-os2.cpp
424 VBoxSVC_SOURCES.darwin += src-server/darwin/NetIf-darwin.cpp
425 VBoxSVC_SOURCES.solaris += src-server/solaris/NetIf-solaris.cpp
426 VBoxSVC_SOURCES.freebsd += src-server/freebsd/NetIf-freebsd.cpp
427 VBoxSVC_DEFS += VBOX_WITH_HOSTNETIF_API
428 if1of ($(KBUILD_TARGET), linux darwin solaris freebsd)
429 VBoxSVC_SOURCES += src-server/generic/NetIf-generic.cpp
430 endif
431endif
432
433src-server/win/VBoxSVC.rc_INCS = $(VBoxSVC_0_OUTDIR)
434src-server/win/VBoxSVC.rc_DEPS = $(VBoxSVC_0_OUTDIR)/VBoxSVC.rgs $(VBoxSVC_0_OUTDIR)/VBoxSVC-icon.rc
435src-server/win/VBoxSVC.rc_CLEAN = $(VBoxSVC_0_OUTDIR)/VBoxSVC.rgs $(VBoxSVC_0_OUTDIR)/VBoxSVC-icon.rc
436
437$$(VBoxSVC_0_OUTDIR)/VBoxSVC-icon.rc: $(MAKEFILE_CURRENT) $(VBOX_WINDOWS_ICON_FILE) | $$(dir $$(@D))
438 $(APPEND) -t $@ '1 ICON DISCARDABLE "$(subst /,\\,$(VBOX_WINDOWS_ICON_FILE))"'
439
440$$(VBoxSVC_0_OUTDIR)/VBoxSVC.rgs: $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(dir $$(@D))
441 $(VBOX_XSLTPROC) --stringparam Module VBoxSVC -o $@ $< $(VBOX_XIDL_FILE)
442
443
444#
445# Embed XML Schema files to VBoxSVC
446#
447VBOX_XML_SCHEMA_COMMON = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-common.xsd
448VBOX_XML_SCHEMA.darwin = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-macosx.xsd
449VBOX_XML_SCHEMA.linux = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-linux.xsd
450VBOX_XML_SCHEMA.freebsd = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-freebsd.xsd
451VBOX_XML_SCHEMA.win = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-windows.xsd
452VBOX_XML_SCHEMA.os2 = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-os2.xsd
453VBOX_XML_SCHEMA.solaris = $(VBOX_PATH_MAIN_SRC)/xml/VirtualBox-settings-solaris.xsd
454
455VBOX_XML_CONVERTER_TEMPLATE = $(VBOX_PATH_MAIN_SRC)/xml/SettingsConverter.xsl
456
457$$(VBoxSVC_0_OUTDIR)/xml_VirtualBox_settings_xsd.h: $(VBOX_XML_SCHEMA.$(KBUILD_TARGET)) $(VBOX_BIN2C)
458 $(call MSG_TOOL,bin2c,VBoxSVC,$<,$@)
459 $(QUIET)$(VBOX_BIN2C) _xml_VirtualBox_settings_xsd $< $@
460
461$$(VBoxSVC_0_OUTDIR)/xml_VirtualBox_settings_common_xsd.h: $(VBOX_XML_SCHEMA_COMMON) $(VBOX_BIN2C)
462 $(call MSG_TOOL,bin2c,VBoxSVC,$<,$@)
463 $(QUIET)$(VBOX_BIN2C) _xml_VirtualBox_settings_common_xsd $< $@
464
465$$(VBoxSVC_0_OUTDIR)/xml_SettingsConverter_xsl.h: $(VBOX_XML_CONVERTER_TEMPLATE) $(VBOX_BIN2C)
466 $(call MSG_TOOL,bin2c,VBoxSVC,$<,$@)
467 $(QUIET)$(VBOX_BIN2C) _xml_SettingsConverter_xsl $< $@
468
469$(VBOX_XML_SCHEMADEFS_H): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(KBUILD_TARGET)) $(VBOX_XML_SCHEMA_COMMON) | $$(dir $$@)
470 $(call MSG_GENERATE,SchemaDefs,$@,$<)
471 $(QUIET)$(VBOX_XSLTPROC) --stringparam mode declare -o $@ $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(KBUILD_TARGET))
472
473$(VBOX_XML_SCHEMADEFS_CPP): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(KBUILD_TARGET)) $(VBOX_XML_SCHEMA_COMMON) | $$(dir $$@)
474 $(call MSG_GENERATE,SchemaDefs,$@,$<)
475 $(QUIET)$(VBOX_XSLTPROC) --stringparam mode define -o $@ $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(KBUILD_TARGET))
476
477OTHER_CLEAN += $(VBOX_XML_SCHEMADEFS_H) $(VBOX_XML_SCHEMADEFS_CPP)
478
479
480#
481# Generate some event stuff for VBoxSVC and VBoxC.
482#
483$(VBOX_AUTOGEN_EVENT_H): $(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
484 $(call MSG_TOOL,xsltproc,autogen events,$<,$@)
485 $(QUIET)$(VBOX_XSLTPROC) --stringparam G_kind VBoxEventHeader -o $@ $< $(VBOX_XIDL_FILE)
486
487$(VBOX_AUTOGEN_EVENT_CPP): $(VBOX_PATH_MAIN_SRC)/idl/comimpl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
488 $(call MSG_TOOL,xsltproc,autogen events,$<,$@)
489 $(QUIET)$(VBOX_XSLTPROC) --stringparam G_kind VBoxEvent -o $@ $< $(VBOX_XIDL_FILE)
490
491OTHER_CLEAN += $(VBOX_AUTOGEN_EVENT_H) $(VBOX_AUTOGEN_EVENT_CPP)
492
493
494#
495# VBoxTestOGL - OpenGL support test app.
496# Note! Doesn't link with VBOX_WITH_DEBUG_VCC_CRT defined because it uses Qt.
497#
498if ( defined(VBOX_WITH_QTGUI) \
499 && (defined(VBOX_WITH_CROGL) || defined(VBOX_WITH_VIDEOHWACCEL)) \
500 && !defined(VBOX_WITH_DEBUG_VCC_CRT))
501 ifneq ($(KBUILD_TARGET),darwin)
502 ifdef VBOX_WITH_VIDEOHWACCEL
503 USES += qt4
504 endif
505 PROGRAMS += VBoxTestOGL
506 VBoxTestOGL_TEMPLATE = $(if $(VBOX_WITH_VIDEOHWACCEL),$(if $(VBOX_WITH_HARDENING),VBOXQT4GUI,VBOXQT4GUIEXE),VBOXMAINEXE)
507 VBoxTestOGL_SOURCES = src-server/generic/OpenGLTestApp.cpp
508 VBoxTestOGL_LIBS = \
509 $(if $(VBOX_WITH_CROGL), \
510 $(PATH_STAGE_LIB)/VBoxOGLhostspuload$(VBOX_SUFF_LIB) \
511 $(VBOX_LIB_OGL_HOSTCRUTIL),) \
512 $(if $(VBOX_WITH_VIDEOHWACCEL), $(PATH_STAGE_LIB)/VBoxOGL2D$(VBOX_SUFF_LIB),) \
513 $(LIB_RUNTIME)
514 VBoxTestOGL_DEFS += \
515 $(if $(VBOX_WITH_CROGL), VBOX_WITH_CROGL,) \
516 $(if $(VBOX_WITH_VIDEOHWACCEL), VBOX_WITH_VIDEOHWACCEL,) \
517 VBOX_BUILD_TARGET=\"$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)\" \
518 $(if $(VBOX_BLEEDING_EDGE),VBOX_BLEEDING_EDGE=\"$(VBOX_BLEEDING_EDGE)\",)
519 ifdef VBOX_WITH_VIDEOHWACCEL
520 VBoxTestOGL_QT_MODULES += Core Gui OpenGL
521 VBoxTestOGL_LDFLAGS.darwin += -framework OpenGL
522 VBoxTestOGL_LIBS.win += $(PATH_SDK_WINPSDK_LIB)/Opengl32.lib
523 if1of ($(KBUILD_TARGET), solaris linux freebsd)
524 # must come after VBoxOGL2D, therefore don't set the arch-specific LIBS variable here!
525 VBoxTestOGL_LIBS += GL
526 endif
527 endif
528 VBoxTestOGL_LDFLAGS.win = /SUBSYSTEM:windows
529 endif
530endif
531
532
533ifdef VBOX_WITH_XPCOM
534#
535# VBoxSVCM - VBoxSVC wrapper module
536#
537DLLS += VBoxSVCM
538VBoxSVCM_TEMPLATE = VBOXMAINCOMP
539VBoxSVCM_DEFS = IN_RING3 $(VBOX_MAIN_DEFS)
540ifdef VBOX_WITH_HARDENING
541 VBoxSVCM_DEFS += VBOX_WITH_HARDENING
542endif
543VBoxSVCM_INCS = \
544 include \
545 $(VBoxC_0_OUTDIR) \
546 .
547VBoxSVCM_INTERMEDIATES = $(VBOX_MAIN_PREREQS)
548VBoxSVCM_SOURCES = \
549 src-server/xpcom/server_module.cpp
550VBoxSVCM_LDFLAGS.darwin = \
551 -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxSVCM.dylib \
552 -exported_symbols_list $(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def
553 ifeq ($(KBUILD_TARGET),darwin)
554VBoxSVCM_ORDERDEPS += $(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def
555VBoxSVCM_CLEAN += $(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def
556$$(VBoxSVCM_0_OUTDIR)/VBoxSVCM.def:
557 $(RM) -f $@
558 $(APPEND) $@ _NSGetModule
559 endif
560VBoxSVCM_INTERMEDIATES += $(VBOX_IDL_HEADER.XPCOM)
561endif # VBOX_WITH_XPCOM
562
563
564#
565# VBoxC module
566#
567DLLS += VBoxC
568VBoxC_TEMPLATE = VBOXMAINCOMP
569VBoxC_SDKS = VBOX_LIBPNG VBOX_ZLIB
570VBoxC_DEFS = \
571 IN_RING3 \
572 $(VBOX_MAIN_DEFS) \
573 VBOX_COM_INPROC \
574 $(if $(VBOX_WITH_VRDP_VIDEO_CHANNEL),VBOX_WITH_VRDP_VIDEO_CHANNEL,) \
575 $(if $(VBOX_WITH_HGCM),VBOX_WITH_HGCM,) \
576 $(if $(VBOX_WITH_ALSA),VBOX_WITH_ALSA,) \
577 $(if $(VBOX_WITH_PULSE),VBOX_WITH_PULSE,) \
578 $(if $(VBOX_WITH_WINMM),VBOX_WITH_WINMM,) \
579 $(if $(VBOX_WITH_SOLARIS_OSS),VBOX_WITH_SOLARIS_OSS,) \
580 $(if $(VBOX_WITH_CROSSBOW),VBOX_WITH_CROSSBOW,) \
581 $(if $(VBOX_WITH_E1000),VBOX_WITH_E1000,) \
582 $(if $(VBOX_WITH_VIRTIO),VBOX_WITH_VIRTIO,) \
583 $(if $(VBOX_WITH_EFI),VBOX_WITH_EFI,) \
584 $(if $(VBOX_WITH_PDM_ASYNC_COMPLETION),VBOX_WITH_PDM_ASYNC_COMPLETION,) \
585 $(if $(VBOX_WITH_LIVE_MIGRATION),VBOX_WITH_LIVE_MIGRATION,) \
586 $(if $(VBOX_WITH_VUSB),VBOX_WITH_VUSB,) \
587 $(if $(VBOX_WITH_HGSMI),VBOX_WITH_HGSMI,) \
588 $(if $(VBOX_WITH_VIDEOHWACCEL),VBOX_WITH_VIDEOHWACCEL,) \
589 $(if $(VBOX_WITH_USB),VBOX_WITH_USB,) \
590 $(if-expr defined(VBOX_WITH_EHCI) && defined(VBOX_WITH_USB),VBOX_WITH_EHCI,) \
591 $(if $(VBOX_WITH_EXTPACK),VBOX_WITH_EXTPACK,) \
592 $(if $(VBOX_WITH_PCI_PASSTHROUGH),VBOX_WITH_PCI_PASSTHROUGH,)
593
594VBoxC_DEFS.darwin.x86 = VBOX_WITH_2X_4GB_ADDR_SPACE
595VBoxC_DEFS.win.x86 += _WIN32_WINNT=0x0500
596VBoxC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
597
598VBoxC_INCS = \
599 include \
600 $(VBoxC_0_OUTDIR) \
601 $(dir $(VBOX_XML_SCHEMADEFS_H))
602VBoxC_INCS.win = \
603 $(VBoxCOM_0_OUTDIR) \
604 .
605
606VBoxC_LDFLAGS.darwin = \
607 -install_name $(VBOX_DYLD_EXECUTABLE_PATH)/components/VBoxC.dylib \
608 -exported_symbols_list $(VBoxC_0_OUTDIR)/VBoxC.def \
609 -framework IOKit
610ifdef VBOX_USE_VCC80
611 VBoxC_LDFLAGS.win = /MANIFEST
612endif
613
614VBoxC_LIBS += \
615 $(LIB_VMM) \
616 $(LIB_REM)
617
618ifdef VBOX_WITH_NETFLT
619 VBoxC_LIBS.win += \
620 $(VBoxDrvCfg_1_TARGET) \
621 $(WinNetConfig_1_TARGET) \
622 $(PATH_TOOL_$(VBOX_VCC_TOOL)_LIB)/comsupp.lib \
623 $(PATH_SDK_WINPSDK_LIB)/WbemUuid.Lib
624endif
625
626VBoxC_INTERMEDIATES = \
627 $(VBOX_MAIN_PREREQS) \
628 $(VBOX_XML_SCHEMADEFS_H) \
629 $(VBOX_AUTOGEN_EVENT_H)
630
631VBoxC_SOURCES = \
632 src-all/DisplayPNGUtil.cpp \
633 src-all/DisplayResampleImage.cpp \
634 src-all/DisplayUtils.cpp \
635 src-all/EventImpl.cpp \
636 src-all/Global.cpp \
637 src-all/Logging.cpp \
638 src-all/PciDeviceAttachmentImpl.cpp \
639 src-all/ProgressImpl.cpp \
640 src-all/SharedFolderImpl.cpp \
641 src-all/VirtualBoxBase.cpp \
642 src-all/VirtualBoxErrorInfoImpl.cpp \
643 $(if $(VBOX_WITH_EXTPACK),src-all/ExtPackManagerImpl.cpp src-all/ExtPackUtil.cpp,) \
644 $(if $(VBOX_WITH_USB_VIDEO),src-client/UsbWebcamInterface.cpp,) \
645 src-client/AdditionsFacilityImpl.cpp \
646 src-client/AudioSnifferInterface.cpp \
647 src-client/BusAssignmentManager.cpp \
648 $(if $(VBOX_WITH_PCI_PASSTHROUGH),src-client/PciRawDevImpl.cpp,) \
649 src-client/ConsoleImpl.cpp \
650 src-client/ConsoleImpl2.cpp \
651 src-client/ConsoleImplTeleporter.cpp \
652 src-client/ConsoleVRDPServer.cpp \
653 src-client/DisplayImpl.cpp \
654 src-client/GuestCtrlImpl.cpp \
655 src-client/GuestCtrlIO.cpp \
656 src-client/GuestImpl.cpp \
657 src-client/KeyboardImpl.cpp \
658 src-client/MachineDebuggerImpl.cpp \
659 src-client/MouseImpl.cpp \
660 src-client/RemoteUSBDeviceImpl.cpp \
661 src-client/SessionImpl.cpp \
662 src-client/USBDeviceImpl.cpp \
663 src-client/VBoxDriversRegister.cpp \
664 src-client/VirtualBoxClientImpl.cpp \
665 src-client/VMMDevInterface.cpp \
666 $(VBOX_AUTOGEN_EVENT_CPP) \
667 $(VBOX_XML_SCHEMADEFS_CPP)
668VBoxC_SOURCES.win = \
669 src-client/win/dllmain.cpp \
670 src-client/win/VBoxC.def \
671 src-client/win/VBoxC.rc
672
673
674ifdef VBOX_WITH_XPCOM
675VBoxC_SOURCES += \
676 src-client/xpcom/module.cpp
677endif
678
679ifdef VBOX_WITH_HGCM
680VBoxC_SOURCES += \
681 src-client/HGCMObjects.cpp \
682 src-client/HGCMThread.cpp \
683 src-client/HGCM.cpp
684endif
685
686ifdef VBOX_WITH_CRHGSMI
687VBoxC_DEFS += VBOX_WITH_CRHGSMI
688endif
689
690ifdef VBOX_WITH_USB
691VBoxC_SOURCES += \
692 src-client/RemoteUSBBackend.cpp
693endif
694
695ifeq ($(KBUILD_TARGET),darwin)
696VBoxC_ORDERDEPS += $(VBoxC_0_OUTDIR)/VBoxC.def
697VBoxC_CLEAN += $(VBoxC_0_OUTDIR)/VBoxC.def
698$$(VBoxC_0_OUTDIR)/VBoxC.def: $(MAKEFILE_CURRENT)
699 $(RM) -f $@
700 $(APPEND) $@ _NSGetModule
701 $(APPEND) $@ _VBoxDriversRegister
702endif
703
704src-client/ConsoleImpl.cpp_DEFS = \
705 VBOX_BUILD_TARGET=\"$(KBUILD_TARGET).$(KBUILD_TARGET_ARCH)\" \
706 $(if $(VBOX_BLEEDING_EDGE),VBOX_BLEEDING_EDGE=\"$(VBOX_BLEEDING_EDGE)\",)
707
708
709src-client/win/VBoxC.rc_DEPS = $(VBoxC_0_OUTDIR)/VBoxC.rgs $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb
710VBoxC_CLEAN.win += $(VBoxC_0_OUTDIR)/VBoxC.rgs
711
712$$(VBoxC_0_OUTDIR)/VBoxC.rgs: $(VBOX_PATH_MAIN_SRC)/src-all/win/VirtualBox_rgs.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
713 $(VBOX_XSLTPROC) --stringparam Module VBoxC -o $@ $< $(VBOX_XIDL_FILE)
714
715
716#
717# VBoxCOM - COM Abstraction Layer library
718#
719LIBRARIES += VBoxCOM
720VBoxCOM_TEMPLATE = VBOXMAINLIB
721VBoxCOM_INTERMEDIATES = $(VBOX_MAIN_PREREQS)
722VBoxCOM_SOURCES = \
723 glue/com.cpp \
724 glue/initterm.cpp \
725 glue/string.cpp \
726 glue/AutoLock.cpp \
727 glue/EventQueue.cpp \
728 glue/ErrorInfo.cpp \
729 glue/errorprint.cpp \
730 glue/VirtualBoxErrorInfo.cpp
731VBoxCOM_INCS += \
732 include
733ifeq ($(KBUILD_TARGET),win)
734 VBoxCOM_DEFS.x86 += _WIN32_WINNT=0x0500
735 VBoxCOM_DEFS.amd64 += _WIN32_WINNT=0x0510
736 VBoxCOM_SOURCES += \
737 $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c
738else # !win
739 VBoxCOM_SOURCES += \
740 glue/xpcom/helpers.cpp
741endif # !win
742
743
744#
745# The VBoxExtPackHelperApp.
746#
747ifdef VBOX_WITH_EXTPACK
748 PROGRAMS += VBoxExtPackHelperApp
749 VBoxExtPackHelperApp_TEMPLATE = VBoxR3SetUidToRoot
750 VBoxExtPackHelperApp_LDFLAGS.darwin = -framework Security
751 VBoxExtPackHelperApp_LDFLAGS.win = /SUBSYSTEM:windows
752 VBoxExtPackHelperApp_SOURCES = \
753 src-helper-apps/VBoxExtPackHelperApp.cpp \
754 src-all/ExtPackUtil.cpp
755 VBoxExtPackHelperApp_LIBS = \
756 $(LIB_RUNTIME)
757endif # VBOX_WITH_EXTPACK
758
759
760endif # !VBOX_ONLY_SDK (the ifndef is far above)
761
762
763#
764# Installs com related thing(s) to bin.
765#
766INSTALLS.win += VBoxMain-com-inst
767VBoxMain-com-inst_INST = $(INST_BIN)
768VBoxMain-com-inst_MODE = a+r,u+w
769VBoxMain-com-inst_SOURCES = src-all/win/comregister.cmd
770
771
772if defined(VBOX_WITH_HARDENING) && "$(KBUILD_TARGET)" == "linux"
773 #
774 # Installs linux/hardening related things to components.
775 #
776 INSTALLS.linux += VBoxMain-hardening-inst
777 VBoxMain-hardening-inst_INST = $(INST_BIN)components/
778 VBoxMain-hardening-inst_SYMLINKS = \
779 VBoxDDU.so=>../VBoxDDU.so \
780 VBoxREM.so=>../VBoxREM.so \
781 VBoxRT.so=>../VBoxRT.so \
782 VBoxVMM.so=>../VBoxVMM.so \
783 VBoxXPCOM.so=>../VBoxXPCOM.so
784endif
785
786
787# generate rules
788include $(KBUILD_PATH)/subfooter.kmk
789
790
791
792#
793# Additions rules.
794#
795
796## @todo this hack ain't cutting it any longer. (the file name is abspath'ed since ages now.)
797glue/xpcom/helpers.cpp: $(VBOX_IDL_TYPELIB.XPCOM)
798
799$(VBOX_IDL_FILE.XPCOM): $(VBOX_PATH_MAIN_SRC)/idl/xpidl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
800 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
801 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
802
803$(VBOX_IDL_TYPELIB.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
804 $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
805 $(QUIET)$(VBOX_XPIDL_ENV)$(VBOX_XPIDL) -m typelib -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
806 $(CHMOD) 0644 $@
807## @todo ^^^^^^^^^^^^ fix horrible hack
808
809$(VBOX_IDL_HEADER.XPCOM): $(VBOX_IDL_FILE.XPCOM) | $$(dir $$@) $(VBOX_XPIDL)
810 $(call MSG_TOOL,xpidl,VBoxSVC,$<,$@)
811 $(QUIET)$(VBOX_XPIDL_ENV)$(VBOX_XPIDL) -m header -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
812
813
814VBOX_MAIN_IDL ?= $(EXEC_X86_WIN32) $(call VBOX_FN_MAKE_WIN_PATH,$(firstword $(wildcard \
815 $(PATH_SDK_WINPSDK_BIN)/Midl.Exe\
816 $(PATH_SDK_WINPSDK)/Bin/Midl.Exe\
817 $(PATH_DEVTOOLS)/win.x86/bin/midl.exe\
818 ) Sorry_Cannot_Find_The_Midl_Compiler_In_The_PSDK))
819IDL_DEFS = /nologo
820
821$(VBOX_IDL_FILE.MSCOM): $(VBOX_PATH_MAIN_SRC)/idl/midl.xsl $(VBOX_XIDL_FILE) | $$(dir $$@)
822 $(call MSG_TOOL,xsltproc,VBoxSVC,$<,$@)
823 $(QUIET)$(VBOX_XSLTPROC) -o $@ $< $(VBOX_XIDL_FILE)
824
825# Aliases for testing purposes.
826ifdef VBOX_WITH_XPCOM
827testidl: $(VBOX_IDL_FILE.XPCOM) $(VBOX_IDL_TYPELIB.XPCOM)
828testidlhdr: $(VBOX_IDL_HEADER.XPCOM)
829else
830testidl: $(VBOX_IDL_FILE.MSCOM) $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c
831endif
832
833
834## @todo r=bird: last changes to this rule showed incorrect dependencies here as it broke testcase (see testboxwin2).
835# This is kind of obvious when looking at the rule, because it's (a) not specifying all it output
836# and (b) generating more stuff *after* the main target has been completed.
837#
838# What needs to be done is to not depend on _i.c in the object subdir, but on all the final outputs.
839$(VBoxCOM_0_OUTDIR)/VirtualBox_i.c \
840+ $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox_i.c \
841+ $(VBoxCOM_0_OUTDIR)/VirtualBox.h \
842+ $(VBOX_PATH_SDK)/bindings/mscom/include/VirtualBox.h \
843+ $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb \
844+ $(VBOX_PATH_SDK)/bindings/mscom/lib/VirtualBox.tlb: $(VBOX_IDL_FILE.MSCOM) | $$(dir $$@)
845 $(VBOX_MAIN_IDL) $(IDL_DEFS) \
846 /out $(call VBOX_FN_MAKE_WIN_PATH,$(VBoxCOM_0_OUTDIR)) \
847 /cpp_cmd $(subst $(EXEC_X86_WIN32),,$(call VBOX_FN_MAKE_WIN_PATH,$(TOOL_$(VBOX_VCC_TOOL)_CC))) \
848 /I $(call VBOX_FN_MAKE_WIN_PATH,$(PATH_SDK_WINPSDK_INC)) \
849 /I idl \
850 $(call VBOX_FN_MAKE_WIN_PATH,$<)
851 $(MKDIR) -p $(VBOX_PATH_SDK)/bindings/mscom/include
852 $(CP) $(VBoxCOM_0_OUTDIR)/VirtualBox.h $(VBOX_PATH_SDK)/bindings/mscom/include
853 $(MKDIR) -p $(VBOX_PATH_SDK)/bindings/mscom/lib
854 $(CP) $(VBoxCOM_0_OUTDIR)/VirtualBox.tlb $(VBOX_PATH_SDK)/bindings/mscom/lib
855 $(CP) $(VBoxCOM_0_OUTDIR)/VirtualBox_i.c $(VBOX_PATH_SDK)/bindings/mscom/lib
856
857#
858# Translation stuff
859#
860VBoxSVC_VBOX_HEADERS = \
861 include/collection.h \
862 include/MachineImpl.h
863VBoxSVC_VBOX_TRANSLATIONS = \
864 nls/VBoxSVC_de.ts
865
866VBoxC_VBOX_HEADERS = \
867 include/ConsoleImpl.h
868VBoxC_VBOX_TRANSLATIONS = \
869 nls/VBoxC_de.ts
870
871ifdef VBOX_WITH_JMSCOM
872
873#
874# Java glue JAR files
875#
876VBOX_JMSCOM_JAR = $(VBoxJMscom-inst-jar_0_OUTDIR)/vboxjmscom.jar
877VBOX_JMSCOM_TARGET := $(PATH_TARGET)/vboxjmscom-gen
878VBOX_JMSCOM_GEN = $(VBOX_JMSCOM_TARGET)/jmscomgen
879VBOX_JMSCOM_JDEST := $(VBOX_JMSCOM_TARGET)/jdest
880VBOX_GLUE_XSLT_DIR := $(PATH_ROOT)/src/VBox/Main/glue
881VBOX_JACOB_DIR := $(PATH_ROOT)/src/libs/jacob-1.15-M3
882
883INSTALLS += VBoxJMscom-inst-jar
884VBoxJMscom-inst-jar_INST = $(INST_SDK)bindings/mscom/java/
885VBoxJMscom-inst-jar_MODE = a+r,u+w
886VBoxJMscom-inst-jar_SOURCES = \
887 $(VBOX_JMSCOM_JAR)
888VBoxJMscom-inst-jar_CLEAN = \
889 $(VBOX_JMSCOM_JAR) \
890 $(VBOX_JMSCOM_GEN)/jmscomglue.list \
891 $(wildcard \
892 $(VBOX_JMSCOM_GEN)/java/*.java \
893 $(VBOX_JMSCOM_JDEST)/*.class \
894 $(VBOX_JMSCOM_JDEST)/*/*.class \
895 $(VBOX_JMSCOM_JDEST)/*/*/*.class \
896 $(VBOX_JMSCOM_JDEST)/*/*/*/*.class \
897 )
898VBoxJMscom-inst-jar_BLDDIRS += $(VBOX_JMSCOM_GEN)/java
899
900$(VBOX_JMSCOM_GEN)/jmscomglue.list: \
901 $(VBOX_XIDL_FILE) \
902 $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl \
903 $(VBOX_FILESPLIT) \
904 | $(VBOX_JMSCOM_GEN)/java/
905 $(call MSG_L1,Generating Java MSCOM glue files from XIDL)
906 $(QUIET)$(RM) -f $(wildcard $(VBOX_JMSCOM_GEN)/java/*.java)
907 $(QUIET)$(VBOX_XSLTPROC) \
908 --stringparam G_vboxApiSuffix $(VBOX_API_SUFFIX) \
909 --stringparam G_vboxGlueStyle mscom \
910 -o $(VBOX_JMSCOM_GEN)/java/merged.file $(VBOX_GLUE_XSLT_DIR)/glue-java.xsl $<
911 $(QUIET)$(VBOX_FILESPLIT) $(VBOX_JMSCOM_GEN)/java/merged.file $(VBOX_JMSCOM_GEN)/java
912 $(QUIET)echo $(VBOX_JMSCOM_GEN)/java/*.java > $@
913
914$$(VBOX_JMSCOM_JAR): $(VBOX_JMSCOM_GEN)/jmscomglue.list | $$(dir $$@)
915 $(call MSG_TOOL,javac,$(notdir $@),jmscomgen.list,)
916 $(QUIET)$(RM) -Rf $(VBOX_JMSCOM_JDEST)
917 $(QUIET)$(MKDIR) -p $(VBOX_JMSCOM_JDEST)
918 $(call MSG_TOOL,javac,$(notdir $@),...,)
919 $(VBOX_JAVAC) $(VBOX_JAVAC_OPTS) \
920 @$(VBOX_JMSCOM_GEN)/jmscomglue.list \
921 -d $(VBOX_JMSCOM_JDEST) -classpath $(VBOX_JMSCOM_JDEST)$(VBOX_SEP)$(VBOX_JACOB_DIR)/jacob.jar
922 $(call MSG_LINK,$(notdir $@),$@)
923 $(VBOX_JAR) cf $@ -C $(VBOX_JMSCOM_JDEST) .
924
925endif # VBOX_WITH_JMSCOM
926
927#
928# Install Java glue sample code.
929#
930INSTALLS += javagluesample
931javagluesample_INST = $(INST_SDK)bindings/glue/java/
932javagluesample_MODE = a+r,u+w
933javagluesample_SOURCES = \
934 $(VBOX_PATH_MAIN_SRC)/glue/tests/TestVBox.java=>TestVBox.java \
935 $(VBOX_PATH_MAIN_SRC)/glue/tests/Makefile.kmk=>Makefile.kmk
936
937updatenls::
938 $(VBOX_LUPDATE) $(VBoxSVC_SOURCES) $(VBoxSVC_VBOX_HEADERS) -ts $(VBoxSVC_VBOX_TRANSLATIONS)
939 $(VBOX_LUPDATE) $(VBoxC_SOURCES) $(VBoxC_VBOX_HEADERS) -ts $(VBoxC_VBOX_TRANSLATIONS)
940
941testconverter:: $(VBOX_USER_HOME)/VirtualBox.xml
942 $(call MSG_TOOL,xsltproc,Test Settings Converter,$<,$(VBOX_USER_HOME)/VirtualBox.xml.test)
943 $(QUIET)$(VBOX_XSLTPROC) -o $(VBOX_USER_HOME)/VirtualBox.xml.test xml/SettingsConverter.xsl $<
944
945testconverter2:: $(VBOX_USER_HOME)/Machines/dos/dos.xml
946 $(call MSG_TOOL,xsltproc,Test Settings Converter,$<,$<.test)
947 $(QUIET)$(VBOX_XSLTPROC) -o $<.test xml/SettingsConverter.xsl $<
948
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