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