Skip to content

Instantly share code, notes, and snippets.

@beriberikix
Last active September 20, 2020 10:32
Show Gist options
  • Save beriberikix/9d34d4d2a57baa2d360c920912190c08 to your computer and use it in GitHub Desktop.
Save beriberikix/9d34d4d2a57baa2d360c920912190c08 to your computer and use it in GitHub Desktop.
shell script to switch between versions of GCC ARM Embedded
#!/bin/bash
# place in folder and add folder to $PATH
# also add $BIN to path
BIN=~/bin/gcc-arm/gcc-arm-bin
OPTIONS="4.9.3 5.4.1 6.2.1"
select opt in $OPTIONS; do
if [ "$opt" = "4.9.3" ]; then
echo 4.9.3 20150529
if [ -L $BIN ]; then
rm $BIN
fi
ln -s ~/bin/gcc-arm/gcc-arm-none-eabi-4_9-2015q3/bin/ $BIN
exit
elif [ "$opt" = "5.4.1" ]; then
echo 5.4.1 20160919
if [ -L $BIN ]; then
rm $BIN
fi
ln -s ~/bin/gcc-arm/gcc-arm-none-eabi-5_4-2016q3/bin/ $BIN
exit
elif [ "$opt" = "6.2.1" ]; then
echo 6.2.1 20161205
if [ -L $BIN ]; then
rm $BIN
fi
ln -s ~/bin/gcc-arm/gcc-arm-none-eabi-6-2017-q2-update/bin/ $BIN
exit
else
clear
echo Unknown build
exit
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment