Code cleanup

This commit is contained in:
Pierre Pronchery 2019-05-08 01:59:18 +02:00
parent 3fff50c2a8
commit 8457bae2cd

View File

@ -43,12 +43,9 @@ WGET="wget"
#functions
#main
#Modify the environment to reflect the port chosen
PREFIX="$HOME/opt/cross-gcc-$TARGET"
PATH="$PREFIX/bin:$PATH"
#binutils
_binutils()
{
#Download binutils
[ -f "binutils-$BINUTILS_VERSION.tar.$GZEXT" ] ||
$WGET "$MIRROR/binutils/binutils-$BINUTILS_VERSION.tar.$GZEXT"
@ -68,7 +65,11 @@ $MKDIR "binutils-$TARGET"
for target in $BINUTILS_TARGETS; do
(cd "binutils-$TARGET" && $MAKE "$target")
done
}
#gcc
_gcc()
{
#Download GCC
[ -f "gcc-$GCC_VERSION.tar.$GZEXT" ] ||
$WGET "$MIRROR/gcc/gcc-$GCC_VERSION/gcc-$GCC_VERSION.tar.$GZEXT"
@ -91,3 +92,12 @@ $MKDIR "gcc-$TARGET"
for target in $GCC_TARGETS; do
(cd "gcc-$TARGET" && $MAKE "$target")
done
}
#main
#Modify the environment to reflect the port chosen
PREFIX="$HOME/opt/cross-gcc-$TARGET"
PATH="$PREFIX/bin:$PATH"
_binutils &&
_gcc