Commit 25b42273 authored by Oliver Bock's avatar Oliver Bock
Browse files

Yet another build script update (linux build done!)

* Activated error checking via conditional calls to failure()
** We just exit in case of an error and do not use return value checks anymore (crude but effective)
** Both, stderr and stdout are now always (for non-trivial commands) redirected to the logfile to ensure nice and comprehensible output
* Added "svn revert" right before "svn update" to make sure all files (incl. patched ones) are updated
* Removing target source tree folder when using tarball download (e.g. freetype2)
* Refactored tree preparations
* Improved logging
* Renamed "setup" to "build"
parent 3fdc34a5
...@@ -22,30 +22,28 @@ ...@@ -22,30 +22,28 @@
### TODOs ################################################################# ### TODOs #################################################################
# error level checking (break in case of error, always 2>&1 for make logging)
# more refactoring (every lib in dedicated function? per traget?) # more refactoring (every lib in dedicated function? per traget?)
### globals ############################################################### ### globals ###############################################################
ROOT=`pwd` ROOT=`pwd`
DATE=`date` LOGFILE=$ROOT/build.log
LOGFILE=$ROOT/setup.log
TARGET=0 TARGET=0
### functions ############################################################# ### functions #############################################################
failure() failure()
{ {
echo "************************************" | tee -a echo "************************************" | tee -a $LOGFILE
echo "Error detected! Stopping setup run!" | tee -a $LOGFILE echo "Error detected! Stopping build!" | tee -a $LOGFILE
echo "$DATE" | tee -a $LOGFILE echo "`date`" | tee -a $LOGFILE
if [ -f "$LOGFILE" ]; then if [ -f "$LOGFILE" ]; then
echo "------------------------------------" echo "------------------------------------"
echo "Please check logfile: `basename $LOGFILE`" echo "Please check logfile: `basename $LOGFILE`"
echo "These are the final ten lines:" echo "These are the final ten lines:"
echo "------------------------------------" echo "------------------------------------"
tail -10 $LOGFILE tail -n 14 $LOGFILE | head -n 10 -
fi fi
echo "************************************" | tee -a $LOGFILE echo "************************************" | tee -a $LOGFILE
...@@ -55,14 +53,14 @@ failure() ...@@ -55,14 +53,14 @@ failure()
check_prerequisites() check_prerequisites()
{ {
echo "Checking prerequisites..." echo "Checking prerequisites..." | tee -a $LOGFILE
# required toolchain # required toolchain
TOOLS="automake autoconf m4 cmake wget gcc g++ ld libtool ar lex yacc" TOOLS="automake autoconf m4 cmake wget gcc g++ ld libtool ar lex yacc"
for tool in $TOOLS; do for tool in $TOOLS; do
if ! ( type $tool >/dev/null 2>&1 ); then if ! ( type $tool >/dev/null 2>&1 ); then
echo "Error! Missing \"$tool\" which is a required tool! Stopping..." echo "Missing \"$tool\" which is a required tool!" | tee -a $LOGFILE
return 1 return 1
fi fi
done done
...@@ -71,70 +69,101 @@ check_prerequisites() ...@@ -71,70 +69,101 @@ check_prerequisites()
} }
prepare_generic() prepare_source_tree()
{ {
cd $ROOT
echo "Preparing source tree..." | tee -a $LOGFILE echo "Preparing source tree..." | tee -a $LOGFILE
mkdir -p 3rdparty/oglft >> $LOGFILE mkdir -p 3rdparty/oglft >> $LOGFILE || failure
mkdir -p 3rdparty/boinc >> $LOGFILE mkdir -p 3rdparty/boinc >> $LOGFILE || failure
return 0
}
prepare_build_tree()
{
echo "Preparing build tree..." | tee -a $LOGFILE echo "Preparing build tree..." | tee -a $LOGFILE
mkdir -p build/sdl >> $LOGFILE mkdir -p build/sdl >> $LOGFILE || failure
mkdir -p build/freetype2 >> $LOGFILE mkdir -p build/freetype2 >> $LOGFILE || failure
mkdir -p build/oglft >> $LOGFILE mkdir -p build/oglft >> $LOGFILE || failure
mkdir -p build/boinc >> $LOGFILE mkdir -p build/boinc >> $LOGFILE || failure
mkdir -p build/framework >> $LOGFILE mkdir -p build/framework >> $LOGFILE || failure
mkdir -p build/orc >> $LOGFILE mkdir -p build/orc >> $LOGFILE || failure
mkdir -p build/starsphere >> $LOGFILE mkdir -p build/starsphere >> $LOGFILE || failure
return 0
}
prepare_install_tree()
{
echo "Preparing install tree..." | tee -a $LOGFILE echo "Preparing install tree..." | tee -a $LOGFILE
mkdir -p install/bin >> $LOGFILE mkdir -p install/bin >> $LOGFILE || failure
mkdir -p install/include >> $LOGFILE mkdir -p install/include >> $LOGFILE || failure
mkdir -p install/lib >> $LOGFILE mkdir -p install/lib >> $LOGFILE || failure
return 0
}
prepare_generic()
{
prepare_source_tree || failure
prepare_build_tree || failure
prepare_install_tree || failure
# prepare additional sources # prepare additional sources
mkdir -p 3rdparty/sdl >> $LOGFILE cd $ROOT || failure
cd $ROOT/3rdparty/sdl mkdir -p 3rdparty/sdl >> $LOGFILE 2>&1 || failure
cd $ROOT/3rdparty/sdl || failure
if [ -d .svn ]; then if [ -d .svn ]; then
echo "Updating SDL..." | tee -a $LOGFILE echo "Updating SDL..." | tee -a $LOGFIL
svn update >> $LOGFILE # make sure local changes (patches) are reverted, hence also updated
svn revert -R . >> $LOGFILE 2>&1 || failure
svn update >> $LOGFILE 2>&1 || failure
else else
echo "Retrieving SDL (this may take a while)..." | tee -a $LOGFILE echo "Retrieving SDL (this may take a while)..." | tee -a $LOGFILE
svn checkout http://svn.libsdl.org/branches/SDL-1.2 . >> $LOGFILE svn checkout http://svn.libsdl.org/branches/SDL-1.2 . >> $LOGFILE 2>&1 || failure
fi fi
# cd $ROOT/3rdparty # cd $ROOT/3rdparty || failure
# echo "Retrieving SDL (this may take a while)..." | tee -a $LOGFILE # echo "Retrieving SDL (this may take a while)..." | tee -a $LOGFILE
# wget http://www.libsdl.org/release/SDL-1.2.14.tar.gz >> $LOGFILE 2>&1 # 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 # tar -xzf SDL-1.2.14.tar.gz >> $LOGFILE 2>&1 || failure
# rm SDL-1.2.14.tar.gz >> $LOGFILE # rm SDL-1.2.14.tar.gz >> $LOGFILE 2>&1 || failure
# mv SDL-1.2.14 sdl >> $LOGFILE # substitute old source tree
# rm -rf sdl >> $LOGFILE 2>&1 || failure
# mv SDL-1.2.14 sdl >> $LOGFILE 2>&1 || failure
cd $ROOT/3rdparty cd $ROOT/3rdparty || failure
echo "Retrieving Freetype2 (this may take a while)..." | tee -a $LOGFILE echo "Retrieving Freetype2 (this may take a while)..." | tee -a $LOGFILE
wget http://mesh.dl.sourceforge.net/sourceforge/freetype/freetype-2.3.5.tar.bz2 >> $LOGFILE 2>&1 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 tar -xjf freetype-2.3.5.tar.bz2 >> $LOGFILE 2>&1 || failure
rm freetype-2.3.5.tar.bz2 >> $LOGFILE rm freetype-2.3.5.tar.bz2 >> $LOGFILE 2>&1 || failure
mv freetype-2.3.5 freetype2 >> $LOGFILE # substitute old source tree
rm -rf freetype2 >> $LOGFILE 2>&1 || failure
mv freetype-2.3.5 freetype2 >> $LOGFILE 2>&1 || failure
cd $ROOT/3rdparty/oglft cd $ROOT/3rdparty/oglft || failure
if [ -d .svn ]; then if [ -d .svn ]; then
echo "Updating OGLFT..." | tee -a $LOGFILE echo "Updating OGLFT..." | tee -a $LOGFILE
svn update >> ../../setup.log # make sure local changes (patches) are reverted, hence also updated
svn revert -R . >> $LOGFILE 2>&1 || failure
svn update >> $LOGFILE 2>&1 || failure
else else
echo "Retrieving OGLFT (this may take a while)..." | tee -a $LOGFILE echo "Retrieving OGLFT (this may take a while)..." | tee -a $LOGFILE
svn checkout https://oglft.svn.sourceforge.net/svnroot/oglft/trunk . >> $LOGFILE svn checkout https://oglft.svn.sourceforge.net/svnroot/oglft/trunk . >> $LOGFILE 2>&1 || failure
fi fi
cd $ROOT/3rdparty/boinc cd $ROOT/3rdparty/boinc || failure
if [ -d .svn ]; then if [ -d .svn ]; then
echo "Updating BOINC..." | tee -a $LOGFILE echo "Updating BOINC..." | tee -a $LOGFILE
svn update >> $LOGFILE # make sure local changes (patches) are reverted, hence also updated
svn revert -R . >> $LOGFILE 2>&1 || failure
svn update >> $LOGFILE 2>&1 || failure
else else
echo "Retrieving BOINC (this may take a while)..." | tee -a $LOGFILE echo "Retrieving BOINC (this may take a while)..." | tee -a $LOGFILE
svn checkout http://boinc.berkeley.edu/svn/trunk/boinc . >> $LOGFILE svn checkout http://boinc.berkeley.edu/svn/trunk/boinc . >> $LOGFILE 2>&1 || failure
fi fi
return 0 return 0
...@@ -143,26 +172,26 @@ prepare_generic() ...@@ -143,26 +172,26 @@ prepare_generic()
prepare_win32() prepare_win32()
{ {
cd $ROOT cd $ROOT || failure
echo "Preparing MinGW source tree..." | tee -a $LOGFILE echo "Preparing MinGW source tree..." | tee -a $LOGFILE
mkdir -p 3rdparty/mingw/xscripts >> $LOGFILE mkdir -p 3rdparty/mingw/xscripts >> $LOGFILE || failure
cd 3rdparty/mingw/xscripts cd 3rdparty/mingw/xscripts || failure
if [ -d CVS ]; then if [ -d CVS ]; then
echo "Updating MinGW build script..." | tee -a $LOGFILE echo "Updating MinGW build script..." | tee -a $LOGFILE
cvs update -C >> $LOGFILE 2>&1 cvs update -C >> $LOGFILE 2>&1 || failure
else else
cd .. cd .. || failure
echo "Retrieving MinGW build script (this may take a while)..." | tee -a $LOGFILE echo "Retrieving MinGW build script (this may take a while)..." | tee -a $LOGFILE
cvs -z3 -d:pserver:anonymous@mingw.cvs.sourceforge.net:/cvsroot/mingw checkout -P xscripts >> $LOGFILE 2>&1 cvs -z3 -d:pserver:anonymous@mingw.cvs.sourceforge.net:/cvsroot/mingw checkout -P xscripts >> $LOGFILE 2>&1 || failure
fi fi
cd $ROOT/3rdparty/mingw/xscripts cd $ROOT/3rdparty/mingw/xscripts || failure
echo "Preparing MinGW build script..." | tee -a $LOGFILE echo "Preparing MinGW build script..." | tee -a $LOGFILE
# note: svn has no force/overwrite switch. the file might not be updated when patched # note: svn has no force/overwrite switch. the file might not be updated when patched
patch x86-mingw32-build.sh.conf < $ROOT/patches/x86-mingw32-build.sh.conf.patch >> $LOGFILE patch x86-mingw32-build.sh.conf < $ROOT/patches/x86-mingw32-build.sh.conf.patch >> $LOGFILE || failure
chmod +x x86-mingw32-build.sh >> $LOGFILE chmod +x x86-mingw32-build.sh >> $LOGFILE || failure
return 0 return 0
} }
...@@ -170,53 +199,53 @@ prepare_win32() ...@@ -170,53 +199,53 @@ prepare_win32()
build_generic() build_generic()
{ {
cd $ROOT/3rdparty/sdl cd $ROOT/3rdparty/sdl || failure
echo "Building SDL (this may take a while)..." | tee -a $LOGFILE echo "Building SDL (this may take a while)..." | tee -a $LOGFILE
./autogen.sh >> $LOGFILE ./autogen.sh >> $LOGFILE 2>&1 || failure
cd $ROOT/build/sdl cd $ROOT/build/sdl || failure
$ROOT/3rdparty/sdl/configure --prefix=$ROOT/install --enable-shared=no --enable-static=yes >> $LOGFILE $ROOT/3rdparty/sdl/configure --prefix=$ROOT/install --enable-shared=no --enable-static=yes >> $LOGFILE 2>&1 || failure
make >> $LOGFILE make >> $LOGFILE 2>&1 || failure
make install >> $LOGFILE make install >> $LOGFILE 2>&1 || failure
echo "Successfully built and installed SDL!" | tee -a $LOGFILE echo "Successfully built and installed SDL!" | tee -a $LOGFILE
cd $ROOT/3rdparty/freetype2 cd $ROOT/3rdparty/freetype2 || failure
echo "Building Freetype2 (this may take a while)..." | tee -a $LOGFILE echo "Building Freetype2 (this may take a while)..." | tee -a $LOGFILE
chmod +x autogen.sh >> $LOGFILE chmod +x autogen.sh >> $LOGFILE 2>&1 || failure
chmod +x configure >> $LOGFILE chmod +x configure >> $LOGFILE 2>&1 || failure
./autogen.sh >> $LOGFILE ./autogen.sh >> $LOGFILE 2>&1 || failure
cd $ROOT/build/freetype2 cd $ROOT/build/freetype2 || failure
# note: freetype (or sdl?) probably doesn't need *no* configure when static -> ansi build, see readme! # note: freetype (or sdl?) probably doesn't need *no* configure when static -> ansi build, see readme!
$ROOT/3rdparty/freetype2/configure --prefix=$ROOT/install --enable-shared=no --enable-static=yes >> $LOGFILE $ROOT/3rdparty/freetype2/configure --prefix=$ROOT/install --enable-shared=no --enable-static=yes >> $LOGFILE 2>&1 || failure
make >> $LOGFILE make >> $LOGFILE 2>&1 || failure
make install >> $LOGFILE make install >> $LOGFILE 2>&1 || failure
echo "Successfully built and installed Freetype2!" | tee -a $LOGFILE echo "Successfully built and installed Freetype2!" | tee -a $LOGFILE
cd $ROOT/3rdparty/oglft cd $ROOT/3rdparty/oglft || failure
echo "Patching OGLFT..." | tee -a $LOGFILE echo "Patching OGLFT..." | tee -a $LOGFILE
# note: svn has no force/overwrite switch. patched files might not be updated # note: svn has no force/overwrite switch. patched files might not be updated
# patch: use fixed settings for freetype, deactivate FindFreetype # patch: use fixed settings for freetype, deactivate FindFreetype
FREETYPE2_INCLUDE_DIR="$ROOT/install/include" FREETYPE2_INCLUDE_DIR="$ROOT/install/include"
FREETYPE2_LIBRARIES="$ROOT/install/lib/liboglft.a" FREETYPE2_LIBRARIES="$ROOT/install/lib/liboglft.a"
patch CMakeLists.txt < $ROOT/patches/CMakeLists.txt.oglft.patch >> $LOGFILE patch CMakeLists.txt < $ROOT/patches/CMakeLists.txt.oglft.patch >> $LOGFILE 2>&1 || failure
# patch: build static lib instead of shared # patch: build static lib instead of shared
cd $ROOT/3rdparty/oglft/liboglft cd $ROOT/3rdparty/oglft/liboglft || failure
patch CMakeLists.txt < $ROOT/patches/CMakeLists.txt.liboglft.patch >> $LOGFILE patch CMakeLists.txt < $ROOT/patches/CMakeLists.txt.liboglft.patch >> $LOGFILE 2>&1 || failure
echo "Building OGLFT..." | tee -a $LOGFILE echo "Building OGLFT..." | tee -a $LOGFILE
cd $ROOT/build/oglft cd $ROOT/build/oglft || failure
cmake -DFREETYPE2_INCLUDE_DIR="$FREETYPE2_INCLUDE_DIR" -DFREETYPE2_LIBRARIES="$FREETYPE2_LIBRARIES" $ROOT/3rdparty/oglft >> $LOGFILE cmake -DFREETYPE2_INCLUDE_DIR="$FREETYPE2_INCLUDE_DIR" -DFREETYPE2_LIBRARIES="$FREETYPE2_LIBRARIES" $ROOT/3rdparty/oglft >> $LOGFILE 2>&1 || failure
make >> $LOGFILE make >> $LOGFILE 2>&1 || failure
mkdir -p $ROOT/install/include/oglft >> $LOGFILE mkdir -p $ROOT/install/include/oglft >> $LOGFILE 2>&1 || failure
cp OGLFT.h $ROOT/install/include/oglft >> $LOGFILE cp OGLFT.h $ROOT/install/include/oglft >> $LOGFILE 2>&1 || failure
cp liboglft/liboglft.a $ROOT/install/lib >> $LOGFILE cp liboglft/liboglft.a $ROOT/install/lib >> $LOGFILE 2>&1 || failure
echo "Successfully built and installed OGLFT!" | tee -a $LOGFILE echo "Successfully built and installed OGLFT!" | tee -a $LOGFILE
cd $ROOT/3rdparty/boinc cd $ROOT/3rdparty/boinc || failure
echo "Building BOINC (this may take a while)..." | tee -a $LOGFILE echo "Building BOINC (this may take a while)..." | tee -a $LOGFILE
./_autosetup >> $LOGFILE ./_autosetup >> $LOGFILE 2>&1 || failure
cd $ROOT/build/boinc cd $ROOT/build/boinc || failure
$ROOT/3rdparty/boinc/configure --prefix=$ROOT/install --enable-shared=no --enable-static=yes --disable-server --disable-client >> $LOGFILE $ROOT/3rdparty/boinc/configure --prefix=$ROOT/install --enable-shared=no --enable-static=yes --disable-server --disable-client >> $LOGFILE 2>&1 || failure
make >> $LOGFILE make >> $LOGFILE 2>&1 || failure
make install >> $LOGFILE make install >> $LOGFILE 2>&1 || failure
echo "Successfully built and installed BOINC!" | tee -a $LOGFILE echo "Successfully built and installed BOINC!" | tee -a $LOGFILE
return 0 return 0
...@@ -234,31 +263,31 @@ build_mingw() ...@@ -234,31 +263,31 @@ build_mingw()
build_starsphere() build_starsphere()
{ {
echo "Building Starsphere [ORC]..." | tee -a $LOGFILE echo "Building Starsphere [ORC]..." | tee -a $LOGFILE
export ORC_SRC=$ROOT/src/orc export ORC_SRC=$ROOT/src/orc || failure
export ORC_INSTALL=$ROOT/install export ORC_INSTALL=$ROOT/install || failure
cd $ROOT/build/orc cd $ROOT/build/orc || failure
cp $ROOT/src/orc/Makefile . >> $LOGFILE cp $ROOT/src/orc/Makefile . >> $LOGFILE 2>&1 || failure
make >> $LOGFILE make >> $LOGFILE 2>&1 || failure
make install >> $LOGFILE make install >> $LOGFILE 2>&1 || failure
echo "Successfully built and installed Starsphere [ORC]!" | tee -a $LOGFILE echo "Successfully built and installed Starsphere [ORC]!" | tee -a $LOGFILE
echo "Building Starsphere [Framework]..." | tee -a $LOGFILE echo "Building Starsphere [Framework]..." | tee -a $LOGFILE
export FRAMEWORK_SRC=$ROOT/src/framework export FRAMEWORK_SRC=$ROOT/src/framework || failure
export FRAMEWORK_INSTALL=$ROOT/install export FRAMEWORK_INSTALL=$ROOT/install || failure
cd $ROOT/build/framework cd $ROOT/build/framework || failure
cp $ROOT/src/framework/Makefile . >> $LOGFILE cp $ROOT/src/framework/Makefile . >> $LOGFILE 2>&1 || failure
make >> $LOGFILE make >> $LOGFILE 2>&1 || failure
make install >> $LOGFILE make install >> $LOGFILE 2>&1 || failure
echo "Successfully built and installed Starsphere [Framework]!" | tee -a $LOGFILE echo "Successfully built and installed Starsphere [Framework]!" | tee -a $LOGFILE
echo "Building Starsphere [Application]..." | tee -a $LOGFILE echo "Building Starsphere [Application]..." | tee -a $LOGFILE
export STARSPHERE_SRC=$ROOT/src/starsphere export STARSPHERE_SRC=$ROOT/src/starsphere || failure
export STARSPHERE_INSTALL=$ROOT/install export STARSPHERE_INSTALL=$ROOT/install || failure
cd $ROOT/build/starsphere cd $ROOT/build/starsphere || failure
cp $ROOT/src/starsphere/Makefile . >> $LOGFILE cp $ROOT/src/starsphere/Makefile . >> $LOGFILE 2>&1 || failure
cp $ROOT/src/starsphere/*.res . >> $LOGFILE cp $ROOT/src/starsphere/*.res . >> $LOGFILE 2>&1 || failure
make >> $LOGFILE make >> $LOGFILE 2>&1 || failure
make install >> $LOGFILE make install >> $LOGFILE 2>&1 || failure
echo "Successfully built and installed Starsphere [Application]!" | tee -a $LOGFILE echo "Successfully built and installed Starsphere [Application]!" | tee -a $LOGFILE
return 0 return 0
...@@ -267,8 +296,8 @@ build_starsphere() ...@@ -267,8 +296,8 @@ build_starsphere()
build_linux() build_linux()
{ {
build_generic build_generic || failure
build_starsphere build_starsphere || failure
return 0 return 0
} }
...@@ -299,27 +328,32 @@ build_win32() ...@@ -299,27 +328,32 @@ build_win32()
distclean() distclean()
{ {
cd $ROOT cd $ROOT || failure
echo "Purging build system..." | tee -a $LOGFILE
rm -rf 3rdparty rm -rf 3rdparty || failure
rm -rf build rm -rf build || failure
rm -rf install rm -rf install || failure
rm -f .lastbuild rm -f .lastbuild || failure
} }
check_last_build() check_last_build()
{ {
echo "Checking previous build target..." | tee -a $LOGFILE
LASTBUILD=`cat .lastbuild 2>/dev/null` LASTBUILD=`cat .lastbuild 2>/dev/null`
if [[ ( -f .lastbuild ) && ( "$LASTBUILD" != "$1" ) ]]; then if [[ ( -f .lastbuild ) && ( "$LASTBUILD" != "$1" ) ]]; then
cd $ROOT cd $ROOT || failure
rm -rf build echo "Build target changed! Purging build and install trees..." | tee -a $LOGFILE
rm -rf install rm -rf build >> $LOGFILE || failure
rm -rf install >> $LOGFILE || failure
fi fi
echo "$1" > .lastbuild echo "$1" > .lastbuild || failure
return 0 return 0
} }
...@@ -350,10 +384,10 @@ TARGET_LINUX=1 ...@@ -350,10 +384,10 @@ TARGET_LINUX=1
TARGET_MAC=2 TARGET_MAC=2
TARGET_WIN32=3 TARGET_WIN32=3
echo "************************************" >> $LOGFILE echo "************************************" | tee -a $LOGFILE
echo "Starting new setup run!" >> $LOGFILE echo "Starting new build!" | tee -a $LOGFILE
echo "$DATE" >> $LOGFILE echo "`date`" | tee -a $LOGFILE
echo "************************************" >> $LOGFILE echo "************************************" | tee -a $LOGFILE
# crude command line parsing :-) # crude command line parsing :-)
...@@ -365,21 +399,21 @@ fi ...@@ -365,21 +399,21 @@ fi
case "$1" in case "$1" in
"--linux") "--linux")
TARGET=$TARGET_LINUX TARGET=$TARGET_LINUX
check_last_build "$1" check_last_build "$1" || failure
echo "Building linux version:" | tee -a $LOGFILE echo "Building linux version:" | tee -a $LOGFILE
;; ;;
"--mac") "--mac")
TARGET=$TARGET_MAC TARGET=$TARGET_MAC
check_last_build "$1" check_last_build "$1" || failure
echo "Building mac version:" | tee -a $LOGFILE echo "Building mac version:" | tee -a $LOGFILE
;; ;;
"--win32") "--win32")
TARGET=$TARGET_WIN32 TARGET=$TARGET_WIN32
check_last_build "$1" check_last_build "$1" || failure
echo "Building win32 version:" | tee -a $LOGFILE echo "Building win32 version:" | tee -a $LOGFILE
;; ;;
"--distclean") "--distclean")
distclean distclean || failure
exit 0 exit 0
;; ;;
*) *)
...@@ -390,34 +424,18 @@ esac ...@@ -390,34 +424,18 @@ esac
# here we go... # here we go...
check_prerequisites check_prerequisites || failure
if [ ! $? -eq 0 ]; then prepare_generic || failure
exit 1
fi
prepare_generic
if [ ! $? -eq 0 ]; then
exit 1
fi
case $TARGET in case $TARGET in
$TARGET_LINUX) $TARGET_LINUX)
build_linux build_linux || failure
if [ ! $? -eq 0 ]; then
exit 1
fi
;; ;;
$TARGET_MAC) $TARGET_MAC)
build_mac build_mac || failure
if [ ! $? -eq 0 ]; then
exit 1
fi
;; ;;
$TARGET_WIN32) $TARGET_WIN32)
build_win32 build_win32 || failure
if [ ! $? -eq 0 ]; then
exit 1
fi
;; ;;
*) *)
# should be unreachable # should be unreachable
...@@ -426,4 +444,9 @@ case $TARGET in ...@@ -426,4 +444,9 @@ case $TARGET in
;; ;;
esac esac
echo "************************************" | tee -a $LOGFILE
echo "Build finished successfully!" | tee -a $LOGFILE
echo "`date`" | tee -a $LOGFILE
echo "************************************" | tee -a $LOGFILE
exit 0 exit 0
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment