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