VirtualBox

source: vbox/trunk/Makefile@ 2246

Last change on this file since 2246 was 1648, checked in by vboxsync, 18 years ago

A quick hack to include guesttool.exe and VBoxGuestAdditions.iso in the Darwin builds.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 11.5 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
23ifdef VBOX_WITH_DOCS
24 SUBDIRS = doc/manual
25endif
26SUBDIRS += 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#
35INSTALLS = bin
36
37bin_INST = $(INST_BIN)
38
39# The SDL DLLs
40ifeq ($(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
54endif
55
56# The Qt DLLs.
57#ifeq ($(filter-out win os2,$(BUILD_TARGET)),)
58ifeq ($(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
75endif
76
77ifeq ($(BUILD_TARGET),darwin)
78 ifneq ($(VBOX_WITH_QTGUI),)
79 ifdef LIB_QT
80 bin_SOURCES += \
81 $(LIB_QT)
82 endif
83 endif
84endif
85
86# The compiler runtime DLLs.
87ifeq ($(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
127endif
128
129# The Xerces DLL
130ifneq ($(DLL_SDK_VBOX_XERCES_XERCES),)
131 bin_SOURCES += $(DLL_SDK_VBOX_XERCES_XERCES)
132endif
133
134# The Xalan DLLs
135ifneq ($(DLL_SDK_VBOX_XALAN_XALAN),)
136 bin_SOURCES += $(DLL_SDK_VBOX_XALAN_XALAN)
137endif
138ifneq ($(DLL_SDK_VBOX_XALAN_XALAN-MESSAGES),)
139 bin_SOURCES += $(DLL_SDK_VBOX_XALAN_XALAN-MESSAGES)
140endif
141
142
143#
144# Install staged binaries on platforms where we can't cross
145# compile things.
146#
147ifneq ($(filter-out linux win l4, $(BUILD_TARGET)),)
148 VBOX_PATH_STAGED ?= .
149
150 # Additions.
151 ifndef VBOX_WITH_LINUX_ADDITIONS
152 ifndef VBOX_WITH_WIN32_ADDITIONS
153 ifneq ($(wildcard $(VBOX_PATH_STAGED)/VBoxGuestAdditions.iso),)
154 INSTALLS += staged-additions
155 staged-additions_INST = $(INST_ADDITIONS)
156 staged-additions_MODE = 0644
157 staged-additions_SOURCES = $(VBOX_PATH_STAGED)/VBoxGuestAdditions.iso
158 endif
159 endif
160 endif
161
162 # guesttool.exe
163 ifndef VBOX_WITH_WIN32_ADDITIONS
164 ifneq ($(wildcard $(VBOX_PATH_STAGED)/guesttool.exe),)
165 INSTALLS += staged-guesttool
166 staged-guesttool_INST = $(INST_BIN)
167 staged-guesttool_SOURCES = $(VBOX_PATH_STAGED)/guesttool.exe
168 endif
169 endif
170
171endif
172
173
174
175include $(PATH_KBUILD)/footer.kmk
176
177
178#
179# Generate documentation.
180# (This should be converted into a separate pass or merged with an existing one later.)
181#
182docs: docs.Core
183 $(MAKE) -C src/VBox/Main docs
184 $(MAKE) -C src/VBox/Runtime docs
185
186docs.Core: $(PATH_TARGET)/docs.Core
187
188
189#
190# The core (VMM+Runtime+Devices) documentation.
191#
192$(PATH_TARGET)/docs.Core: \
193 Doxyfile.Core \
194 | $(call DIRDEP, $(PATH_TARGET)) \
195 $(call DIRDEP, $(PATH_OUT)/docs/Core)
196 $(RM) -f $(wildcard $(PATH_OUT)/docs/Core/html/*)
197 PATH_OUT="$(PATH_OUT)" PATH_TARGET="$(PATH_TARGET)" doxygen Doxyfile.Core
198
199$(call DIRDEP, $(PATH_OUT)/docs/Core):
200 $(MKDIR) -p $@
201
202
203#
204# Generate x86.mac and err.mac.
205#
206incs:
207 $(SED) -f include/VBox/err.sed include/VBox/err.h > include/VBox/err.mac
208 echo '%include "iprt/err.mac"' >> include/VBox/err.mac
209 $(SED) -f include/VBox/err.sed include/iprt/err.h > include/iprt/err.mac
210 $(SED) -e '/__VBox_x86_h__/d' -e '/#define/!d' -e 's/#define/%define/' include/VBox/x86.h > include/VBox/x86.mac
211
212
213#
214# Generate Visual SlickEdit tagging #defines.
215#
216vslick.h: include/VBox/cdefs.h Makefile
217 echo '// autogenerated' > $@.tmp
218 #echo '#define __BEGIN_DECLS ' >> $@.tmp
219 #echo '#define __END_DECLS ' >> $@.tmp
220
221 echo '#define ATL_NO_VTABLE ' >> $@.tmp
222 echo '#define BEGIN_COM_MAP(a) ' >> $@.tmp
223 echo '#define END_COM_MAP(a) ' >> $@.tmp
224
225 echo '#define CHECKREADY if(!isReady()) return E_UNEXPECTED; ' >> $@.tmp
226 echo '#define COM_DECL_READONLY_ENUM_AND_COLLECTION(a) ' >> $@.tmp
227 echo '#define COM_INTERFACE_ENTRY(a) ' >> $@.tmp
228 echo '#define COMGETTER(n) Get##n ' >> $@.tmp
229 echo '#define COMSETTER(n) Set##n ' >> $@.tmp
230 echo '#define DECLARE_NOT_AGGREGATABLE(a) ' >> $@.tmp
231 echo '#define DECLARE_PROTECT_FINAL_CONSTRUCT(a) ' >> $@.tmp
232 echo '#define NS_DECL_ISUPPORTS ' >> $@.tmp
233 echo '#define NS_IMETHOD NS_IMETHOD_(nsresult) ' >> $@.tmp
234 echo '#define NS_IMETHOD_(type) type ' >> $@.tmp
235 echo '#define PARSERS_EXPORT ' >> $@.tmp
236 echo '#define SAX_EXPORT ' >> $@.tmp
237 echo '#define STDMETHOD(a) NS_IMETHOD a ' >> $@.tmp
238 echo '#define XERCES_CPP_NAMESPACE_BEGIN ' >> $@.tmp
239 echo '#define XERCES_CPP_NAMESPACE_END ' >> $@.tmp
240
241 echo '#define CTXAllSUFF(var) var##R3 ' >> $@.tmp
242 echo '#define CTXSUFF(var) var##HC ' >> $@.tmp
243 echo '#define OTHERCTXSUFF(var) var##GC ' >> $@.tmp
244 echo '#define CTXALLMID(first, last) first##R3##last ' >> $@.tmp
245 echo '#define CTXMID(first, last) first##HC##last ' >> $@.tmp
246 echo '#define OTHERCTXMID(first, last) first##GC##last ' >> $@.tmp
247 echo '#define CTXTYPE(GCType, R3Type, R0Type) R3Type ' >> $@.tmp
248 echo '#define GCPTRTYPE(GCType) GCType ' >> $@.tmp
249 echo '#define GCTYPE(GCType, HCType) GCType ' >> $@.tmp
250 echo '#define HCPTRTYPE(HCType) HCType ' >> $@.tmp
251 echo '#define R0PTRTYPE(R3Type) R3Type ' >> $@.tmp
252 echo '#define R3PTRTYPE(R0Type) R0Type ' >> $@.tmp
253 echo '#define RT_SRC_POS __FILE__, __LINE__, __PRETTY_FUNCTION__ ' >> $@.tmp
254 echo '#define RT_SRC_POS_DECL const char *pszFile, unsigned iLine, const char *pszFunction ' >> $@.tmp
255 echo '#define RT_SRC_POS_ARGS pszFile, iLine, pszFunction ' >> $@.tmp
256 echo '#define RTCALL' >> $@.tmp
257 echo '#define DECLINLINE(type) inline type ' >> $@.tmp
258
259 echo '#define PDM_SRC_POS __FILE__, __LINE__, __PRETTY_FUNCTION__ ' >> $@.tmp
260 echo '#define PDM_SRC_POS_DECL const char *pszFile, unsigned iLine, const char *pszFunction ' >> $@.tmp
261 echo '#define PDM_SRC_POS_ARGS pszFile, iLine, pszFunction ' >> $@.tmp
262 echo '#define PDMDEVINSINT_DECLARED 1' >> $@.tmp
263 echo '#define VBOXCALL' >> $@.tmp
264
265 $(SED) -e '/__cdecl/d' \
266 -e '/^ *# *define.*DECL/!d' \
267 -e '/DECLS/d' \
268 -e '/_SRC_POS_DECL/d' \
269 -e '/declspec/d' \
270 -e 's/# */#/g' \
271 -e 's/ */ /g' \
272 -e '/(type) DECLEXPORT/d' \
273 -e 's/ *VBOXCALL//' \
274 -e 's/ *RTCALL//' \
275 -e 's/(type) DECLIMPORT(type)/(type) type/' \
276 -e '/ DECLASM(type) type/d' \
277 -e '/define *DECL..CALLBACKMEMBER(type[^)]*) *RT/d' \
278 -e '/define *DECLINLINE(type)/d' \
279 \
280 include/iprt/cdefs.h \
281 include/VBox/cdefs.h \
282 >> $@.tmp
283 sort $@.tmp | sort | sed -e 's/$$/\n/' > $@.tmp2
284 $(MV) -f $@.tmp2 $@
285 $(RM) -f $@.tmp $@.tmp2 $@.tmp3
286
287
288ifndef VBOX_OSE
289## add tools fetching to the 'up' / 'update' target.
290up update::
291# this doesn't work of course if kmk is updated: svn$(HOSTSUFF_EXE) up $(PATH_KBUILD)
292 $(MAKE) -C tools fetch
293endif
294
295#
296# Generate VirtualBox-OSE-x.x.x.tar.bz2 tarballs for distribution
297#
298# - includes kBuild
299# - must be executed on an OSE checkout
300#
301
302# the path where to store the tarball
303TARBALLPATH ?= $(shell cd $(PATH_ROOT)/..; pwd)
304#TARBALLPATH ?= $(abspath $(PATH_ROOT)/..) - this should also do the trick without spawning a shell.
305# the root directory inside the tarball
306TARBALLROOT ?= VirtualBox-OSE-$(VBOX_VERSION)
307# the name of the tarball file
308TARBALLNAME ?= VirtualBox-OSE-$(VBOX_VERSION).tar.bz2
309snapshot:
310 @$(call MSG_L1,Creating tarball $(TARBALLPATH)/$(TARBALLNAME))
311 @if [ -d "$(PATH_ROOT)/src/VBox/Devices/USB" ]; then echo; echo "Found USB stuff, refused to build OSE tarball!"; echo; exit 1; fi
312 $(QUIET)$(MKDIR) -p $(TARBALLPATH)
313 $(QUIET)$(RM) -f $(wildcard $(TARBALLPATH)/VirtualBox*)
314 $(QUIET)$(LN_SYMLINK) $(PATH_ROOT) $(TARBALLPATH)/$(TARBALLROOT)
315 $(QUIET)tar -cjh --owner 0 --group 0 --totals \
316 --exclude=.svn \
317 --exclude=$(TARBALLROOT)/out \
318 --exclude=$(TARBALLROOT)/env.sh \
319 --exclude=$(TARBALLROOT)/configure.log \
320 --exclude=$(TARBALLROOT)/AutoConfig.kmk \
321 --exclude=$(TARBALLROOT)/LocalConfig.kmk \
322 -C $(TARBALLPATH) \
323 -f $(TARBALLPATH)/$(TARBALLNAME) \
324 $(TARBALLROOT)
325 $(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