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