travis-build.sh 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #!/usr/bin/env bash
  2. LOCAL_TOOLS_DIR=$HOME/avr-tools
  3. if [ -z "$TRAVIS_BUILD_DIR" ]; then
  4. echo "This script should be run by Travis-CI environment"
  5. echo "If you want to simulate Travis build, please set TRAVIS_BUILD_DIR"
  6. echo "environment variable to directory where your code lives"
  7. exit 1
  8. fi
  9. if [ -z "$1" ]; then
  10. echo "Arduino version required"
  11. exit 1
  12. fi
  13. if [ -z "$2" ]; then
  14. echo "Target required"
  15. exit 1
  16. fi
  17. # Include functions to download stuff
  18. . $TRAVIS_BUILD_DIR/scripts/travis-download.inc.sh
  19. # Make directory for tools
  20. mkdir -p $LOCAL_TOOLS_DIR
  21. # get new make as Optiboot requires version >4.0
  22. download_make4
  23. # download specific tools version
  24. if [ "$1" = "microchip" ]; then
  25. download_avr_toolchain
  26. # set search path
  27. PATH=$LOCAL_TOOLS_DIR/usr/bin:$PATH:$LOCAL_TOOLS_DIR/avr8-gnu-toolchain-linux_x86_64/bin
  28. avr-gcc --version
  29. else
  30. download_arduino $1
  31. # set search path
  32. PATH=$LOCAL_TOOLS_DIR/usr/bin:$PATH:$LOCAL_TOOLS_DIR/arduino-$1/hardware/tools/avr/bin
  33. fi
  34. cd $TRAVIS_BUILD_DIR/optiboot/bootloaders/optiboot
  35. make --version
  36. make clean
  37. shift
  38. make $@