1 | # $Id: Makefile.kmk 6004 2007-12-07 20:36:47Z vboxsync $
|
---|
2 | ## @file
|
---|
3 | # Top level makefile.
|
---|
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 (GPL) as published by the Free Software
|
---|
13 | # Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
14 | # VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
15 | # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
16 | #
|
---|
17 |
|
---|
18 | DEPTH = .
|
---|
19 | include $(PATH_KBUILD)/header.kmk
|
---|
20 |
|
---|
21 | ifdef VBOX_WITH_DOCS
|
---|
22 | SUBDIRS = doc/manual
|
---|
23 | endif
|
---|
24 | SUBDIRS += src
|
---|
25 |
|
---|
26 | ifndef VBOX_ONLY_ADDITIONS
|
---|
27 | #
|
---|
28 | # Install external binaries (mostly redistributable parts of tools we use).
|
---|
29 | # This must be done *before* we build the manual.
|
---|
30 | #
|
---|
31 | # To avoid dragging in unnecessary tools and sdks here, we don't use the .win
|
---|
32 | # and .linux property suffixes.
|
---|
33 | #
|
---|
34 | INSTALLS = bin
|
---|
35 |
|
---|
36 | bin_INST = $(INST_BIN)
|
---|
37 |
|
---|
38 | # The SDL DLLs
|
---|
39 | ifeq ($(filter-out win os2,$(BUILD_TARGET)),)
|
---|
40 | ifneq ($(VBOX_WITH_VBOXSDL)$(VBOX_WITH_VBOXBFE),)
|
---|
41 | include $(PATH_KBUILD)/sdks/LIBSDL.kmk
|
---|
42 | bin_SOURCES += \
|
---|
43 | $(DLL_SDK_LIBSDL_SDL)
|
---|
44 | ifdef VBOX_WITH_SECURELABEL
|
---|
45 | bin_SOURCES += \
|
---|
46 | $(DLL_SDK_LIBSDL_SDLTTF)
|
---|
47 | endif
|
---|
48 | ifeq ($(BUILD_TARGET),os2)
|
---|
49 | bin_SOURCES += \
|
---|
50 | $(DLL_SDK_LIBSDL_FSLIB)
|
---|
51 | endif
|
---|
52 | endif
|
---|
53 | endif
|
---|
54 |
|
---|
55 |
|
---|
56 | # The Qt DLLs.
|
---|
57 | ifneq ($(VBOX_WITH_QTGUI),)
|
---|
58 | ifeq ($(BUILD_TARGET),win)
|
---|
59 | #include $(PATH_KBUILD)/sdks/QT3.kmk
|
---|
60 | #bin_SOURCES += \
|
---|
61 | # $(DLL_SDK_QT3_QT)
|
---|
62 | ifeq ($(BUILD_TARGET).$(BUILD_TARGET_ARCH),win.x86)
|
---|
63 | VBOX_DLL_QT ?= $(VBOX_PATH_QT)/bin/qt-mt333.dll
|
---|
64 | else ifeq ($(BUILD_TARGET).$(BUILD_TARGET_ARCH),win.amd64)
|
---|
65 | VBOX_DLL_QT ?= $(PATH_DEVTOOLS)/win.amd64/Qt/v3.3.8/lib/qt-mt338.dll=>qt-mt338.dll
|
---|
66 | endif
|
---|
67 | ifdef VBOX_DLL_QT
|
---|
68 | bin_SOURCES += \
|
---|
69 | $(VBOX_DLL_QT)=>$(not-dir $(VBOX_DLL_QT))
|
---|
70 | endif
|
---|
71 | else ifeq ($(BUILD_TARGET),os2)
|
---|
72 | VBOX_DLL_QT ?= $(lastword $(sort $(wildcard $(VBOX_PATH_QT)/bin/*qt*.dll)))
|
---|
73 | ifneq ($(strip $(VBOX_DLL_QT)),)
|
---|
74 | bin_SOURCES += \
|
---|
75 | $(VBOX_DLL_QT)=>$(not-dir $(VBOX_DLL_QT))
|
---|
76 | endif
|
---|
77 | else ifeq ($(VBOX_MUST_INSTALL_LIB_QT),1)
|
---|
78 | bin_SOURCES += \
|
---|
79 | $(LIB_QT)
|
---|
80 | endif
|
---|
81 | endif
|
---|
82 |
|
---|
83 |
|
---|
84 | # The compiler runtime DLLs.
|
---|
85 | ifeq ($(BUILD_TARGET).$(VBOX_WITHOUT_COMPILER_REDIST),win.)
|
---|
86 | ifdef VBOX_USE_VCC80
|
---|
87 | include $(PATH_KBUILD)/tools/VCC80X86.kmk
|
---|
88 | include $(PATH_KBUILD)/tools/VCC80AMD64.kmk
|
---|
89 | bin_SOURCES.x86 += \
|
---|
90 | $(PATH_TOOL_VCC80X86)/redist/x86/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest=>Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest \
|
---|
91 | $(PATH_TOOL_VCC80X86)/redist/x86/Microsoft.VC80.CRT/msvcr80.dll=>Microsoft.VC80.CRT/msvcr80.dll \
|
---|
92 | $(PATH_TOOL_VCC80X86)/redist/x86/Microsoft.VC80.CRT/msvcp80.dll=>Microsoft.VC80.CRT/msvcp80.dll \
|
---|
93 | $(PATH_TOOL_VCC80X86)/redist/x86/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest=>testcase/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest \
|
---|
94 | $(PATH_TOOL_VCC80X86)/redist/x86/Microsoft.VC80.CRT/msvcr80.dll=>testcase/Microsoft.VC80.CRT/msvcr80.dll \
|
---|
95 | $(PATH_TOOL_VCC80X86)/redist/x86/Microsoft.VC80.CRT/msvcp80.dll=>testcase/Microsoft.VC80.CRT/msvcp80.dll
|
---|
96 | bin_SOURCES.amd64 += \
|
---|
97 | $(PATH_TOOL_VCC80AMD64)/redist/amd64/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest=>Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest \
|
---|
98 | $(PATH_TOOL_VCC80AMD64)/redist/amd64/Microsoft.VC80.CRT/msvcr80.dll=>Microsoft.VC80.CRT/msvcr80.dll \
|
---|
99 | $(PATH_TOOL_VCC80AMD64)/redist/amd64/Microsoft.VC80.CRT/msvcp80.dll=>Microsoft.VC80.CRT/msvcp80.dll \
|
---|
100 | $(PATH_TOOL_VCC80AMD64)/redist/amd64/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest=>testcase/Microsoft.VC80.CRT/Microsoft.VC80.CRT.manifest \
|
---|
101 | $(PATH_TOOL_VCC80AMD64)/redist/amd64/Microsoft.VC80.CRT/msvcr80.dll=>testcase/Microsoft.VC80.CRT/msvcr80.dll \
|
---|
102 | $(PATH_TOOL_VCC80AMD64)/redist/amd64/Microsoft.VC80.CRT/msvcp80.dll=>testcase/Microsoft.VC80.CRT/msvcp80.dll
|
---|
103 | endif
|
---|
104 | ifndef VBOX_USE_VCC80
|
---|
105 | VBOX_INSTALL_VCC70_RT = 1
|
---|
106 | endif
|
---|
107 | ifeq ($(BUILD_TARGET).$(BUILD_TARGET_ARCH),win.x86)
|
---|
108 | VBOX_INSTALL_VCC70_RT = 1
|
---|
109 | endif
|
---|
110 | ifdef VBOX_INSTALL_VCC70_RT
|
---|
111 | include $(PATH_KBUILD)/tools/VCC70.kmk
|
---|
112 | ## @todo Move these defines to VCC70.
|
---|
113 | DLL_TOOL_VCC70_MSVCR71 ?= $(PATH_TOOL_VCC70)/bin/msvcr71.dll
|
---|
114 | ifneq ($(wildcard $(DLL_TOOL_VCC70_MSVCR71)),)
|
---|
115 | bin_SOURCES += \
|
---|
116 | $(DLL_TOOL_VCC70_MSVCR71)=>msvcr71.dll \
|
---|
117 | $(DLL_TOOL_VCC70_MSVCR71)=>testcase/msvcr71.dll
|
---|
118 | endif
|
---|
119 | DLL_TOOL_VCC70_MSVCP71 ?= $(PATH_TOOL_VCC70)/bin/msvcp71.dll
|
---|
120 | ifneq ($(wildcard $(DLL_TOOL_VCC70_MSVCP71)),)
|
---|
121 | bin_SOURCES += \
|
---|
122 | $(DLL_TOOL_VCC70_MSVCP71)=>msvcp71.dll \
|
---|
123 | $(DLL_TOOL_VCC70_MSVCP71)=>testcase/msvcp71.dll
|
---|
124 | endif
|
---|
125 | DLL_TOOL_VCC70_MSVCRT ?= $(PATH_TOOL_VCC70)/bin/msvcrt.dll
|
---|
126 | ifneq ($(wildcard $(DLL_TOOL_VCC70_MSVCRT)),)
|
---|
127 | bin_SOURCES += \
|
---|
128 | $(DLL_TOOL_VCC70_MSVCRT)=>msvcrt.dll \
|
---|
129 | $(DLL_TOOL_VCC70_MSVCRT)=>testcase/msvcrt.dll
|
---|
130 | endif
|
---|
131 | endif
|
---|
132 | endif
|
---|
133 |
|
---|
134 | # The Xerces DLL
|
---|
135 | ifneq ($(DLL_SDK_VBOX_XERCES_XERCES),)
|
---|
136 | bin_SOURCES += $(DLL_SDK_VBOX_XERCES_XERCES)
|
---|
137 | endif
|
---|
138 |
|
---|
139 | # The Xalan DLLs
|
---|
140 | ifneq ($(DLL_SDK_VBOX_XALAN_XALAN),)
|
---|
141 | bin_SOURCES += $(DLL_SDK_VBOX_XALAN_XALAN)
|
---|
142 | endif
|
---|
143 | ifneq ($(DLL_SDK_VBOX_XALAN_XALAN-MESSAGES),)
|
---|
144 | bin_SOURCES += $(DLL_SDK_VBOX_XALAN_XALAN-MESSAGES)
|
---|
145 | endif
|
---|
146 |
|
---|
147 |
|
---|
148 | #
|
---|
149 | # Install staged binaries on platforms where we can't cross
|
---|
150 | # compile things.
|
---|
151 | #
|
---|
152 | ifneq ($(filter-out linux win l4, $(BUILD_TARGET)),)
|
---|
153 | VBOX_PATH_STAGED ?= .
|
---|
154 |
|
---|
155 | # Additions.
|
---|
156 | ifndef VBOX_WITH_LINUX_ADDITIONS
|
---|
157 | ifndef VBOX_WITH_WIN32_ADDITIONS
|
---|
158 | ifneq ($(wildcard $(VBOX_PATH_STAGED)/VBoxGuestAdditions.iso),)
|
---|
159 | INSTALLS += staged-additions
|
---|
160 | staged-additions_INST = $(INST_ADDITIONS)
|
---|
161 | staged-additions_MODE = 0644
|
---|
162 | staged-additions_SOURCES = $(VBOX_PATH_STAGED)/VBoxGuestAdditions.iso
|
---|
163 | endif
|
---|
164 | endif
|
---|
165 | endif
|
---|
166 |
|
---|
167 | # guesttool.exe
|
---|
168 | ifndef VBOX_WITH_WIN32_ADDITIONS
|
---|
169 | ifneq ($(wildcard $(VBOX_PATH_STAGED)/guesttool.exe),)
|
---|
170 | INSTALLS += staged-guesttool
|
---|
171 | staged-guesttool_INST = $(INST_BIN)
|
---|
172 | staged-guesttool_SOURCES = $(VBOX_PATH_STAGED)/guesttool.exe
|
---|
173 | endif
|
---|
174 | endif
|
---|
175 |
|
---|
176 | endif
|
---|
177 |
|
---|
178 | endif # !VBOX_ONLY_ADDITIONS
|
---|
179 |
|
---|
180 |
|
---|
181 | include $(PATH_KBUILD)/footer.kmk
|
---|
182 |
|
---|
183 |
|
---|
184 | #
|
---|
185 | # Generate documentation.
|
---|
186 | # (This should be converted into a separate pass or merged with an existing one later.)
|
---|
187 | #
|
---|
188 | docs: docs.Core
|
---|
189 | $(MAKE) -C src/VBox/Main docs
|
---|
190 | $(MAKE) -C src/VBox/Runtime docs
|
---|
191 |
|
---|
192 | docs.Core: $(PATH_TARGET)/docs.Core
|
---|
193 |
|
---|
194 |
|
---|
195 | #
|
---|
196 | # The core (VMM+Runtime+Devices) documentation.
|
---|
197 | #
|
---|
198 | $(PATH_TARGET)/docs.Core: \
|
---|
199 | Doxyfile.Core \
|
---|
200 | | $(call DIRDEP, $(PATH_TARGET)) \
|
---|
201 | $(call DIRDEP, $(PATH_OUT)/docs/Core)
|
---|
202 | $(RM) -f $(wildcard $(PATH_OUT)/docs/Core/html/*)
|
---|
203 | ifdef KMK_USE_REDIRECT
|
---|
204 | $(REDIRECT) -E 'PATH_OUT=$(PATH_OUT)' -E 'PATH_TARGET=$(PATH_TARGET)' -- doxygen Doxyfile.Core
|
---|
205 | else
|
---|
206 | PATH_OUT="$(PATH_OUT)" PATH_TARGET="$(PATH_TARGET)" doxygen Doxyfile.Core
|
---|
207 | endif
|
---|
208 |
|
---|
209 | $(call DIRDEP, $(PATH_OUT)/docs/Core):
|
---|
210 | $(MKDIR) -p $@
|
---|
211 |
|
---|
212 |
|
---|
213 | #
|
---|
214 | # Generate x86.mac and err.mac.
|
---|
215 | #
|
---|
216 | incs:
|
---|
217 | $(SED) -f include/VBox/err.sed include/VBox/err.h > include/VBox/err.mac
|
---|
218 | echo '%include "iprt/err.mac"' >> include/VBox/err.mac
|
---|
219 | $(SED) -f include/VBox/err.sed include/iprt/err.h > include/iprt/err.mac
|
---|
220 | $(SED) -e '/__VBox_x86_h__/d' -e '/#define/!d' -e 's/#define/%define/' include/VBox/x86.h > include/VBox/x86.mac
|
---|
221 |
|
---|
222 |
|
---|
223 | #
|
---|
224 | # Generate Visual SlickEdit tagging #defines.
|
---|
225 | #
|
---|
226 | vslick.h: include/VBox/cdefs.h Makefile
|
---|
227 | echo '// autogenerated' > [email protected]
|
---|
228 | #echo '#define __BEGIN_DECLS ' >> [email protected]
|
---|
229 | #echo '#define __END_DECLS ' >> [email protected]
|
---|
230 |
|
---|
231 | echo '#define ATL_NO_VTABLE ' >> [email protected]
|
---|
232 | echo '#define BEGIN_COM_MAP(a) ' >> [email protected]
|
---|
233 | echo '#define END_COM_MAP(a) ' >> [email protected]
|
---|
234 |
|
---|
235 | echo '#define CHECKREADY if(!isReady()) return E_UNEXPECTED; ' >> [email protected]
|
---|
236 | echo '#define COM_DECL_READONLY_ENUM_AND_COLLECTION(a) ' >> [email protected]
|
---|
237 | echo '#define COM_INTERFACE_ENTRY(a) ' >> [email protected]
|
---|
238 | echo '#define COMGETTER(n) Get##n ' >> [email protected]
|
---|
239 | echo '#define COMSETTER(n) Set##n ' >> [email protected]
|
---|
240 | echo '#define DECLARE_NOT_AGGREGATABLE(a) ' >> [email protected]
|
---|
241 | echo '#define DECLARE_PROTECT_FINAL_CONSTRUCT(a) ' >> [email protected]
|
---|
242 | echo '#define NS_DECL_ISUPPORTS ' >> [email protected]
|
---|
243 | echo '#define NS_IMETHOD NS_IMETHOD_(nsresult) ' >> [email protected]
|
---|
244 | echo '#define NS_IMETHOD_(type) type ' >> [email protected]
|
---|
245 | echo '#define PARSERS_EXPORT ' >> [email protected]
|
---|
246 | echo '#define SAX_EXPORT ' >> [email protected]
|
---|
247 | echo '#define STDMETHOD(a) NS_IMETHOD a ' >> [email protected]
|
---|
248 | echo '#define XERCES_CPP_NAMESPACE_BEGIN ' >> [email protected]
|
---|
249 | echo '#define XERCES_CPP_NAMESPACE_END ' >> [email protected]
|
---|
250 |
|
---|
251 | echo '#define CTXAllSUFF(var) var##R3 ' >> [email protected]
|
---|
252 | echo '#define CTXSUFF(var) var##HC ' >> [email protected]
|
---|
253 | echo '#define OTHERCTXSUFF(var) var##GC ' >> [email protected]
|
---|
254 | echo '#define CTXALLMID(first, last) first##R3##last ' >> [email protected]
|
---|
255 | echo '#define CTXMID(first, last) first##HC##last ' >> [email protected]
|
---|
256 | echo '#define OTHERCTXMID(first, last) first##GC##last ' >> [email protected]
|
---|
257 | echo '#define CTXTYPE(GCType, R3Type, R0Type) R3Type ' >> [email protected]
|
---|
258 | echo '#define GCPTRTYPE(GCType) GCType ' >> [email protected]
|
---|
259 | echo '#define GCTYPE(GCType, HCType) GCType ' >> [email protected]
|
---|
260 | echo '#define HCPTRTYPE(HCType) HCType ' >> [email protected]
|
---|
261 | echo '#define R0PTRTYPE(R3Type) R3Type ' >> [email protected]
|
---|
262 | echo '#define R3PTRTYPE(R0Type) R0Type ' >> [email protected]
|
---|
263 | echo '#define RT_SRC_POS __FILE__, __LINE__, __PRETTY_FUNCTION__ ' >> [email protected]
|
---|
264 | echo '#define RT_SRC_POS_DECL const char *pszFile, unsigned iLine, const char *pszFunction ' >> [email protected]
|
---|
265 | echo '#define RT_SRC_POS_ARGS pszFile, iLine, pszFunction ' >> [email protected]
|
---|
266 | echo '#define RTCALL' >> [email protected]
|
---|
267 | echo '#define DECLINLINE(type) inline type ' >> [email protected]
|
---|
268 |
|
---|
269 | echo '#define PDM_SRC_POS __FILE__, __LINE__, __PRETTY_FUNCTION__ ' >> [email protected]
|
---|
270 | echo '#define PDM_SRC_POS_DECL const char *pszFile, unsigned iLine, const char *pszFunction ' >> [email protected]
|
---|
271 | echo '#define PDM_SRC_POS_ARGS pszFile, iLine, pszFunction ' >> [email protected]
|
---|
272 | echo '#define PDMDEVINSINT_DECLARED 1' >> [email protected]
|
---|
273 | echo '#define VBOXCALL' >> [email protected]
|
---|
274 |
|
---|
275 | $(SED) -e '/__cdecl/d' \
|
---|
276 | -e '/^ *# *define.*DECL/!d' \
|
---|
277 | -e '/DECLS/d' \
|
---|
278 | -e '/_SRC_POS_DECL/d' \
|
---|
279 | -e '/declspec/d' \
|
---|
280 | -e 's/# */#/g' \
|
---|
281 | -e 's/ */ /g' \
|
---|
282 | -e '/(type) DECLEXPORT/d' \
|
---|
283 | -e 's/ *VBOXCALL//' \
|
---|
284 | -e 's/ *RTCALL//' \
|
---|
285 | -e 's/(type) DECLIMPORT(type)/(type) type/' \
|
---|
286 | -e '/ DECLASM(type) type/d' \
|
---|
287 | -e '/define *DECL..CALLBACKMEMBER(type[^)]*) *RT/d' \
|
---|
288 | -e '/define *DECLINLINE(type)/d' \
|
---|
289 | \
|
---|
290 | include/iprt/cdefs.h \
|
---|
291 | include/VBox/cdefs.h \
|
---|
292 | >> [email protected]
|
---|
293 | sort [email protected] | sort | sed -e 's/$$/\n/' > [email protected]
|
---|
294 | $(MV) -f [email protected] $@
|
---|
295 | $(RM) -f [email protected] [email protected] [email protected]
|
---|
296 |
|
---|
297 |
|
---|
298 | ## add tools fetching to the 'up' / 'update' target.
|
---|
299 | up update::
|
---|
300 | # this doesn't work of course if kmk is updated: svn$(HOSTSUFF_EXE) up $(PATH_KBUILD)
|
---|
301 | ifndef VBOX_OSE
|
---|
302 | $(MAKE) -C tools fetch
|
---|
303 | else
|
---|
304 | $(MAKE) -C tools -f Makefile-ose.kmk fetch
|
---|
305 | endif
|
---|
306 |
|
---|
307 | up2 update2::
|
---|
308 | $(SVN) up src/lib/kStuff
|
---|
309 | if1of ($(BUILD_PLATFORM),win os2)
|
---|
310 | $(ECHO) This may fail if kmk.exe is updated.
|
---|
311 | endif
|
---|
312 | $(SVN) up kBuild
|
---|
313 |
|
---|
314 |
|
---|
315 | #
|
---|
316 | # Generate VirtualBox-OSE-x.x.x.tar.bz2 tarballs for distribution
|
---|
317 | #
|
---|
318 | # - includes kBuild
|
---|
319 | # - must be executed on an OSE checkout
|
---|
320 | #
|
---|
321 |
|
---|
322 | # the path where to store the tarball
|
---|
323 | TARBALLPATH ?= $(shell cd $(PATH_ROOT)/..; pwd)
|
---|
324 | #TARBALLPATH ?= $(abspath $(PATH_ROOT)/..) - this should also do the trick without spawning a shell.
|
---|
325 | # the root directory inside the tarball
|
---|
326 | TARBALLROOT ?= VirtualBox-$(VBOX_VERSION_STRING)
|
---|
327 | # the name of the tarball file
|
---|
328 | TARBALLNAME ?= VirtualBox-$(VBOX_VERSION_STRING).tar.bz2
|
---|
329 | snapshot:
|
---|
330 | @$(call MSG_L1,Creating tarball $(TARBALLPATH)/$(TARBALLNAME))
|
---|
331 | @if [ -d "$(PATH_ROOT)/src/VBox/Devices/USB" ]; then echo; echo "Found USB stuff, refused to build OSE tarball!"; echo; exit 1; fi
|
---|
332 | $(QUIET)$(MKDIR) -p $(TARBALLPATH)
|
---|
333 | $(QUIET)$(RM) -f $(wildcard $(TARBALLPATH)/VirtualBox*)
|
---|
334 | $(QUIET)$(LN_SYMLINK) $(PATH_ROOT) $(TARBALLPATH)/$(TARBALLROOT)
|
---|
335 | $(QUIET)tar -cjh --owner 0 --group 0 --totals \
|
---|
336 | --exclude=.svn \
|
---|
337 | --exclude=$(TARBALLROOT)/out \
|
---|
338 | --exclude=$(TARBALLROOT)/env.sh \
|
---|
339 | --exclude=$(TARBALLROOT)/configure.log \
|
---|
340 | --exclude=$(TARBALLROOT)/AutoConfig.kmk \
|
---|
341 | --exclude=$(TARBALLROOT)/LocalConfig.kmk \
|
---|
342 | -C $(TARBALLPATH) \
|
---|
343 | -f $(TARBALLPATH)/$(TARBALLNAME) \
|
---|
344 | $(TARBALLROOT)
|
---|
345 | $(QUIET)$(RM) $(TARBALLPATH)/$(TARBALLROOT)
|
---|