build.sh 13.5 KB
Newer Older
Oliver Bock's avatar
Oliver Bock committed
1
#!/bin/bash
Oliver Bock's avatar
Oliver Bock committed
2

Oliver Bock's avatar
Oliver Bock committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
###########################################################################
#   Copyright (C) 2008 by Oliver Bock                                     #
#   oliver.bock[AT]aei.mpg.de                                             #
#                                                                         #
#   This file is part of Einstein@Home.                                   #
#                                                                         #
#   Einstein@Home is free software: you can redistribute it and/or modify #
#   it under the terms of the GNU General Public License as published     #
#   by the Free Software Foundation, version 2 of the License.            #
#                                                                         #
#   Einstein@Home is distributed in the hope that it will be useful,      #
#   but WITHOUT ANY WARRANTY; without even the implied warranty of        #
#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the          #
#   GNU General Public License for more details.                          #
#                                                                         #
#   You should have received a copy of the GNU General Public License     #
#   along with Einstein@Home. If not, see <http://www.gnu.org/licenses/>. #
#                                                                         #
###########################################################################

### TODOs #################################################################

# more refactoring (every lib in dedicated function? per traget?)

Oliver Bock's avatar
Oliver Bock committed
27
28
29
### globals ###############################################################

ROOT=`pwd`
30
LOGFILE=$ROOT/build.log
Oliver Bock's avatar
Oliver Bock committed
31
32
TARGET=0

Oliver Bock's avatar
Oliver Bock committed
33
### functions #############################################################
Oliver Bock's avatar
Oliver Bock committed
34

Oliver Bock's avatar
Oliver Bock committed
35
36
failure()
{
37
38
39
	echo "************************************" | tee -a $LOGFILE
	echo "Error detected! Stopping build!" | tee -a $LOGFILE
	echo "`date`" | tee -a $LOGFILE
Oliver Bock's avatar
Oliver Bock committed
40
41
42
43
44
45

    if [ -f "$LOGFILE" ]; then
		echo "------------------------------------"
		echo "Please check logfile: `basename $LOGFILE`"
		echo "These are the final ten lines:"
		echo "------------------------------------"
Oliver Bock's avatar
Oliver Bock committed
46
		tail -n 14 $LOGFILE | head -n 10
Oliver Bock's avatar
Oliver Bock committed
47
48
49
50
51
52
53
    fi

	echo "************************************" | tee -a $LOGFILE

    exit 1
}

Oliver Bock's avatar
Oliver Bock committed
54
55
check_prerequisites()
{
56
	echo "Checking prerequisites..." | tee -a $LOGFILE
Oliver Bock's avatar
Oliver Bock committed
57
58
59
60
61
62
	
	# required toolchain
	TOOLS="automake autoconf m4 cmake wget gcc g++ ld libtool ar lex yacc"

	for tool in $TOOLS; do
		if ! ( type $tool >/dev/null 2>&1 ); then
63
			echo "Missing \"$tool\" which is a required tool!" | tee -a $LOGFILE
Oliver Bock's avatar
Oliver Bock committed
64
65
66
67
68
			return 1
		fi
	done

	return 0
Oliver Bock's avatar
Oliver Bock committed
69
70
71
}


72
prepare_source_tree()
Oliver Bock's avatar
Oliver Bock committed
73
{
Oliver Bock's avatar
Oliver Bock committed
74
	echo "Preparing source tree..." | tee -a $LOGFILE
75
76
77
78
79
80
81
82
83
	mkdir -p 3rdparty/oglft >> $LOGFILE || failure
	mkdir -p 3rdparty/boinc >> $LOGFILE || failure

	return 0
}


prepare_build_tree()
{
Oliver Bock's avatar
Oliver Bock committed
84
	echo "Preparing build tree..." | tee -a $LOGFILE
85
86
87
88
89
90
91
92
93
94
95
96
97
98
	mkdir -p build/sdl >> $LOGFILE || failure
	mkdir -p build/freetype2 >> $LOGFILE || failure
	mkdir -p build/oglft >> $LOGFILE || failure
	mkdir -p build/boinc >> $LOGFILE || failure
	mkdir -p build/framework >> $LOGFILE || failure
	mkdir -p build/orc >> $LOGFILE || failure
	mkdir -p build/starsphere >> $LOGFILE || failure

	return 0
}


