VirtualBox

source: vbox/trunk/Makefile.kmk@ 2988

Last change on this file since 2988 was 2955, checked in by vboxsync, 18 years ago

VBOX_VERSION (deprecated) => VBOX_VERSION_STRING

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette