build-avr-gdb 755 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_GDB.tar.xz ]; then
  14. wget https://ftp.mirrorservice.org/sites/sourceware.org/pub/gdb/releases/$NAME_GDB.tar.xz
  15. fi
  16. # Make AVR-libc
  17. NAME_GDB_BLD=${NAME_GDB}_bld
  18. echo "Making AVR-GDB in $NAME_GDB_BLD..."
  19. echo "Extracting..."
  20. rm -rf $NAME_GDB/
  21. tar xf $NAME_GDB.tar.xz
  22. makeDir $NAME_GDB_BLD
  23. cd $NAME_GDB_BLD
  24. ../$NAME_GDB/configure --prefix=$PREFIX --target=avr
  25. make -j $JOBCOUNT
  26. sudo make install
  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