build-avrdude 799 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #!/bin/bash
  2. # http://www.nongnu.org/avr-libc/user-manual/install_tools.html
  3. # Stop on errors
  4. set -e
  5. source avr-file-names
  6. TIME_START=$(date +%s)
  7. makeDir()
  8. {
  9. rm -rf "$1/"
  10. mkdir -p "$1"
  11. }
  12. echo "Downloading sources..."
  13. if [ ! -f $NAME_AVRDUDE.tar.gz ]; then
  14. wget https://ftp.mirrorservice.org/sites/download.savannah.gnu.org/releases/avrdude/$NAME_AVRDUDE.tar.gz
  15. fi
  16. # Make avrdude
  17. NAME_AVRDUDE_BLD=${NAME_AVRDUDE}_bld
  18. echo "Making AVRDUDE in $NAME_AVRDUDE_BLD..."
  19. echo "Extracting..."
  20. rm -rf $NAME_AVRDUDE/
  21. tar xzf $NAME_AVRDUDE.tar.gz
  22. makeDir $NAME_AVRDUDE_BLD
  23. cd $NAME_AVRDUDE_BLD
  24. ../$NAME_AVRDUDE/configure --prefix=$PREFIX
  25. make -j $JOBCOUNT
  26. sudo make install-strip
  27. cd ..
  28. TIME_END=$(date +%s)
  29. TIME_RUN=$(($TIME_END - $TIME_START))
  30. echo ""
  31. echo "Done in $TIME_RUN seconds"
  32. exit 0