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