VirtualBox

source: vbox/trunk/Makefile@ 608

Last change on this file since 608 was 305, checked in by vboxsync, 18 years ago

abspath?

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