prepare_install_tree()
{
Oliver Bock's avatar
Oliver Bock committed
99
	echo "Preparing install tree..." | tee -a $LOGFILE
100
101
102
103
104
105
106
107
108
109
110
111
112
113
	mkdir -p install/bin >> $LOGFILE || failure
	mkdir -p install/include >> $LOGFILE || failure
	mkdir -p install/lib >> $LOGFILE || failure

	return 0
}


prepare_generic()
{
	prepare_source_tree || failure
	prepare_build_tree || failure
	prepare_install_tree || failure

Oliver Bock's avatar
Oliver Bock committed
114
	# prepare additional sources
115
116
117
118

	cd $ROOT || failure
	mkdir -p 3rdparty/sdl >> $LOGFILE 2>&1 || failure
	cd $ROOT/3rdparty/sdl || failure
Oliver Bock's avatar
Oliver Bock committed
119
	if [ -d .svn ]; then
120
121
122
123
		echo "Updating SDL..." | tee -a $LOGFIL
		# make sure local changes (patches) are reverted, hence also updated
		svn revert -R . >> $LOGFILE 2>&1 || failure
		svn update >> $LOGFILE 2>&1 || failure
Oliver Bock's avatar
Oliver Bock committed
124
	else
Oliver Bock's avatar
Oliver Bock committed
125
		echo "Retrieving SDL (this may take a while)..." | tee -a $LOGFILE
126
		svn checkout http://svn.libsdl.org/branches/SDL-1.2 . >> $LOGFILE 2>&1 || failure
Oliver Bock's avatar
Oliver Bock committed
127
	fi
Oliver Bock's avatar
Oliver Bock committed
128

129
# 	cd $ROOT/3rdparty || failure
Oliver Bock's avatar
Oliver Bock committed
130
# 	echo "Retrieving SDL (this may take a while)..." | tee -a $LOGFILE
131
132
133
134
135
136
# 	wget http://www.libsdl.org/release/SDL-1.2.14.tar.gz >> $LOGFILE 2>&1 || failure
# 	tar -xzf SDL-1.2.14.tar.gz >> $LOGFILE 2>&1 || failure
# 	rm SDL-1.2.14.tar.gz >> $LOGFILE 2>&1 || failure
# 	substitute old source tree
# 	rm -rf sdl >> $LOGFILE 2>&1 || failure
# 	mv SDL-1.2.14 sdl >> $LOGFILE 2>&1 || failure
Oliver Bock's avatar
Oliver Bock committed
137
	
138
	cd $ROOT/3rdparty || failure
Oliver Bock's avatar
Oliver Bock committed
139
	echo "Retrieving Freetype2 (this may take a while)..." | tee -a $LOGFILE
140
141
142
143
144
145
	wget http://mesh.dl.sourceforge.net/sourceforge/freetype/freetype-2.3.5.tar.bz2 >> $LOGFILE 2>&1 || failure
	tar -xjf freetype-2.3.5.tar.bz2 >> $LOGFILE 2>&1 || failure
	rm freetype-2.3.5.tar.bz2 >> $LOGFILE 2>&1 || failure
	# substitute old source tree
	rm -rf freetype2 >> $LOGFILE 2>&1 || failure
	mv freetype-2.3.5 freetype2 >> $LOGFILE 2>&1 || failure
Oliver Bock's avatar
Oliver Bock committed
146
	
147
	cd $ROOT/3rdparty/oglft || failure
Oliver Bock's avatar
Oliver Bock committed
148
	if [ -d .svn ]; then
Oliver Bock's avatar
Oliver Bock committed
149
		echo "Updating OGLFT..." | tee -a $LOGFILE
150
151
152
		# make sure local changes (patches) are reverted, hence also updated
		svn revert -R . >> $LOGFILE  2>&1 || failure
		svn update >> $LOGFILE  2>&1 || failure
Oliver Bock's avatar
Oliver Bock committed
153
	else
Oliver Bock's avatar
Oliver Bock committed
154
		echo "Retrieving OGLFT (this may take a while)..." | tee -a $LOGFILE
155
		svn checkout https://oglft.svn.sourceforge.net/svnroot/oglft/trunk . >> $LOGFILE 2>&1 || failure
Oliver Bock's avatar
Oliver Bock committed
156
157
	fi
	
158
	cd $ROOT/3rdparty/boinc || failure
Oliver Bock's avatar
Oliver Bock committed
159
	if [ -d .svn ]; then
Oliver Bock's avatar
Oliver Bock committed
160
		echo "Updating BOINC..." | tee -a $LOGFILE
161
162
163
		# make sure local changes (patches) are reverted, hence also updated
		svn revert -R . >> $LOGFILE  2>&1 || failure
		svn update >> $LOGFILE  2>&1 || failure
Oliver Bock's avatar
Oliver Bock committed
164
	else
Oliver Bock's avatar
Oliver Bock committed
165
		echo "Retrieving BOINC (this may take a while)..." | tee -a $LOGFILE
166
		svn checkout http://boinc.berkeley.edu/svn/trunk/boinc . >> $LOGFILE 2>&1 || failure
Oliver Bock's avatar
Oliver Bock committed
167
	fi
Oliver Bock's avatar
Oliver Bock committed
168
169

	return 0
Oliver Bock's avatar
Oliver Bock committed
170
171
172
173
174
}


