1 | # $Id: Makefile.kmk 2587 2007-05-11 03:12:27Z 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 | VBoxSVC_SOURCES = \
|
---|
156 | Logging.cpp \
|
---|
157 | Matching.cpp \
|
---|
158 | USBDeviceFilterImpl.cpp \
|
---|
159 | USBProxyService.cpp \
|
---|
160 | VirtualBoxBase.cpp \
|
---|
161 | VirtualBoxXMLUtil.cpp \
|
---|
162 | VirtualBoxErrorInfoImpl.cpp \
|
---|
163 | VirtualBoxImpl.cpp \
|
---|
164 | MachineImpl.cpp \
|
---|
165 | SnapshotImpl.cpp \
|
---|
166 | HardDiskImpl.cpp \
|
---|
167 | HardDiskAttachmentImpl.cpp \
|
---|
168 | ProgressImpl.cpp \
|
---|
169 | DVDDriveImpl.cpp \
|
---|
170 | DVDImageImpl.cpp \
|
---|
171 | FloppyDriveImpl.cpp \
|
---|
172 | FloppyImageImpl.cpp \
|
---|
173 | HostImpl.cpp \
|
---|
174 | HostDVDDriveImpl.cpp \
|
---|
175 | HostFloppyDriveImpl.cpp \
|
---|
176 | HostUSBDeviceImpl.cpp \
|
---|
177 | GuestOSTypeImpl.cpp \
|
---|
178 | NetworkAdapterImpl.cpp \
|
---|
179 | USBControllerImpl.cpp \
|
---|
180 | AudioAdapterImpl.cpp \
|
---|
181 | SharedFolderImpl.cpp \
|
---|
182 | SystemPropertiesImpl.cpp \
|
---|
183 | BIOSSettingsImpl.cpp
|
---|
184 |
|
---|
185 | ifdef VBOX_WITH_VRDP
|
---|
186 | VBoxSVC_SOURCES += VRDPServerImpl.cpp
|
---|
187 | endif
|
---|
188 |
|
---|
189 | VBoxSVC_SOURCES.darwin = \
|
---|
190 | darwin/iokit.cpp
|
---|
191 |
|
---|
192 | VBoxSVC_SOURCES.win = \
|
---|
193 | HostNetworkInterfaceImpl.cpp \
|
---|
194 | win32/svcmain.cpp \
|
---|
195 | win32/svchlp.cpp \
|
---|
196 | win32/VBoxSVC.rc
|
---|
197 |
|
---|
198 | ifdef VBOX_WITH_XPCOM
|
---|
199 | VBoxSVC_SOURCES += \
|
---|
200 | linux/server.cpp
|
---|
201 | endif
|
---|
202 |
|
---|
203 | ifdef VBOX_WITH_USB
|
---|
204 | VBoxSVC_SOURCES.darwin += darwin/USBProxyServiceDarwin.cpp
|
---|
205 | VBoxSVC_SOURCES.linux += linux/USBProxyServiceLinux.cpp
|
---|
206 | VBoxSVC_SOURCES.win += win32/USBProxyServiceWin32.cpp
|
---|
207 | endif
|
---|
208 |
|
---|
209 | VBoxSVC_LDFLAGS.darwin = -framework IOKit
|
---|
210 | ifeq ($(BUILD_TYPE),debug)
|
---|
211 | VBoxSVC_LDFLAGS.linux += -rdynamic # for backtrace_symbols()
|
---|
212 | endif
|
---|
213 |
|
---|
214 | #
|
---|
215 | # VBoxSVC wrapper module
|
---|
216 | #
|
---|
217 | ifdef VBOX_WITH_XPCOM
|
---|
218 |
|
---|
219 | VBoxSVCM_TEMPLATE = VBOXMAIN
|
---|
220 | ifneq ($(BUILD_TARGET),linux)
|
---|
221 | VBoxSVCM_INST = $(INST_BIN)components/
|
---|
222 | endif
|
---|
223 | VBoxSVCM_DEFS = IN_RING3 IN_CFGLDR_R3
|
---|
224 | VBoxSVCM_INCS = \
|
---|
225 | include \
|
---|
226 | $(PATH_VBoxC) \
|
---|
227 | $(PATH_VBoxCOM) \
|
---|
228 | $(PATH_CURRENT)
|
---|
229 | VBoxSVCM_SOURCES = \
|
---|
230 | linux/server_module.cpp
|
---|
231 | VBoxSVCM_LIBS = \
|
---|
232 | $(PATH_BIN)/VBoxXPCOM$(VBOX_SUFF_DLL)
|
---|
233 | VBoxSVCM_LDFLAGS.darwin = -install_name @executable_path/components/VBoxSVCM.dylib
|
---|
234 |
|
---|
235 | endif # VBOX_WITH_XPCOM
|
---|
236 |
|
---|
237 | #
|
---|
238 | # VBoxC module
|
---|
239 | #
|
---|
240 | VBoxC_TEMPLATE = VBOXMAIN
|
---|
241 | ifneq ($(filter-out linux win,$(BUILD_TARGET)),)
|
---|
242 | VBoxC_INST = $(INST_BIN)components/
|
---|
243 | endif
|
---|
244 | VBoxC_DEFS = IN_RING3 IN_CFGLDR_R3
|
---|
245 | VBoxC_DEFS += VBOX_COM_INPROC
|
---|
246 | ifdef VBOX_WITH_VRDP
|
---|
247 | VBoxC_DEFS += VBOX_VRDP IN_VRDP_R3
|
---|
248 | endif
|
---|
249 | ifdef VBOX_WITH_HGCM
|
---|
250 | VBoxC_DEFS += VBOX_HGCM
|
---|
251 | endif
|
---|
252 | ifdef VBOX_MAIN_RELEASE_LOG
|
---|
253 | VBoxC_DEFS += VBOX_MAIN_RELEASE_LOG LOG_ENABLED
|
---|
254 | endif
|
---|
255 | ifdef VBOX_WITH_USB
|
---|
256 | VBoxC_DEFS += VBOX_WITH_USB
|
---|
257 | endif
|
---|
258 | ifdef VBOX_WITH_ALSA
|
---|
259 | VBoxC_DEFS += VBOX_WITH_ALSA
|
---|
260 | endif
|
---|
261 | ifdef VBOX_WITH_WINMM
|
---|
262 | VBoxC_DEFS += VBOX_WITH_WINMM
|
---|
263 | endif
|
---|
264 | VBoxC_DEFS.win.x86 += _WIN32_WINNT=0x0500
|
---|
265 | VBoxC_DEFS.win.amd64 += _WIN32_WINNT=0x0510
|
---|
266 | VBoxC_INCS = \
|
---|
267 | include \
|
---|
268 | $(PATH_VBoxC) \
|
---|
269 | $(PATH_VBoxCOM)
|
---|
270 | VBoxC_INCS.win := \
|
---|
271 | $(PATH_SUB_CURRENT)
|
---|
272 | VBoxC_LDFLAGS.darwin = -install_name @executable_path/components/VBoxC.dylib
|
---|
273 | ifdef VBOX_USE_VCC80
|
---|
274 | VBoxC_LDFLAGS.win = /MANIFEST
|
---|
275 | endif
|
---|
276 | ifdef VBOX_WITH_XPCOM
|
---|
277 | VBoxC_LIBS = \
|
---|
278 | $(TARGET_VBoxXPCOM) \
|
---|
279 | $(PATH_BIN)/VBoxXPCOM$(VBOX_SUFF_DLL) \
|
---|
280 | $(PATH_LIB)/VBoxXPCOMGlue$(VBOX_SUFF_LIB)
|
---|
281 | else
|
---|
282 | VBoxC_LIBS = \
|
---|
283 | $(PATH_LIB)/VBoxCOM$(VBOX_SUFF_LIB)
|
---|
284 | endif
|
---|
285 | VBoxC_LIBS += \
|
---|
286 | $(LIB_VMM) \
|
---|
287 | $(LIB_REM)
|
---|
288 | VBoxC_SOURCES = \
|
---|
289 | Logging.cpp \
|
---|
290 | VBoxDll.cpp \
|
---|
291 | USBDeviceImpl.cpp \
|
---|
292 | RemoteUSBDeviceImpl.cpp \
|
---|
293 | VirtualBoxBase.cpp \
|
---|
294 | VirtualBoxErrorInfoImpl.cpp \
|
---|
295 | ProgressImpl.cpp \
|
---|
296 | SharedFolderImpl.cpp \
|
---|
297 | SessionImpl.cpp \
|
---|
298 | ConsoleImpl.cpp \
|
---|
299 | ConsoleVRDPServer.cpp \
|
---|
300 | GuestImpl.cpp \
|
---|
301 | KeyboardImpl.cpp \
|
---|
302 | MouseImpl.cpp \
|
---|
303 | DisplayImpl.cpp \
|
---|
304 | FramebufferImpl.cpp \
|
---|
305 | MachineDebuggerImpl.cpp \
|
---|
306 | VBoxDriversRegister.cpp \
|
---|
307 | AudioSnifferInterface.cpp \
|
---|
308 | VMMDevInterface.cpp
|
---|
309 | VBoxC_SOURCES.win = \
|
---|
310 | win32/dllmain.cpp \
|
---|
311 | win32/VBoxC.def \
|
---|
312 | win32/VBoxC.rc
|
---|
313 | ifdef VBOX_WITH_XPCOM
|
---|
314 | VBoxC_SOURCES += \
|
---|
315 | linux/module.cpp
|
---|
316 | endif
|
---|
317 |
|
---|
318 | ifdef VBOX_WITH_HGCM
|
---|
319 | VBoxC_SOURCES += \
|
---|
320 | hgcm/HGCMObjects.cpp \
|
---|
321 | hgcm/HGCMThread.cpp \
|
---|
322 | hgcm/HGCM.cpp
|
---|
323 | endif
|
---|
324 |
|
---|
325 | ifdef VBOX_WITH_USB
|
---|
326 | VBoxC_SOURCES += \
|
---|
327 | RemoteUSBBackend.cpp
|
---|
328 | endif
|
---|
329 |
|
---|
330 |
|
---|
331 | #
|
---|
332 | # VBoxXML
|
---|
333 | #
|
---|
334 | VBoxXML_TEMPLATE = VBOXMAIN
|
---|
335 | VBoxXML_SDKS = VBOX_XALAN VBOX_XERCES
|
---|
336 | ## @todo Why do we need this? Why isn't it in the template?!?
|
---|
337 | VBoxXML_CXXFLAGS.win = -EHsc
|
---|
338 | VBoxXML_DEFS = \
|
---|
339 | CFGLDR_HAVE_COM IN_RING3 IN_CFGLDR_R3
|
---|
340 | VBoxXML_INCS = \
|
---|
341 | include \
|
---|
342 | $(PATH_TARGET)
|
---|
343 | VBoxXML_SOURCES = \
|
---|
344 | xml/cfgldr.cpp \
|
---|
345 | xml/cfgldrhlp.cpp
|
---|
346 | ifdef VBOX_WITH_XPCOM
|
---|
347 | VBoxXML_LIBS = \
|
---|
348 | $(TARGET_VBoxXPCOM) \
|
---|
349 | $(PATH_BIN)/VBoxXPCOM$(VBOX_SUFF_DLL)
|
---|
350 | endif
|
---|
351 | VBoxXML_LDFLAGS.darwin = -install_name @executable_path/VBoxXML.dylib -Wl,-x # no debug info please.
|
---|
352 |
|
---|
353 | ## @todo (dmik): temporarily embed SettingsConverter.xsl into VBoxXML,
|
---|
354 | # later it should go to VBoxSVC as well
|
---|
355 | xml/cfgldr.cpp_DEPS = $(PATH_TARGET)/SettingsConverter_xsl.h
|
---|
356 | OTHER_CLEAN += $(PATH_TARGET)/SettingsConverter_xsl.h
|
---|
357 | $(PATH_TARGET)/SettingsConverter_xsl.h: xml/SettingsConverter.xsl $(VBOX_BIN2C) | $(call DIRDEP,$(PATH_TARGET))
|
---|
358 | $(call MSG_TOOL,bin2c,VBoxXML,$<,$@)
|
---|
359 | $(QUIET)$(VBOX_BIN2C) SettingsConverter_xsl $< $@
|
---|
360 |
|
---|
361 |
|
---|
362 | #
|
---|
363 | # tstCFGLdr - broken.
|
---|
364 | #
|
---|
365 | tstCFGLdr_TEMPLATE = VBOXR3
|
---|
366 | tstCFGLdr_SDKS = VBOX_XALAN VBOX_XERCES
|
---|
367 | tstCFGLdr_DEFS = IN_CFGLDR_R3 STANDALONE_TEST
|
---|
368 | ## @todo these makes uncessary noice. fix the template usage!
|
---|
369 | tstCFGLdr_CXXFLAGS.win = -EHsc
|
---|
370 | tstCFGLdr_SOURCES = \
|
---|
371 | xml/cfgldr.cpp \
|
---|
372 | xml/cfgldrhlp.cpp
|
---|
373 | tstCFGLdr_INCS = \
|
---|
374 | include \
|
---|
375 | $(PATH_TARGET)
|
---|
376 | ifdef VBOX_WITH_XPCOM
|
---|
377 | tstCFGLdr_LIBS = \
|
---|
378 | $(PATH_LIB)/VBoxXPCOM$(VBOX_SUFF_LIB)
|
---|
379 | endif
|
---|
380 | tstCFGLdr_LIBS += \
|
---|
381 | $(LIB_RUNTIME)
|
---|
382 |
|
---|
383 |
|
---|
384 | #
|
---|
385 | # VBoxCOM - COM Abstraction Layer library
|
---|
386 | #
|
---|
387 | VBoxCOM_COMMON_SOURCES = \
|
---|
388 | glue/com.cpp \
|
---|
389 | glue/string.cpp \
|
---|
390 | glue/EventQueue.cpp \
|
---|
391 | glue/ErrorInfo.cpp
|
---|
392 |
|
---|
393 | VBoxCOM_TEMPLATE = VBOXMAIN
|
---|
394 | VBoxCOM_DEFS.x86 = _WIN32_WINNT=0x0500
|
---|
395 | VBoxCOM_DEFS.amd64 = _WIN32_WINNT=0x0510
|
---|
396 | VBoxCOM_SOURCES = \
|
---|
397 | $(VBoxCOM_COMMON_SOURCES) \
|
---|
398 | $(PATH_VBoxCOM)/VirtualBox_i.c
|
---|
399 |
|
---|
400 |
|
---|
401 | #
|
---|
402 | # VBoxXPCOM
|
---|
403 | #
|
---|
404 | VBoxXPCOM_TEMPLATE = VBOXMAIN
|
---|
405 | VBoxXPCOM_SOURCES = \
|
---|
406 | $(VBoxCOM_COMMON_SOURCES) \
|
---|
407 | linux/helpers.cpp
|
---|
408 | VBoxXPCOM_INCS = \
|
---|
409 | include
|
---|
410 |
|
---|
411 |
|
---|
412 | #
|
---|
413 | # Generate _DEPS on all sources which depends on generated headers.
|
---|
414 | #
|
---|
415 | ifeq ($(BUILD_TARGET),win)
|
---|
416 | PREREQS = $(PATH_VBoxCOM)/VirtualBox_i.c
|
---|
417 | else
|
---|
418 | PREREQS = $(IDLTYPELIB) $(IDLHEADER)
|
---|
419 | endif
|
---|
420 |
|
---|
421 | # brute force way to ensure the prereqs are generated before anything is compiled.
|
---|
422 | define def_src_deps
|
---|
423 | $(src)_DEPS = $(PREREQS)
|
---|
424 | endef
|
---|
425 | $(foreach src,\
|
---|
426 | $(VBoxC_SOURCES) $(VBoxC_SOURCES.$(BUILD_TARGET)) \
|
---|
427 | $(VBoxSVC_SOURCES) $(VBoxSVC_SOURCES.$(BUILD_TARGET)) \
|
---|
428 | $(VBoxCOM_COMMON_SOURCES) $(VBoxCOM_SOURCES) $(VBoxXPCOM_SOURCES) \
|
---|
429 | ,$(eval $(value def_src_deps)))
|
---|
430 |
|
---|
431 |
|
---|
432 | #
|
---|
433 | # Embed XML Schema files to VBoxSVC
|
---|
434 | #
|
---|
435 | VBOX_XML_ENTITIES = $(PATH_TARGET)/VirtualBoxXMLUtil_entities.h
|
---|
436 | VBOX_XML_ENTITIES_COMMON = $(PATH_TARGET)/VirtualBoxXMLUtil_common_entities.h
|
---|
437 |
|
---|
438 | VBOX_XML_SCHEMA_COMMON = xml/VirtualBox-settings-common.xsd
|
---|
439 | VBOX_XML_SCHEMA.darwin = xml/VirtualBox-settings-macosx.xsd
|
---|
440 | VBOX_XML_SCHEMA.linux = xml/VirtualBox-settings-linux.xsd
|
---|
441 | VBOX_XML_SCHEMA.win = xml/VirtualBox-settings-windows.xsd
|
---|
442 |
|
---|
443 | VirtualBoxXMLUtil.cpp_DEPS = $(VBOX_XML_ENTITIES) $(VBOX_XML_ENTITIES_COMMON)
|
---|
444 |
|
---|
445 | $(VBOX_XML_ENTITIES_COMMON): $(VBOX_XML_SCHEMA_COMMON) $(VBOX_BIN2C)
|
---|
446 | $(call MSG_TOOL,bin2c,VBoxXML,$<,$@)
|
---|
447 | $(QUIET)$(VBOX_BIN2C) VirtualBox_settings_common_xsd $< $@
|
---|
448 |
|
---|
449 | $(VBOX_XML_ENTITIES): $(VBOX_XML_SCHEMA.$(BUILD_TARGET)) $(VBOX_BIN2C)
|
---|
450 | $(call MSG_TOOL,bin2c,VBoxXML,$<,$@)
|
---|
451 | $(QUIET)$(VBOX_BIN2C) VirtualBox_settings_xsd $< $@
|
---|
452 |
|
---|
453 | OTHER_CLEAN += $(VBOX_XML_ENTITIES) $(VBOX_XML_ENTITIES_COMMON)
|
---|
454 |
|
---|
455 |
|
---|
456 | #
|
---|
457 | # Generate SchemaDefs.h from XML Schema
|
---|
458 | #
|
---|
459 | VBOX_XML_SCHEMADEFS_H = $(PATH_TARGET)/SchemaDefs.h
|
---|
460 | VBOX_XML_SCHEMADEFS_XSL = xml/SchemaDefs.xsl
|
---|
461 |
|
---|
462 | VBoxC_DEPS += $(VBOX_XML_SCHEMADEFS_H)
|
---|
463 | VBoxC_INCS += $(PATH_TARGET)
|
---|
464 | VBoxSVC_DEPS += $(VBOX_XML_SCHEMADEFS_H)
|
---|
465 | VBoxSVC_INCS += $(PATH_TARGET)
|
---|
466 |
|
---|
467 | $(VBOX_XML_SCHEMADEFS_H): $(VBOX_XML_SCHEMADEFS_XSL) $(VBOX_XML_SCHEMA.$(BUILD_TARGET)) $(VBOX_XML_SCHEMA_COMMON)
|
---|
468 | $(call MSG_TOOL,xsltproc,VBoxXML,$<,$@)
|
---|
469 | $(QUIET)$(VBOX_XSLTPROC) -o $@ $(filter-out $(VBOX_XML_SCHEMA_COMMON),$^)
|
---|
470 |
|
---|
471 | OTHER_CLEAN += $(VBOX_XML_SCHEMADEFS_H)
|
---|
472 | .NOTPARALLEL: $(VBOX_XML_SCHEMADEFS_H)
|
---|
473 |
|
---|
474 |
|
---|
475 |
|
---|
476 | #
|
---|
477 | # Creates the symlinks necessary for making XPCOM work.
|
---|
478 | #
|
---|
479 | ## @todo Figure out why Linux really needs this, darwin doesn't...
|
---|
480 | xpcom-components_INST = $(INST_BIN)components/
|
---|
481 | ifeq ($(BUILD_TARGET),linux)
|
---|
482 | xpcom-components_SYMLINKS = \
|
---|
483 | VirtualBox_XPCOM.xpt=>../VirtualBox_XPCOM.xpt \
|
---|
484 | VBoxXPCOMBase.xpt=>../VBoxXPCOMBase.xpt \
|
---|
485 | VBoxC$(SUFF_DLL)=>../VBoxC$(SUFF_DLL) \
|
---|
486 | VBoxSVCM$(SUFF_DLL)=>../VBoxSVCM$(SUFF_DLL) \
|
---|
487 | VBoxXPCOMIPCC$(SUFF_DLL)=>../VBoxXPCOMIPCC$(SUFF_DLL)
|
---|
488 | endif
|
---|
489 |
|
---|
490 |
|
---|
491 | # generate
|
---|
492 | include $(PATH_KBUILD)/footer.kmk
|
---|
493 |
|
---|
494 |
|
---|
495 | #
|
---|
496 | # Additions rules.
|
---|
497 | #
|
---|
498 |
|
---|
499 | XIDLFILE = idl/VirtualBox.xidl
|
---|
500 |
|
---|
501 | ifneq ($(BUILD_TARGET),win)
|
---|
502 |
|
---|
503 | linux/helpers.cpp: $(IDLTYPELIB)
|
---|
504 |
|
---|
505 | $(IDLFILE): idl/xpidl.xsl $(XIDLFILE) | $(call DIRDEP,$(dir $(IDLFILE)))
|
---|
506 | $(call MSG_TOOL,xsltproc,VBoxXML,$<,$@)
|
---|
507 | $(QUIET)$(MKDIR) -p $(@D)
|
---|
508 | $(QUIET)$(VBOX_XSLTPROC) -o $@ $^
|
---|
509 |
|
---|
510 | $(IDLTYPELIB): $(IDLFILE) | $(call DIRDEP,$(dir $(IDLTYPELIB)))
|
---|
511 | $(call MSG_TOOL,xpidl,VBoxXML,$<,$@)
|
---|
512 | $(QUIET)$(VBOX_XPIDL) -m typelib -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
|
---|
513 |
|
---|
514 | $(IDLHEADER): $(IDLFILE) | $(call DIRDEP,$(dir $(IDLHEADER)))
|
---|
515 | $(call MSG_TOOL,xpidl,VBoxXML,$<,$@)
|
---|
516 | $(QUIET)$(VBOX_XPIDL) -m header -I $(VBOX_PATH_XPCOM_IDL) -e $@ $<
|
---|
517 |
|
---|
518 | else
|
---|
519 |
|
---|
520 | MAIN_IDL ?= $(EXEC_X86_WIN32) $(firstword $(wildcard \
|
---|
521 | $(PATH_SDK_WINPSDK_BIN)/Midl.Exe\
|
---|
522 | $(PATH_SDK_WINPSDK)/Bin/Midl.Exe\
|
---|
523 | $(PATH_DEVTOOLS)/win.x86/bin/midl.exe\
|
---|
524 | ) Sorry_Cannot_Find_The_Midl_Compiler_In_The_PSDK)
|
---|
525 | IDL_DEFS = /nologo
|
---|
526 | ifdef VBOX_WITH_VRDP
|
---|
527 | IDL_DEFS += /D VBOX_VRDP
|
---|
528 | endif
|
---|
529 |
|
---|
530 | $(IDLFILE): idl/midl.xsl $(XIDLFILE)
|
---|
531 | $(call MSG_TOOL,xsltproc,VBoxXML,$<,$@)
|
---|
532 | $(QUIET)$(MKDIR) -p $(VBOX_PATH_SDK)/idl
|
---|
533 | $(QUIET)$(VBOX_XSLTPROC) -o $@ $^
|
---|
534 |
|
---|
535 | ## @todo r=bird: last changes to this rule showed incorrect dependencies here as it broke testcase (see testboxwin2).
|
---|
536 | # This is kind of obvious when looking at the rule, because it's (a) not specifing all it output
|
---|
537 | # and (b) generating more stuff *after* the maintarget has been completed.
|
---|
538 | #
|
---|
539 | # What needs to be done is to not depend on _i.c in the object subdir, but on all the final outputs.
|
---|
540 | $(PATH_VBoxCOM)/VirtualBox_i.c: $(IDLFILE) | $(call DIRDEP,$(PATH_VBoxCOM))
|
---|
541 | $(MAIN_IDL) $(IDL_DEFS) \
|
---|
542 | /out $(subst /,\\,$(PATH_VBoxCOM)) \
|
---|
543 | /cpp_cmd $(subst /,\\,$(TOOL_$(VBOX_VCC_TOOL)_CC)) \
|
---|
544 | /I $(subst /,\\,$(PATH_SDK_WINPSDK_INC)) \
|
---|
545 | /I idl \
|
---|
546 | $(subst /,\\,$<)
|
---|
547 | $(MKDIR) -p $(VBOX_PATH_SDK)/include
|
---|
548 | $(CP) $(PATH_VBoxCOM)/VirtualBox.h $(VBOX_PATH_SDK)/include
|
---|
549 | $(MKDIR) -p $(VBOX_PATH_SDK)/lib
|
---|
550 | $(CP) $(PATH_VBoxCOM)/VirtualBox.tlb $(VBOX_PATH_SDK)/lib
|
---|
551 | $(CP) $(PATH_VBoxCOM)/VirtualBox_i.c $(VBOX_PATH_SDK)/lib
|
---|
552 |
|
---|
553 | endif
|
---|
554 |
|
---|
555 | # bird: anyone still using this? If not it's a gonner.
|
---|
556 | ## Hack to work around wine's trouble with midl.exe and rc.exe (seems to be msvcrt.dll related)
|
---|
557 | #gen: $(PREREQS)
|
---|
558 |
|
---|
559 |
|
---|
560 | #
|
---|
561 | # Translation stuff
|
---|
562 | #
|
---|
563 | VBoxSVC_HEADERS = \
|
---|
564 | include/collection.h \
|
---|
565 | include/MachineImpl.h \
|
---|
566 | include/HostDVDDriveImpl.h \
|
---|
567 | include/HostFloppyDriveImpl.h
|
---|
568 |
|
---|
569 | VBoxC_HEADERS = \
|
---|
570 | include/ConsoleImpl.h
|
---|
571 |
|
---|
572 | VBoxSVC_TRANSLATIONS = \
|
---|
573 | nls/VBoxSVC_de.ts
|
---|
574 |
|
---|
575 | VBoxC_TRANSLATIONS = \
|
---|
576 | nls/VBoxC_de.ts
|
---|
577 |
|
---|
578 | updatenls:
|
---|
579 | $(VBOX_LUPDATE) $(VBoxSVC_SOURCES) $(VBoxSVC_HEADERS) -ts $(VBoxSVC_TRANSLATIONS)
|
---|
580 | $(VBOX_LUPDATE) $(VBoxC_SOURCES) $(VBoxC_HEADERS) -ts $(VBoxC_TRANSLATIONS)
|
---|
581 |
|
---|
582 | ifdef VBOX_WITH_XPCOM
|
---|
583 |
|
---|
584 | testidl: $(IDLFILE) $(IDLTYPELIB)
|
---|
585 | testidlhdr: $(IDLHEADER)
|
---|
586 |
|
---|
587 | else
|
---|
588 |
|
---|
589 | testidl: $(IDLFILE) $(PATH_VBoxCOM)/VirtualBox_i.c
|
---|
590 |
|
---|
591 | endif
|
---|
592 |
|
---|
593 | $(PATH_BIN)/comregister.cmd: win32/comregister.cmd
|
---|
594 | $(CP) $< $@
|
---|
595 |
|
---|
596 |
|
---|
597 | # Hot fix when dependencies goes bad again...
|
---|
598 | #.NOTPARALLEL: $(TARGET_VBoxC) $(TARGET_VBoxSVC) $(TARGET_VBoxXPCOM) $(TARGET_VBoxCOM) $(IDLHEADER) $(IDLFILE) $(PATH_VBoxCOM)/VirtualBox_i.c
|
---|
599 |
|
---|