Make rockboxdev.sh building multiple targets in a run work again by not complaining if build dir exists. Small other fixes too, like for clearing the build folders or showing the summaries.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@20677 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Thomas Martitz 2009-04-10 15:35:24 +00:00
parent 30b888cb58
commit 0eb9288056

View file

@ -125,12 +125,12 @@ echo "Build dir: $builddir (set RBDEV_BUILD to change dir)"
# Verify that the prefix dir exists and that we can write to it, # Verify that the prefix dir exists and that we can write to it,
# as otherwise we will hardly be able to install there! # as otherwise we will hardly be able to install there!
if test ! -d $prefix; then if test ! -d $prefix; then
echo "WARNING: The installation destination does not exist." echo "ERROR: The installation destination does not exist."
echo "Please create it and re-run this script" echo "Please create it and re-run this script"
exit exit
fi fi
if test ! -w $prefix; then if test ! -w $prefix; then
echo "WARNING: This script is set to install in $prefix but has no write permissions for it" echo "ERROR: This script is set to install in $prefix but has no write permissions for it"
echo "Please fix this and re-run this script" echo "Please fix this and re-run this script"
exit exit
fi fi
@ -139,8 +139,10 @@ fi
cleardir () { cleardir () {
# $1 is the name of the build dir # $1 is the name of the build dir
# $2 is the arch
# delete the build dirs and the source dirs # delete the build dirs and the source dirs
rm -rf $1/build-gcc $1/build-binu $1/gcc* $1/binutils* echo "Cleaning up build folder"
rm -rf $1/build-gcc-$2 $1/build-binu-$2
} }
buildone () { buildone () {
@ -244,14 +246,16 @@ fi
########################################################################### ###########################################################################
# If there's already a build dir, we don't overwrite or delete it # If there's already a build dir, we don't overwrite or delete it
if test -d $builddir; then if test -d $builddir; then
echo "You already have a $builddir directory!" if test ! -w $builddir; then
echo "Please remove it and re-run the script" echo "ERROR: No write permissions for the build directory!"
exit exit
fi
else else
mkdir -p $builddir mkdir -p $builddir
cd $builddir
fi fi
cd $builddir
########################################################################### ###########################################################################
# Create a summary file for each toolchain, containing info about the version # Create a summary file for each toolchain, containing info about the version
# and a remainder to append the compiler path to PATH # and a remainder to append the compiler path to PATH
@ -282,10 +286,10 @@ if test -n "$gccpatch"; then
patch -p0 < "$dlwhere/$gccpatch" patch -p0 < "$dlwhere/$gccpatch"
fi fi
echo "ROCKBOXDEV: mkdir build-binu" echo "ROCKBOXDEV: mkdir build-binu-$1"
mkdir build-binu mkdir build-binu-$1
echo "ROCKBOXDEV: cd build-binu" echo "ROCKBOXDEV: cd build-binu-$1"
cd build-binu cd build-binu-$1
echo "ROCKBOXDEV: binutils/configure" echo "ROCKBOXDEV: binutils/configure"
# we undefine _FORTIFY_SOURCE to make the binutils built run fine on recent # we undefine _FORTIFY_SOURCE to make the binutils built run fine on recent
# Ubuntu installations # Ubuntu installations
@ -294,14 +298,14 @@ echo "ROCKBOXDEV: binutils/make"
$make $make
echo "ROCKBOXDEV: binutils/make install to $prefix/$target" echo "ROCKBOXDEV: binutils/make install to $prefix/$target"
$make install $make install
cd .. # get out of build-binu cd .. # get out of build-binu-$1
PATH="$bindir:${PATH}" PATH="$bindir:${PATH}"
SHELL=/bin/sh # seems to be needed by the gcc build in some cases SHELL=/bin/sh # seems to be needed by the gcc build in some cases
echo "ROCKBOXDEV: mkdir build-gcc" echo "ROCKBOXDEV: mkdir build-gcc-$1"
mkdir build-gcc mkdir build-gcc-$1
echo "ROCKBOXDEV: cd build-gcc" echo "ROCKBOXDEV: cd build-gcc-$1"
cd build-gcc cd build-gcc-$1
echo "ROCKBOXDEV: gcc/configure" echo "ROCKBOXDEV: gcc/configure"
# we undefine _FORTIFY_SOURCE to make the gcc build go through fine on # we undefine _FORTIFY_SOURCE to make the gcc build go through fine on
# recent Ubuntu installations # recent Ubuntu installations
@ -313,8 +317,7 @@ $make install
cd .. # get out of build-gcc cd .. # get out of build-gcc
cd .. # get out of $builddir cd .. # get out of $builddir
# end of buildone() function } # buildone()
}
echo "" echo ""
echo "Select target arch:" echo "Select target arch:"
@ -323,7 +326,7 @@ echo "m - m68k (iriver h1x0/h3x0, ifp7x0 and iaudio)"
echo "a - arm (ipods, iriver H10, Sansa, etc)" echo "a - arm (ipods, iriver H10, Sansa, etc)"
echo "i - mips (Jz4740 and ATJ-based players)" echo "i - mips (Jz4740 and ATJ-based players)"
echo "separate multiple targets with spaces" echo "separate multiple targets with spaces"
echo "(i.e. \"s m a\" will build sh, m86k and arm)" echo "(Example: \"s m a\" will build sh, m86k and arm)"
echo "" echo ""
selarch=`input` selarch=`input`
@ -334,30 +337,33 @@ echo ""
case $arch in case $arch in
[Ss]) [Ss])
buildone $arch buildone $arch
cleardir $builddir $arch
;; ;;
[Ii]) [Ii])
buildone $arch buildone $arch
cleardir $builddir $arch
;; ;;
[Mm]) [Mm])
buildone $arch buildone $arch
cleardir $builddir $arch
;; ;;
[Aa]) [Aa])
buildone $arch buildone $arch
cleardir $builddir $arch
;; ;;
*) *)
echo "An unsupported architecture option: $arch" echo "An unsupported architecture option: $arch"
exit exit
;; ;;
esac esac
echo "Cleaning up build folder"
cleardir $builddir
echo ""
echo "Done!"
echo ""
echo "Make your PATH include $pathadd"
done done
# show the summaries: # show the summaries:
cat $builddir/summary-* cat $builddir/summary-*
rm $builddir/summary-*
echo ""
echo "Done!"
echo ""
echo "Make your PATH include $pathadd"
echo ""