prepare_win32()
{
175
	cd $ROOT || failure
Oliver Bock's avatar
Oliver Bock committed
176

Oliver Bock's avatar
Oliver Bock committed
177
	echo "Preparing MinGW source tree..." | tee -a $LOGFILE
178
179
	mkdir -p 3rdparty/mingw/xscripts >> $LOGFILE || failure
	cd 3rdparty/mingw/xscripts || failure
Oliver Bock's avatar
Oliver Bock committed
180
181

	if [ -d CVS ]; then
Oliver Bock's avatar
Oliver Bock committed
182
		echo "Updating MinGW build script..." | tee -a $LOGFILE
183
		cvs update -C >> $LOGFILE 2>&1 || failure
Oliver Bock's avatar
Oliver Bock committed
184
	else
185
		cd .. || failure
Oliver Bock's avatar
Oliver Bock committed
186
		echo "Retrieving MinGW build script (this may take a while)..." | tee -a $LOGFILE
187
		cvs -z3 -d:pserver:anonymous@mingw.cvs.sourceforge.net:/cvsroot/mingw checkout -P xscripts >> $LOGFILE 2>&1 || failure
Oliver Bock's avatar
Oliver Bock committed
188
189
	fi
	
190
	cd $ROOT/3rdparty/mingw/xscripts || failure
Oliver Bock's avatar
Oliver Bock committed
191
	echo "Preparing MinGW build script..." | tee -a $LOGFILE
Oliver Bock's avatar
Oliver Bock committed
192
	# note: svn has no force/overwrite switch. the file might not be updated when patched
193
194
	patch x86-mingw32-build.sh.conf < $ROOT/patches/x86-mingw32-build.sh.conf.patch >> $LOGFILE || failure
	chmod +x x86-mingw32-build.sh >> $LOGFILE || failure
Oliver Bock's avatar
Oliver Bock committed
195
196

	return 0
Oliver Bock's avatar
Oliver Bock committed
197
198
199
200
201
}


build_generic()
{
202
	cd $ROOT/3rdparty/sdl || failure
Oliver Bock's avatar
Oliver Bock committed
203
	echo "Building SDL (this may take a while)..." | tee -a $LOGFILE
204
205
206
207
208
	./autogen.sh >> $LOGFILE 2>&1 || failure
	cd $ROOT/build/sdl || failure
	$ROOT/3rdparty/sdl/configure --prefix=$ROOT/install --enable-shared=no --enable-static=yes >> $LOGFILE 2>&1 || failure
	make >> $LOGFILE 2>&1 || failure
	make install >> $LOGFILE 2>&1 || failure
Oliver Bock's avatar
Oliver Bock committed
209
	echo "Successfully built and installed SDL!" | tee -a $LOGFILE
Oliver Bock's avatar
Oliver Bock committed
210

211
	cd $ROOT/3rdparty/freetype2 || failure
Oliver Bock's avatar
Oliver Bock committed
212
	echo "Building Freetype2 (this may take a while)..." | tee -a $LOGFILE
213
214
215
216
	chmod +x autogen.sh >> $LOGFILE 2>&1 || failure
	chmod +x configure >> $LOGFILE 2>&1 || failure
	./autogen.sh >> $LOGFILE 2>&1 || failure
	cd $ROOT/build/freetype2 || failure
Oliver Bock's avatar
Oliver Bock committed
217
	# note: freetype (or sdl?) probably doesn't need *no* configure when static -> ansi build, see readme!
218
219
220
	$ROOT/3rdparty/freetype2/configure --prefix=$ROOT/install --enable-shared=no --enable-static=yes >> $LOGFILE 2>&1 || failure
	make >> $LOGFILE 2>&1 || failure
	make install >> $LOGFILE 2>&1 || failure
Oliver Bock's avatar
Oliver Bock committed
221
	echo "Successfully built and installed Freetype2!" | tee -a $LOGFILE
Oliver Bock's avatar
Oliver Bock committed
222

223
	cd $ROOT/3rdparty/oglft || failure
Oliver Bock's avatar
Oliver Bock committed
224
225
226
227
	echo "Patching OGLFT..." | tee -a $LOGFILE
	# note: svn has no force/overwrite switch. patched files might not be updated
	# patch: use fixed settings for freetype, deactivate FindFreetype
	FREETYPE2_INCLUDE_DIR="$ROOT/install/include"
228
	FREETYPE2_LIBRARIES="$ROOT/install/lib/libfreetype.a"
229
	patch CMakeLists.txt < $ROOT/patches/CMakeLists.txt.oglft.patch >> $LOGFILE 2>&1 || failure
Oliver Bock's avatar
Oliver Bock committed
230
	# patch: build static lib instead of shared
231
232
	cd $ROOT/3rdparty/oglft/liboglft || failure
	patch CMakeLists.txt < $ROOT/patches/CMakeLists.txt.liboglft.patch >> $LOGFILE 2>&1 || failure
Oliver Bock's avatar
Oliver Bock committed
233
	echo "Building OGLFT..." | tee -a $LOGFILE
234
	cd $ROOT/build/oglft || failure
235
	# TODO: do we wanna create universal binaries on mac? If so, add -DCMAKE_OSX_ARCHITECTURES=ppc;i386
236
237
238
239
240
	cmake -DFREETYPE2_INCLUDE_DIR="$FREETYPE2_INCLUDE_DIR" -DFREETYPE2_LIBRARIES="$FREETYPE2_LIBRARIES" $ROOT/3rdparty/oglft >> $LOGFILE 2>&1 || failure
	make >> $LOGFILE 2>&1 || failure
	mkdir -p $ROOT/install/include/oglft >> $LOGFILE 2>&1 || failure
	cp OGLFT.h $ROOT/install/include/oglft >> $LOGFILE 2>&1 || failure
	cp liboglft/liboglft.a $ROOT/install/lib >> $LOGFILE 2>&1 || failure
Oliver Bock's avatar
Oliver Bock committed
241
	echo "Successfully built and installed OGLFT!" | tee -a $LOGFILE
Oliver Bock's avatar
Oliver Bock committed
242

243
	cd $ROOT/3rdparty/boinc || failure
Oliver Bock's avatar
Oliver Bock committed
244
	echo "Building BOINC (this may take a while)..." | tee -a $LOGFILE
245
246
247
248
249
	./_autosetup >> $LOGFILE 2>&1 || failure
	cd $ROOT/build/boinc || failure
	$ROOT/3rdparty/boinc/configure --prefix=$ROOT/install --enable-shared=no --enable-static=yes --disable-server --disable-client >> $LOGFILE 2>&1 || failure
	make >> $LOGFILE 2>&1 || failure
	make install >> $LOGFILE 2>&1 || failure
Oliver Bock's avatar
Oliver Bock committed
250
	echo "Successfully built and installed BOINC!" | tee -a $LOGFILE
Oliver Bock's avatar
Oliver Bock committed
251
252

	return 0
Oliver Bock's avatar
Oliver Bock committed
253
254
}

Oliver Bock's avatar
Oliver Bock committed
255

Oliver Bock's avatar
Oliver Bock committed
256
257
258
build_mingw()
{
	echo "Not yet implemented: build_mingw()"
Oliver Bock's avatar
Oliver Bock committed
259
260

	return 0
Oliver Bock's avatar
Oliver Bock committed
261
262
}

Oliver Bock's avatar
Oliver Bock committed
263

