123456789101112131415161718192021222324252627282930 |
- #!/bin/bash
- if ! [ -x "$(command -v make)" ]
- then
- sudo apt-get install build-essential -y
- fi
- archi=$(uname -m | awk {'print$1'} | head -c3)
- if [ $archi = "arm" ]
- then
- wget -c http://wareck.free.fr/cross_compilation/avr_toolchain/avr_toolchain_arm.tar.xz
- tar xvfJ avr_toolchain_arm.tar.xz
- sudo cp -r avr /usr/local
- rm -r -f avr
- rm -f avr_toolchain_arm.tar.xz
- else
- wget -c http://wareck.free.fr/cross_compilation/avr_toolchain/avr_toolchain.tar.xz
- tar xvfJ avr_toolchain.tar.xz
- sudo cp -r avr /usr/local
- rm -r -f avr
- rm avr_toolchain.tar.xz
- fi
- if ! grep "/usr/local/avr/bin" ~/.bashrc >/dev/null
- then
- echo "export PATH=XXXXPATH::/usr/local/avr/bin" >> ~/.bashrc
- sed -i -e "s/XXXX/$/g" ~/.bashrc
- source ~/.bashrc
- fi
- echo "Done."
|