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