Oliver Bock's avatar
Oliver Bock committed
264
265
build_starsphere()
{
Oliver Bock's avatar
Oliver Bock committed
266
	echo "Building Starsphere [ORC]..." | tee -a $LOGFILE
267
268
269
270
271
272
	export ORC_SRC=$ROOT/src/orc || failure
	export ORC_INSTALL=$ROOT/install || failure
	cd $ROOT/build/orc || failure
	cp $ROOT/src/orc/Makefile . >> $LOGFILE 2>&1 || failure
	make >> $LOGFILE 2>&1 || failure
	make install >> $LOGFILE 2>&1 || failure
Oliver Bock's avatar
Oliver Bock committed
273
	echo "Successfully built and installed Starsphere [ORC]!" | tee -a $LOGFILE
274

Oliver Bock's avatar
Oliver Bock committed
275
	echo "Building Starsphere [Framework]..." | tee -a $LOGFILE
276
277
278
279
280
281
	export FRAMEWORK_SRC=$ROOT/src/framework || failure
	export FRAMEWORK_INSTALL=$ROOT/install || failure
	cd $ROOT/build/framework || failure
	cp $ROOT/src/framework/Makefile . >> $LOGFILE 2>&1 || failure
	make >> $LOGFILE 2>&1 || failure
	make install >> $LOGFILE 2>&1 || failure
Oliver Bock's avatar
Oliver Bock committed
282
	echo "Successfully built and installed Starsphere [Framework]!" | tee -a $LOGFILE
283

Oliver Bock's avatar
Oliver Bock committed
284
	echo "Building Starsphere [Application]..." | tee -a $LOGFILE
285
286
287
288
	export STARSPHERE_SRC=$ROOT/src/starsphere || failure
	export STARSPHERE_INSTALL=$ROOT/install || failure
	cd $ROOT/build/starsphere || failure
	cp $ROOT/src/starsphere/*.res . >> $LOGFILE 2>&1 || failure
289
290
291
292
293
	if [ "$1" != "$TARGET_MAC" ]; then
		cp $ROOT/src/starsphere/Makefile . >> $LOGFILE 2>&1 || failure
	else
		cp $ROOT/src/starsphere/Makefile.macos Makefile >> $LOGFILE 2>&1 || failure
	fi
294
295
	make >> $LOGFILE 2>&1 || failure
	make install >> $LOGFILE 2>&1 || failure
Oliver Bock's avatar
Oliver Bock committed
296
	echo "Successfully built and installed Starsphere [Application]!" | tee -a $LOGFILE
Oliver Bock's avatar
Oliver Bock committed
297
298

	return 0
Oliver Bock's avatar
Oliver Bock committed
299
}
Oliver Bock's avatar
Oliver Bock committed
300

Oliver Bock's avatar
Oliver Bock committed
301

Oliver Bock's avatar
Oliver Bock committed
302
303
build_linux()
{
304
305
	build_generic || failure
	build_starsphere || failure
Oliver Bock's avatar
Oliver Bock committed
306
307

	return 0
Oliver Bock's avatar
Oliver Bock committed
308
309
310
311
312
}


build_mac()
{
313
314
	build_generic $TARGET_MAC || failure
	build_starsphere $TARGET_MAC || failure
Oliver Bock's avatar
Oliver Bock committed
315
316

	return 0
Oliver Bock's avatar
Oliver Bock committed
317
318
319
320
321
}


build_win32()
{
Oliver Bock's avatar
Oliver Bock committed
322
323
324
325
326
327
328
	echo "Not yet implemented: build_win32()"

# 	build_mingw
# 	build_generic
# 	build_starsphere

	return 0
Oliver Bock's avatar
Oliver Bock committed
329
330
331
}


Oliver Bock's avatar
Oliver Bock committed
332
333
distclean()
{
334
335
336
	cd $ROOT || failure

	echo "Purging build system..." | tee -a $LOGFILE
Oliver Bock's avatar
Oliver Bock committed
337

338
339
340
	rm -rf 3rdparty || failure
	rm -rf build || failure
	rm -rf install || failure
Oliver Bock's avatar
Oliver Bock committed
341

342
	rm -f .lastbuild || failure
Oliver Bock's avatar
Oliver Bock committed
343
344
345
}


Oliver Bock's avatar
Oliver Bock committed
346
347
check_last_build()
{
348
349
	echo "Checking previous build target..." | tee -a $LOGFILE

Oliver Bock's avatar
Oliver Bock committed
350
	LASTBUILD=`cat .lastbuild 2>/dev/null`
Oliver Bock's avatar
Oliver Bock committed
351

Oliver Bock's avatar
Oliver Bock committed
352
	if [[ ( -f .lastbuild ) && ( "$LASTBUILD" != "$1" ) ]]; then
353
354
355
356
		cd $ROOT || failure
		echo "Build target changed! Purging build and install trees..." | tee -a $LOGFILE
		rm -rf build >> $LOGFILE || failure
		rm -rf install >> $LOGFILE || failure
Oliver Bock's avatar
Oliver Bock committed
357
358
	fi

359
	echo "$1" > .lastbuild || failure
Oliver Bock's avatar
Oliver Bock committed
360
361

	return 0
Oliver Bock's avatar
Oliver Bock committed
362
363
}

Oliver Bock's avatar
Oliver Bock committed
364

Oliver Bock's avatar
Oliver Bock committed
365
366
367
368
369
370
371
372
373
374
375
376
377
print_usage()
{
	cd $ROOT

	echo "*************************"
	echo "Usage: `basename $0` <target>"
	echo
	echo "Available targets:"
	echo "  --linux"
	echo "  --mac"
	echo "  --win32"
	echo "*************************"

Oliver Bock's avatar
Oliver Bock committed
378
	echo "Wrong usage. Stopping!" >> $LOGFILE
Oliver Bock's avatar
Oliver Bock committed
379
380

	return 0
Oliver Bock's avatar
Oliver Bock committed
381
382
383
}


Oliver Bock's avatar
Oliver Bock committed
384
### main control ##########################################################
Oliver Bock's avatar
Oliver Bock committed
385
386
387
388
389

TARGET_LINUX=1
TARGET_MAC=2
TARGET_WIN32=3

390
391
392
393
echo "************************************" | tee -a $LOGFILE
echo "Starting new build!" | tee -a $LOGFILE
echo "`date`" | tee -a $LOGFILE
echo "************************************" | tee -a $LOGFILE
394

Oliver Bock's avatar
Oliver Bock committed
395
# crude command line parsing :-)
396

Oliver Bock's avatar
Oliver Bock committed
397
398
399
if [ $# -ne 1 ]; then
  print_usage
  exit 1
400
401
fi

Oliver Bock's avatar
Oliver Bock committed
402
403
404
case "$1" in
	"--linux")
		TARGET=$TARGET_LINUX
405
		check_last_build "$1" || failure
Oliver Bock's avatar
Oliver Bock committed
406
		echo "Building linux version:" | tee -a $LOGFILE
Oliver Bock's avatar
Oliver Bock committed
407
408
409
		;;
	"--mac")
		TARGET=$TARGET_MAC
410
		check_last_build "$1" || failure
Oliver Bock's avatar
Oliver Bock committed
411
		echo "Building mac version:" | tee -a $LOGFILE
Oliver Bock's avatar
Oliver Bock committed
412
413
		;;
	"--win32")
Oliver Bock's avatar
Oliver Bock committed
414
		TARGET=$TARGET_WIN32
415
		check_last_build "$1" || failure
Oliver Bock's avatar
Oliver Bock committed
416
		echo "Building win32 version:" | tee -a $LOGFILE
Oliver Bock's avatar
Oliver Bock committed
417
		;;
Oliver Bock's avatar
Oliver Bock committed
418
	"--distclean")
419
		distclean || failure
Oliver Bock's avatar
Oliver Bock committed
420
421
		exit 0
		;;
Oliver Bock's avatar
Oliver Bock committed
422
	*)
Oliver Bock's avatar
Oliver Bock committed
423
424
425
		print_usage
		exit 1
		;;
Oliver Bock's avatar
Oliver Bock committed
426
esac
427

Oliver Bock's avatar
Oliver Bock committed
428
# here we go...
429

430
431
check_prerequisites || failure
prepare_generic || failure
Oliver Bock's avatar
Oliver Bock committed
432

Oliver Bock's avatar
Oliver Bock committed
433
434
case $TARGET in
	$TARGET_LINUX)
435
		build_linux || failure
Oliver Bock's avatar
Oliver Bock committed
436
437
		;;
	$TARGET_MAC)
438
		build_mac || failure
Oliver Bock's avatar
Oliver Bock committed
439
440
		;;
	$TARGET_WIN32)
441
		build_win32 || failure
Oliver Bock's avatar
Oliver Bock committed
442
443
444
445
446
447
448
449
		;;
	*)
		# should be unreachable
		print_usage
		exit 1
		;;
esac

450
451
452
453
454
echo "************************************" | tee -a $LOGFILE
echo "Build finished successfully!" | tee -a $LOGFILE
echo "`date`" | tee -a $LOGFILE
echo "************************************" | tee -a $LOGFILE

Oliver Bock's avatar
Oliver Bock committed
455
exit 0