Skip to content

Commit

Permalink
Improve toolchain install script
Browse files Browse the repository at this point in the history
Cleanup broken toolchain directories
  • Loading branch information
devanlai committed Feb 28, 2018
1 parent 226df12 commit af617c2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions util/install-toolchain.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,20 @@ set -eo pipefail
URL=https://launchpad.net/gcc-arm-embedded/5.0/5-2015-q4-major/+download/gcc-arm-none-eabi-5_2-2015q4-20151219-linux.tar.bz2
TOOLCHAIN=gcc-arm-none-eabi-5_2-2015q4
TOOLCHAINS=$HOME/toolchains
TOOLCHAIN_MISSING=0

if [[ ! -d "${TOOLCHAINS}/gcc-arm-embedded" ]]; then
TOOLCHAIN_MISSING=1
fi;
if [[ ! -f "${TOOLCHAINS}/gcc-arm-embedded/bin/arm-none-eabi-gcc" ]]; then
TOOLCHAIN_MISSING=1
fi;

if [ $TOOLCHAIN_MISSING -eq 1 ]; then
echo "Installing $TOOLCHAIN from $URL to ${TOOLCHAINS}"
mkdir -p ${TOOLCHAINS}
wget -qO- $URL | tar xj -C ${TOOLCHAINS}
rm -rf ${TOOLCHAINS}/gcc-arm-embedded
ln -s $TOOLCHAIN ${TOOLCHAINS}/gcc-arm-embedded
fi;

Expand Down

0 comments on commit af617c2

Please sign in to comment.