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