1 | # $Id: Makefile.kmk 2926 2007-05-30 07:48:19Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Makefile for the VBox Main module.
|
---|
4 | #
|
---|
5 |
|
---|
6 | #
|
---|
7 | # Copyright (C) 2006 InnoTek Systemberatung GmbH
|
---|
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 as published by the Free Software Foundation,
|
---|
13 | # in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
|
---|
14 | # distribution. VirtualBox OSE is distributed in the hope that it will
|
---|
15 | # be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | #
|
---|
17 | # If you received this file as part of a commercial VirtualBox
|
---|
18 | # distribution, then only the terms of your commercial VirtualBox
|
---|
19 | # license agreement apply instead of the previous paragraph.
|
---|
20 | #
|
---|
21 |
|
---|
22 | DEPTH = ../../..
|
---|
23 | include $(PATH_KBUILD)/header.kmk
|
---|
24 |
|
---|
25 | ifdef VBOX_WITH_VRDP_MC
|
---|
26 | DEFS += VRDP_MC
|
---|
27 | endif
|
---|
28 |
|
---|
29 | SUBDIRS_AFTER = testcase
|
---|
30 |
|
---|
31 | ifndef VBOX_OSE
|
---|
32 | SUBDIRS_AFTER += webservice
|
---|
33 | endif
|
---|
34 |
|
---|
35 | LIBRARIES =
|
---|
36 | DLLS = VBoxXML VBoxC
|
---|
37 | PROGRAMS = VBoxSVC
|
---|
38 | ifeq ($(BUILD_TARGET),win)
|
---|
39 | LIBRARIES = VBoxCOM
|
---|
40 | else
|
---|
41 | ifndef VBOX_WITH_XPCOM
|
---|
42 | $(error "VBox: VBOX_WITH_XPCOM isn't defined")
|
---|
43 | endif
|
---|
44 | DLLS += VBoxSVCM
|
---|
45 | LIBRARIES = VBoxXPCOM
|
---|
46 | DEFS += VBOX_WITH_XPCOM
|
---|
47 | DEFS += VBOX_WITH_SYS_V_IPC_SESSION_WATCHER
|
---|
48 | DEFS += VBOX_WITH_UNIXY_TAP_NETWORKING
|
---|
49 | endif
|
---|
50 | #PROGRAMS = tstCFGLdr
|
---|
51 |
|
---|
52 | ifeq ($(BUILD_TARGET),win)
|
---|
53 | OTHERS = $(PATH_BIN)/comregister.cmd
|
---|
54 | IDLFILE = $(VBOX_PATH_SDK)/idl/VirtualBox.idl
|
---|
55 | OTHER_CLEAN = \
|
---|
56 | $(PATH_BIN)/comregister.cmd \
|
---|
57 | $(VBOX_PATH_SDK)/include/VirtualBox.h \
|
---|
58 | $(IDLFILE) \
|
---|
59 | $(VBOX_PATH_SDK)/lib/VirtualBox.tlb \
|
---|
60 | $(VBOX_PATH_SDK)/lib/VirtualBox_i.c \
|
---|
61 | $(PATH_VBoxCOM)/VirtualBox.h \
|
---|
62 | $(PATH_VBoxCOM)/VirtualBox_i.c \
|
---|
63 | $(PATH_VBoxCOM)/VirtualBox.tlb
|
---|
64 | else
|
---|
65 | INSTALLS = xpcom-components
|
---|
66 | IDLFILE = $(VBOX_PATH_SDK)/idl/VirtualBox_XPCOM.idl
|
---|
67 | ifeq ($(BUILD_TARGET),linux)
|
---|
68 | IDLTYPELIB = $(PATH_BIN)/VirtualBox_XPCOM.xpt
|
---|
69 | else
|
---|
70 | IDLTYPELIB = $(PATH_BIN)/components/VirtualBox_XPCOM.xpt
|
---|
71 | endif
|
---|
72 | IDLHEADER = $(VBOX_PATH_SDK)/include/VirtualBox_XPCOM.h
|
---|
73 | OTHERS = $(IDLTYPELIB)
|
---|
74 | OTHER_CLEAN = \
|
---|
75 | $(IDLFILE) \
|
---|
76 | $(IDLHEADER) \
|
---|
77 | $(IDLTYPELIB)
|
---|
78 |
|
---|
79 | endif
|
---|
80 |
|
---|
81 |
|
---|
82 |
|
---|
83 | #
|
---|
84 | # The Main API documentation
|
---|
85 | #
|
---|
86 | docs: $(PATH_TARGET)/docs.Main
|
---|
87 |
|
---|
88 | $(PATH_TARGET)/docs.Main: \
|
---|
89 | Doxyfile.Main \
|
---|
90 | idl/doxygen.xsl \
|
---|
91 | idl/VirtualBox.xidl \
|
---|
92 | | $(call DIRDEP, $(PATH_TARGET)) \
|
---|
93 | $(call DIRDEP, $(PATH_OUT)/docs/Main)
|
---|
94 | $(RM) -f $(wildcard $(PATH_OUT)/docs/Main/html/*)
|
---|
95 | $(VBOX_XSLTPROC) -o $(PATH_TARGET)/VirtualBox.idl idl/doxygen.xsl idl/VirtualBox.xidl
|
---|
96 | PATH_OUT="$(PATH_OUT)" PATH_TARGET="$(PATH_TARGET)" PATH_CHM="$(subst /,\\,$(PATH_BIN)/VirtualBoxAPI.chm)" doxygen Doxyfile.Main
|
---|
97 | -$(EXEC_X86_WIN32) $(VBOX_PATH_HTML_HELP_WORKSHOP)/hhc.exe $(subst /,\\,$(PATH_OUT)/docs/Main/html/index.hhp)
|
---|
98 | $(APPEND) $(PATH_TARGET)/docs.Main
|
---|
99 |
|
---|
100 | $(call DIRDEP, $(PATH_OUT)/docs/Main):
|
---|
101 | $(MKDIR) -p $@
|
---|
102 |
|
---|
103 |
|
---|
104 | #
|
---|
105 | # VBoxSVC executable
|
---|
106 | #
|
---|
107 | VBoxSVC_TEMPLATE = VBOXMAINEXE
|
---|
108 | VBoxSVC_DEFS = CFGLDR_HAVE_COM IN_CFGLDR_R3
|
---|
109 | ifdef VBOX_WITH_VRDP
|
---|
110 | VBoxSVC_DEFS += VBOX_VRDP IN_VRDP_R3
|
---|
111 | endif
|
---|
112 | ifdef VBOX_WITH_HGCM
|
---|
113 | VBoxSVC_DEFS += VBOX_HGCM
|
---|
114 | endif
|
---|
115 | ifdef VBOX_MAIN_RELEASE_LOG
|
---|
116 | VBoxSVC_DEFS += VBOX_MAIN_RELEASE_LOG LOG_ENABLED
|
---|
117 | endif
|
---|
118 | ifdef VBOX_WITH_USB
|
---|
119 | VBoxSVC_DEFS += VBOX_WITH_USB
|
---|
120 | endif
|
---|
121 | ifdef VBOX_WITH_ALSA
|
---|
122 | VBoxSVC_DEFS += VBOX_WITH_ALSA
|
---|
123 | endif
|
---|
124 | ifdef VBOX_WITH_WINMM
|
---|
125 | VBoxSVC_DEFS += VBOX_WITH_WINMM
|
---|
126 | endif
|
---|
127 | ifdef VBOX_WITHOUT_LINUX_COMPILER_H
|
---|
128 | VBoxSVC_DEFS += VBOX_WITHOUT_LINUX_COMPILER_H
|
---|
129 | endif
|
---|
130 | VBoxSVC_DEFS.win += VBOX_COM_OUTOFPROC_MODULE
|
---|
131 | VBoxSVC_DEFS.win.x86 += _WIN32_WINNT=0x0500
|
---|
132 | VBoxSVC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
|
---|
133 | VBoxSVC_INCS = \
|
---|
134 | include \
|
---|
135 | $(PATH_VBoxSVC) \
|
---|
136 | $(PATH_VBoxCOM) \
|
---|
137 | $(PATH_CURRENT)
|
---|
138 | ifdef VBOX_WITH_XPCOM
|
---|
139 | VBoxSVC_LIBS += \
|
---|
140 | $(PATH_BIN)/VBoxDDU$(VBOX_SUFF_DLL) \
|
---|
141 | $(PATH_BIN)/VBoxXML$(VBOX_SUFF_DLL) \
|
---|
142 | $(TARGET_VBoxXPCOM)
|
---|
143 | VBoxSVC_LIBS += \
|
---|
144 | $(PATH_LIB)/VBoxXPCOMGlue$(VBOX_SUFF_LIB) \
|
---|
145 | $(PATH_BIN)/VBoxXPCOM$(VBOX_SUFF_DLL)
|
---|
146 | VBoxSVC_LIBS.darwin = \
|
---|
147 | $(LIB_VMM) \
|
---|
148 | $(LIB_REM)
|
---|
149 | else
|
---|
150 | VBoxSVC_LIBS = \
|
---|
151 | $(PATH_LIB)/VBoxDDU$(VBOX_SUFF_LIB) \
|
---|
152 | $(PATH_LIB)/VBoxXML$(VBOX_SUFF_LIB) \
|
---|
153 | $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB)
|
---|
154 | endif
|
---|
155 | ifdef VBOX_WITH_LIBHAL
|
---|
156 | VBoxSVC_CXXFLAGS += \
|
---|
157 | $(LIB_HAL_CFLAGS)
|
---|
158 | VBoxSVC_LIBPATH += \
|
---|
159 | $(LIB_HAL_LIBPATH)
|
---|
160 | VBoxSVC_LIBS += \
|
---|
161 | $(LIB_HAL_LIBS)
|
---|
162 | VBoxSVC_DEFS += \
|
---|
163 | VBOX_USE_LIBHAL
|
---|
164 | endif
|
---|
165 |
|
---|
166 | VBoxSVC_SOURCES = \
|
---|
167 | Logging.cpp \
|
---|
168 | Matching.cpp \
|
---|
169 | USBDeviceFilterImpl.cpp \
|
---|
170 | USBProxyService.cpp \
|
---|
171 | VirtualBoxBase.cpp \
|
---|
172 | VirtualBoxXMLUtil.cpp \
|
---|
173 | VirtualBoxErrorInfoImpl.cpp \
|
---|
174 | VirtualBoxImpl.cpp \
|
---|
175 | MachineImpl.cpp \
|
---|
176 | SnapshotImpl.cpp \
|
---|
177 | HardDiskImpl.cpp \
|
---|
178 | HardDiskAttachmentImpl.cpp \
|
---|
179 | ProgressImpl.cpp \
|
---|
180 | DVDDriveImpl.cpp \
|
---|
181 | DVDImageImpl.cpp \
|
---|
182 | FloppyDriveImpl.cpp \
|
---|
183 | FloppyImageImpl.cpp \
|
---|
184 | HostImpl.cpp \
|
---|
185 | HostDVDDriveImpl.cpp \
|
---|
186 | HostFloppyDriveImpl.cpp \
|
---|
187 | HostUSBDeviceImpl.cpp \
|
---|
188 | GuestOSTypeImpl.cpp \
|
---|
189 | NetworkAdapterImpl.cpp \
|
---|
190 | USBControllerImpl.cpp \
|
---|
191 | AudioAdapterImpl.cpp \
|
---|
192 | SharedFolderImpl.cpp \
|
---|
193 | SystemPropertiesImpl.cpp \
|
---|
194 | BIOSSettingsImpl.cpp
|
---|
195 |
|
---|
196 | ifdef VBOX_WITH_VRDP
|
---|
197 | VBoxSVC_SOURCES += VRDPServerImpl.cpp
|
---|
198 | endif
|
---|
199 |
|
---|
200 | VBoxSVC_SOURCES.darwin = \
|
---|
201 | darwin/iokit.cpp
|
---|
202 |
|
---|
203 | VBoxSVC_SOURCES.win = \
|
---|
204 | HostNetworkInterfaceImpl.cpp \
|
---|
205 | win32/svcmain.cpp \
|
---|
206 | win32/svchlp.cpp \
|
---|
207 | win32/VBoxSVC.rc
|
---|
208 |
|
---|
209 | ifdef VBOX_WITH_XPCOM
|
---|
210 | VBoxSVC_SOURCES += \
|
---|
211 | linux/server.cpp
|
---|
212 | endif
|
---|
213 |
|
---|
214 | ifdef VBOX_WITH_USB
|
---|
215 | VBoxSVC_SOURCES.darwin += darwin/USBProxyServiceDarwin.cpp
|
---|
216 | VBoxSVC_SOURCES.linux += linux/USBProxyServiceLinux.cpp
|
---|
217 | VBoxSVC_SOURCES.win += win32/USBProxyServiceWin32.cpp
|
---|
218 | endif
|
---|
219 |
|
---|
220 | VBoxSVC_LDFLAGS.darwin = -framework IOKit
|
---|
221 | ifeq ($(BUILD_TYPE),debug)
|
---|
222 | VBoxSVC_LDFLAGS.linux += -rdynamic # for backtrace_symbols()
|
---|
223 | endif
|
---|
224 |
|
---|
225 | #
|
---|
226 | # VBoxSVC wrapper module
|
---|
227 | #
|
---|
228 | ifdef VBOX_WITH_XPCOM
|
---|
229 |
|
---|
230 | VBoxSVCM_TEMPLATE = VBOXMAIN
|
---|
231 | ifneq ($(BUILD_TARGET),linux)
|
---|
232 | VBoxSVCM_INST = $(INST_BIN)components/
|
---|
233 | endif
|
---|
234 | VBoxSVCM_DEFS = IN_RING3 IN_CFGLDR_R3
|
---|
235 | VBoxSVCM_INCS = \
|
---|
236 | include \
|
---|
237 | $(PATH_VBoxC) \
|
---|
238 | $(PATH_VBoxCOM) \
|
---|
239 | $(PATH_CURRENT)
|
---|
240 | VBoxSVCM_SOURCES = \
|
---|
241 | linux/server_module.cpp
|
---|
242 | VBoxSVCM_LIBS = \
|
---|
243 | $(PATH_BIN)/VBoxXPCOM$(VBOX_SUFF_DLL)
|
---|
244 | VBoxSVCM_LDFLAGS.darwin = \
|
---|
245 | -install_name @executable_path/components/VBoxSVCM.dylib \
|
---|
246 | -exported_symbols_list $(PATH_TARGET)/VBoxSVCM.def
|
---|
247 | ifeq ($(BUILD_TARGET),darwin)
|
---|
248 | VBoxSVCM_ORDERDEPS += $(PATH_TARGET)/VBoxSVCM.def
|
---|
249 | VBoxSVCM_CLEAN += $(PATH_TARGET)/VBoxSVCM.def
|
---|
250 | $(PATH_TARGET)/VBoxSVCM.def:
|
---|
251 | $(RM) -f $@
|
---|
252 | $(APPEND) $@ _NSGetModule
|
---|
253 | endif
|
---|
254 |
|
---|
255 | endif # VBOX_WITH_XPCOM
|
---|
256 |
|
---|
257 | #
|
---|
258 | # VBoxC module
|
---|
259 | #
|
---|
260 | VBoxC_TEMPLATE = VBOXMAIN
|
---|
261 | ifneq ($(filter-out linux win,$(BUILD_TARGET)),)
|
---|
262 | VBoxC_INST = $(INST_BIN)components/
|
---|
263 | endif
|
---|
264 | VBoxC_DEFS = IN_RING3 IN_CFGLDR_R3
|
---|
265 | VBoxC_DEFS += VBOX_COM_INPROC
|
---|
266 | ifdef VBOX_WITH_VRDP
|
---|
267 | VBoxC_DEFS += VBOX_VRDP IN_VRDP_R3
|
---|
268 | endif
|
---|
269 | ifdef VBOX_WITH_HGCM
|
---|
270 | VBoxC_DEFS += VBOX_HGCM
|
---|
271 | endif
|
---|
272 | ifdef VBOX_MAIN_RELEASE_LOG
|
---|
273 | VBoxC_DEFS += VBOX_MAIN_RELEASE_LOG LOG_ENABLED
|
---|
274 | endif
|
---|
275 | ifdef VBOX_WITH_USB
|
---|
276 | VBoxC_DEFS += VBOX_WITH_USB
|
---|
277 | endif
|
---|
278 | ifdef VBOX_WITH_ALSA
|
---|
279 | VBoxC_DEFS += VBOX_WITH_ALSA
|
---|
280 | endif
|
---|
281 | ifdef VBOX_WITH_WINMM
|
---|
282 | VBoxC_DEFS += VBOX_WITH_WINMM
|
---|
283 | endif
|
---|
284 | VBoxC_DEFS.win.x86 += _WIN32_WINNT=0x0500
|
---|
285 | VBoxC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
|
---|
286 | VBoxC_INCS = \
|
---|
287 | include \
|
---|
288 | $(PATH_VBoxC) \
|
---|
289 | $(PATH_VBoxCOM)
|
---|
290 | VBoxC_INCS.win := \
|
---|
291 | $(PATH_SUB_CURRENT)
|
---|
292 | VBoxC_LDFLAGS.darwin = \
|
---|
293 | -install_name @executable_path/components/VBoxSVCM.dylib \
|
---|
294 | -exported_symbols_list $(PATH_TARGET)/VBoxC.def
|
---|
295 | ifdef VBOX_USE_VCC80
|
---|
296 | VBoxC_LDFLAGS.win = /MANIFEST
|
---|
297 | endif
|
---|
298 | ifdef VBOX_WITH_XPCOM
|
---|
299 | VBoxC_LIBS = \
|
---|
300 | $(TARGET_VBoxXPCOM) \
|
---|
301 | $(PATH_BIN)/VBoxXPCOM$(VBOX_SUFF_DLL)
|
---|
302 | ifneq ($(BUILD_TARGET),darwin) # Why is a XPCOM component linking with the glue? Because of the old com.cpp?
|
---|
303 | VBoxC_LIBS += $(PATH_LIB)/VBoxXPCOMGlue$(VBOX_SUFF_LIB)
|
---|
304 | endif
|
---|
305 | else
|
---|
306 | VBoxC_LIBS = \
|
---|
307 | $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB)
|
---|
308 | endif
|
---|
309 | VBoxC_LIBS += \
|
---|
310 | $(LIB_VMM) \
|
---|
311 | $(LIB_REM)
|
---|
312 | VBoxC_SOURCES = \
|
---|
313 | Logging.cpp \
|
---|
314 | VBoxDll.cpp \
|
---|
315 | USBDeviceImpl.cpp \
|
---|
316 | RemoteUSBDeviceImpl.cpp \
|
---|
317 | VirtualBoxBase.cpp \
|
---|
318 | VirtualBoxErrorInfoImpl.cpp \
|
---|
319 | ProgressImpl.cpp \
|
---|
320 | SharedFolderImpl.cpp \
|
---|
321 | SessionImpl.cpp \
|
---|
322 | ConsoleImpl.cpp \
|
---|
323 | ConsoleVRDPServer.cpp \
|
---|
324 | GuestImpl.cpp \
|
---|
325 | KeyboardImpl.cpp \
|
---|
326 | MouseImpl.cpp \
|
---|
327 | DisplayImpl.cpp \
|
---|
328 | FramebufferImpl.cpp \
|
---|
329 | MachineDebuggerImpl.cpp \
|
---|
330 | VBoxDriversRegister.cpp \
|
---|
331 | AudioSnifferInterface.cpp \
|
---|
332 | VMMDevInterface.cpp
|
---|
333 | VBoxC_SOURCES.win = \
|
---|
334 | win32/dllmain.cpp \
|
---|
335 | win32/VBoxC.def \
|
---|
336 | win32/VBoxC.rc
|
---|
337 | ifdef VBOX_WITH_XPCOM
|
---|
338 | VBoxC_SOURCES += \
|
---|
339 | linux/module.cpp
|
---|
340 | endif
|
---|
341 |
|
---|
342 | ifdef VBOX_WITH_HGCM
|
---|
343 | VBoxC_SOURCES += \
|
---|
344 | hgcm/HGCMObjects.cpp \
|
---|
345 | hgcm/HGCMThread.cpp \
|
---|
346 | hgcm/HGCM.cpp
|
---|
347 | endif
|
---|
348 |
|
---|
349 | ifdef VBOX_WITH_USB
|
---|
350 | VBoxC_SOURCES += \
|
---|
351 | RemoteUSBBackend.cpp
|
---|
352 | endif
|
---|
353 |
|
---|
354 | ifeq ($(BUILD_TARGET),darwin)
|
---|
355 | VBoxC_ORDERDEPS += $(PATH_TARGET)/VBoxC.def
|
---|
356 | VBoxC_CLEAN += $(PATH_TARGET)/VBoxC.def
|
---|
357 | $(PATH_TARGET)/VBoxC.def: $(MAKEFILE_CURRENT)
|
---|
358 | $(RM) -f $@
|
---|
359 | $(APPEND) $@ _NSGetModule
|
---|
360 | $(APPEND) $@ _VBoxDriversRegister
|
---|
361 | endif
|
---|
362 |
|
---|
363 | #
|
---|
364 | # VBoxXML
|
---|
365 | #
|
---|
366 | VBoxXML_TEMPLATE = VBOXMAIN
|
---|
367 | VBoxXML_SDKS = VBOX_XALAN VBOX_XERCES
|
---|
368 | ## @todo Why do we need this? Why isn't it in the template?!?
|
---|
369 | VBoxXML_CXXFLAGS.win = -EHsc
|
---|
370 | VBoxXML_DEFS = \
|
---|
371 | CFGLDR_HAVE_COM IN_RING3 IN_CFGLDR_R3
|
---|
372 | VBoxXML_INCS = \
|
---|
373 | include \
|
---|
374 | $(PATH_TARGET)
|
---|
375 | VBoxXML_SOURCES = \
|
---|
376 | xml/cfgldr.cpp \
|
---|
377 | xml/cfgldrhlp.cpp
|
---|
378 | ifdef VBOX_WITH_XPCOM
|
---|
379 | VBoxXML_LIBS = \
|
---|
380 | $(TARGET_VBoxXPCOM) \
|
---|
381 | $(PATH_BIN)/VBoxXPCOM$(VBOX_SUFF_DLL)
|
---|
382 | endif
|
---|
383 | VBoxXML_LDFLAGS.darwin = -install_name @executable_path/VBoxXML.dylib -Wl,-x # no debug info please.
|
---|
384 |
|
---|
385 | ## @todo (dmik): temporarily embed SettingsConverter.xsl into VBoxXML,
|
---|
386 | # later it should go to VBoxSVC as well
|
---|
387 | xml/cfgldr.cpp_DEPS = $(PATH_TARGET)/SettingsConverter_xsl.h
|
---|
388 | OTHER_CLEAN += $(PATH_TARGET)/SettingsConverter_xsl.h
|
---|
389 | $(PATH_TARGET)/SettingsConverter_xsl.h: xml/SettingsConverter.xsl $(VBOX_BIN2C) | $(call DIRDEP,$(PATH_TARGET))
|
---|
390 | $(call MSG_TOOL,bin2c,VBoxXML,$<,$@)
|
---|
391 | $(QUIET)$(VBOX_BIN2C) SettingsConverter_xsl $< $@
|
---|
392 |
|
---|
393 |
|
---|
394 | #
|
---|
395 | # tstCFGLdr - broken.
|
---|
396 | #
|
---|
397 | tstCFGLdr_TEMPLATE = VBOXR3
|
---|
398 | tstCFGLdr_SDKS = VBOX_XALAN VBOX_XERCES
|
---|
399 | tstCFGLdr_DEFS = IN_CFGLDR_R3 STANDALONE_TEST
|
---|
400 | ## @todo these makes uncessary noice. fix the template usage!
|
---|
401 | tstCFGLdr_CXXFLAGS.win = -EHsc
|
---|
402 | tstCFGLdr_SOURCES = \
|
---|
403 | xml/cfgldr.cpp \
|
---|
404 | xml/cfgldrhlp.cpp
|
---|
405 | tstCFGLdr_INCS = \
|
---|
406 | include \
|
---|
407 | $(PATH_TARGET)
|
---|
408 | ifdef VBOX_WITH_XPCOM
|
---|
409 | tstCFGLdr_LIBS = \
|
---|
410 | $(PATH_LIB)/VBoxXPCOM$(VBOX_SUFF_LIB)
|
---|
411 | endif
|
---|
412 | tstCFGLdr_LIBS += \
|
---|
413 | $(LIB_RUNTIME)
|
---|
414 |
|
---|
415 |
|
---|
416 | #
|
---|
417 | # VBoxCOM - COM Abstraction Layer library
|
---|
418 | #
|
---|
419 | VBoxCOM_COMMON_SOURCES = \
|
---|
420 | glue/com.cpp \
|
---|
421 | glue/initterm.cpp \
|
---|
422 | glue/string.cpp \
|
---|
423 | glue/EventQueue.cpp \
|
---|
424 | glue/ErrorInfo.cpp
|
---|
425 |
|
---|
426 | VBoxCOM_TEMPLATE = VBOXMAIN
|
---|
427 | VBoxCOM_DEFS.x86 = _WIN32_WINNT=0x0500
|
---|
428 | VBoxCOM_DEFS.amd64 = _WIN32_WINNT=0x0510
|
---|
429 | VBoxCOM_SOURCES = \
|
---|
430 | $(VBoxCOM_COMMON_SOURCES) \
|
---|
431 | $(PATH_VBoxCOM)/VirtualBox_i.c
|
---|
432 |
|
---|
433 |
|
---|
434 | #
|
---|
435 | # VBoxXPCOM
|
---|
436 | #
|
---|
437 | VBoxXPCOM_TEMPLATE = VBOXMAIN
|
---|
438 | VBoxXPCOM_SOURCES = \
|
---|
439 | $(VBoxCOM_COMMON_SOURCES) \
|
---|
440 | linux/helpers.cpp
|
---|
441 | VBoxXPCOM_INCS = \
|
---|
442 | include
|
---|
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)_DEPS = $(PREREQS)
|
---|
457 | endef
|
---|
458 | $(foreach src,\
|
---|
459 | $(VBoxC_SOURCES) $(VBoxC_SOURCES.$(BUILD_TARGET)) \
|
---|
460 | $(VBoxSVC_SOURCES) $(VBoxSVC_SOURCES.$(BUILD_TARGET)) \
|
---|
461 | $(VBoxCOM_COMMON_SOURCES) $(VBoxCOM_SOURCES) $(VBoxXPCOM_SOURCES) \
|
---|
462 | ,$(eval $(value def_src_deps)))
|
---|
463 |
|
---|
464 |
|
---|
465 | #
|
---|
466 | # Embed XML Schema files to VBoxSVC
|
---|
467 | #
|
---|
468 | VBOX_XML_ENTITIES = $(PATH_TARGET)/VirtualBoxXMLUtil_entities.h
|
---|
469 | VBOX_XML_ENTITIES_COMMON = $(PATH_TARGET)/VirtualBoxXMLUtil_common_entities.h
|
---|
470 |
|
---|
471 | VBOX_XML_SCHEMA_COMMON = xml/VirtualBox-settings-common.xsd
|
---|
472 | VBOX_XML_SCHEMA.darwin = xml/VirtualBox-settings-macosx.xsd
|
---|
473 | VBOX_XML_SCHEMA.linux = xml/VirtualBox-settings-linux.xsd
|
---|
474 | VBOX_XML_SCHEMA.win = xml/VirtualBox-settings-windows.xsd
|
---|
475 |
|
---|
476 | VirtualBoxXMLUtil.cpp_DEPS = $(VBOX_XML_ENTITIES) $(VBOX_XML_ENTITIES_COMMON)
|
---|
477 |
|
---|
478 | $(VBOX_XML_ENTITIES_COMMON): $(VBOX_XML_SCHEMA_COMMON) $(VBOX_BIN2C)
|
---|
479 | $(call MSG_TOOL,bin2c,VBoxXML,$<,$@)
|
---|
480 | $(QUIET)$(VBOX_BIN2C) VirtualBox_settings_common_xsd $< $@
|
---|
481 |
|
---|
482 | $(VBOX_XML_ENTITIES): $(VBOX_XML_SCHEMA.$(BUILD_TARGET)) $(VBOX_BIN2C)
|
---|
483 | $(call MSG_TOOL,bin2c,VBoxXML,$<,$@)
|
---|
484 | $(QUIET)$(VBOX_BIN2C) VirtualBox_settings_xsd $< $@
|
---|
485 |
|
---|
486 | OTHER_CLEAN += $(VBOX_XML_ENTITIES) $(VBOX_XML_ENTITIES_COMMON)
|
---|
487 |
|
---|
488 |
|
---|
489 | #
|
---|
490 | # Generate SchemaDefs.h from XML Schema
|
---|
491 | #
|
---|
492 | VBOX_XML_SCHEMADEFS_H = $(PATH_TARGET)/SchemaDefs.h
|
---|
493 | VBOX_XML_SCHEMADEFS_XSL = xml/SchemaDefs.xsl
|
---|
494 |
|
---|
495 | VBoxC_DEPS += $(VBOX_XML_SCHEMADEFS_H)
|
---|
496 | VBoxC_INCS += $(PATH_TARGET)
|
---|
497 | VBoxSVC_DEPS += $(VBOX_XML_SCHEMADEFS_H)
|
---|
498 | VBoxSVC_INCS += $(PATH_TARGET)
|
---|
499 |
|
---|
500 | $(VBOX_XML_SCHEMADEFS_H): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(BUILD_TARGET)) $(VBOX_XML_SCHEMA_COMMON)
|
---|
501 | $(call MSG_TOOL,xsltproc,VBoxXML,$<,$@)
|
---|
502 | $(QUIET)$(VBOX_XSLTPROC) -o $@ $(filter-out $(VBOX_XML_SCHEMA_COMMON),$^)
|
---|
503 |
|
---|
504 | OTHER_CLEAN += $(VBOX_XML_SCHEMADEFS_H)
|
---|
505 | .NOTPARALLEL: $(VBOX_XML_SCHEMADEFS_H)
|
---|
506 |
|
---|
507 |
|
---|
508 |
|
---|
509 | #
|
---|
510 | # Creates the symlinks necessary for making XPCOM work.
|
---|
511 | #
|
---|
512 | ## @todo Figure out why Linux really needs this, darwin doesn't...
|
---|
513 | xpcom-components_INST = $(INST_BIN)components/
|
---|
514 | ifeq ($(BUILD_TARGET),linux)
|
---|
515 | xpcom-components_SYMLINKS = \
|
---|
516 | VirtualBox_XPCOM.xpt=>../VirtualBox_XPCOM.xpt \
|
---|
517 | VBoxXPCOMBase.xpt=>../VBoxXPCOMBase.xpt \
|
---|
518 | VBoxC$(SUFF_DLL)=>../VBoxC$(SUFF_DLL) \
|
---|
519 | VBoxSVCM$(SUFF_DLL)=>../VBoxSVCM$(SUFF_DLL) \
|
---|
520 | VBoxXPCOMIPCC$(SUFF_DLL)=>../VBoxXPCOMIPCC$(SUFF_DLL)
|
---|
521 | endif
|
---|
522 |
|
---|
523 | # generate
|
---|
524 | include $(PATH_KBUILD)/footer.kmk
|
---|
525 |
|
---|
526 |
|
---|
527 | #
|
---|
528 | # Additions rules.
|
---|
529 | #
|
---|
530 |
|
---|
531 | XIDLFILE = idl/VirtualBox.xidl
|
---|
532 |
|
---|
533 | ifneq ($(BUILD_TARGET),win)
|
---|
534 |
|
---|
535 | linux/helpers.cpp: $(IDLTYPELIB)
|
---|
536 |
|
---|
537 | $(IDLFILE): idl/xpidl.xsl $(XIDLFILE) | $(call DIRDEP,$(dir $(IDLFILE)))
|
---|
538 | $(call MSG_TOOL,xsltproc,VBoxXML,$<,$@)
|
---|
539 | $(QUIET)$(MKDIR) -p $(@D)
|
---|
540 | $(QUIET)$(VBOX_XSLTPROC) -o $@ $^
|
---|
541 |
|
---|
542 | $(IDLTYPELIB): $(IDLFILE) | $(call DIRDEP,$(dir $(IDLTYPELIB)))
|
---|
543 | $(call MSG_TOOL,xpidl,VBoxXML,$<,$@)
|
---|
544 | $(QUIET)$(VBOX_XPIDL) -m typelib -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
|
---|
545 |
|
---|
546 | $(IDLHEADER): $(IDLFILE) | $(call DIRDEP,$(dir $(IDLHEADER)))
|
---|
547 | $(call MSG_TOOL,xpidl,VBoxXML,$<,$@)
|
---|
548 | $(QUIET)$(VBOX_XPIDL) -m header -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
|
---|
549 |
|
---|
550 | else
|
---|
551 |
|
---|
552 | MAIN_IDL ?= $(EXEC_X86_WIN32) $(firstword $(wildcard \
|
---|
553 | $(PATH_SDK_WINPSDK_BIN)/Midl.Exe\
|
---|
554 | $(PATH_SDK_WINPSDK)/Bin/Midl.Exe\
|
---|
555 | $(PATH_DEVTOOLS)/win.x86/bin/midl.exe\
|
---|
556 | ) Sorry_Cannot_Find_The_Midl_Compiler_In_The_PSDK)
|
---|
557 | IDL_DEFS = /nologo
|
---|
558 | ifdef VBOX_WITH_VRDP
|
---|
559 | IDL_DEFS += /D VBOX_VRDP
|
---|
560 | endif
|
---|
561 |
|
---|
562 | $(IDLFILE): idl/midl.xsl $(XIDLFILE)
|
---|
563 | $(call MSG_TOOL,xsltproc,VBoxXML,$<,$@)
|
---|
564 | $(QUIET)$(MKDIR) -p $(VBOX_PATH_SDK)/idl
|
---|
565 | $(QUIET)$(VBOX_XSLTPROC) -o $@ $^
|
---|
566 |
|
---|
567 | ## @todo r=bird: last changes to this rule showed incorrect dependencies here as it broke testcase (see testboxwin2).
|
---|
568 | # This is kind of obvious when looking at the rule, because it's (a) not specifing all it output
|
---|
569 | # and (b) generating more stuff *after* the maintarget has been completed.
|
---|
570 | #
|
---|
571 | # What needs to be done is to not depend on _i.c in the object subdir, but on all the final outputs.
|
---|
572 | $(PATH_VBoxCOM)/VirtualBox_i.c: $(IDLFILE) | $(call DIRDEP,$(PATH_VBoxCOM))
|
---|
573 | $(MAIN_IDL) $(IDL_DEFS) \
|
---|
574 | /out $(subst /,\\,$(PATH_VBoxCOM)) \
|
---|
575 | /cpp_cmd $(subst /,\\,$(TOOL_$(VBOX_VCC_TOOL)_CC)) \
|
---|
576 | /I $(subst /,\\,$(PATH_SDK_WINPSDK_INC)) \
|
---|
577 | /I idl \
|
---|
578 | $(subst /,\\,$<)
|
---|
579 | $(MKDIR) -p $(VBOX_PATH_SDK)/include
|
---|
580 | $(CP) $(PATH_VBoxCOM)/VirtualBox.h $(VBOX_PATH_SDK)/include
|
---|
581 | $(MKDIR) -p $(VBOX_PATH_SDK)/lib
|
---|
582 | $(CP) $(PATH_VBoxCOM)/VirtualBox.tlb $(VBOX_PATH_SDK)/lib
|
---|
583 | $(CP) $(PATH_VBoxCOM)/VirtualBox_i.c $(VBOX_PATH_SDK)/lib
|
---|
584 |
|
---|
585 | endif
|
---|
586 |
|
---|
587 | # bird: anyone still using this? If not it's a gonner.
|
---|
588 | ## Hack to work around wine's trouble with midl.exe and rc.exe (seems to be msvcrt.dll related)
|
---|
589 | #gen: $(PREREQS)
|
---|
590 |
|
---|
591 |
|
---|
592 | #
|
---|
593 | # Translation stuff
|
---|
594 | #
|
---|
595 | VBoxSVC_HEADERS = \
|
---|
596 | include/collection.h \
|
---|
597 | include/MachineImpl.h \
|
---|
598 | include/HostDVDDriveImpl.h \
|
---|
599 | include/HostFloppyDriveImpl.h
|
---|
600 |
|
---|
601 | VBoxC_HEADERS = \
|
---|
602 | include/ConsoleImpl.h
|
---|
603 |
|
---|
604 | VBoxSVC_TRANSLATIONS = \
|
---|
605 | nls/VBoxSVC_de.ts
|
---|
606 |
|
---|
607 | VBoxC_TRANSLATIONS = \
|
---|
608 | nls/VBoxC_de.ts
|
---|
609 |
|
---|
610 | updatenls:
|
---|
611 | $(VBOX_LUPDATE) $(VBoxSVC_SOURCES) $(VBoxSVC_HEADERS) -ts $(VBoxSVC_TRANSLATIONS)
|
---|
612 | $(VBOX_LUPDATE) $(VBoxC_SOURCES) $(VBoxC_HEADERS) -ts $(VBoxC_TRANSLATIONS)
|
---|
613 |
|
---|
614 | ifdef VBOX_WITH_XPCOM
|
---|
615 |
|
---|
616 | testidl: $(IDLFILE) $(IDLTYPELIB)
|
---|
617 | testidlhdr: $(IDLHEADER)
|
---|
618 |
|
---|
619 | else
|
---|
620 |
|
---|
621 | testidl: $(IDLFILE) $(PATH_VBoxCOM)/VirtualBox_i.c
|
---|
622 |
|
---|
623 | endif
|
---|
624 |
|
---|
625 | $(PATH_BIN)/comregister.cmd: win32/comregister.cmd
|
---|
626 | $(CP) $< $@
|
---|
627 |
|
---|
628 |
|
---|
629 | # Hot fix when dependencies goes bad again...
|
---|
630 | #.NOTPARALLEL: $(TARGET_VBoxC) $(TARGET_VBoxSVC) $(TARGET_VBoxXPCOM) $(TARGET_VBoxCOM) $(IDLHEADER) $(IDLFILE) $(PATH_VBoxCOM)/VirtualBox_i.c
|
---|
631 |
|
---|