build.sh 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/bash
  2. BUILD_ENV="1.0.1"
  3. SCRIPT_PATH="$( cd "$(dirname "$0")" ; pwd -P )"
  4. if [ ! -d "build-env" ]; then
  5. mkdir build-env || exit 1
  6. fi
  7. cd build-env || exit 2
  8. if [ ! -f "PF-build-env-Linux64-$BUILD_ENV.zip" ]; then
  9. wget https://github.com/mkbel/PF-build-env/releases/download/$BUILD_ENV/PF-build-env-Linux64-$BUILD_ENV.zip || exit 3
  10. fi
  11. if [ ! -d "../../PF-build-env-$BUILD_ENV" ]; then
  12. unzip -q PF-build-env-Linux64-$BUILD_ENV.zip -d ../../PF-build-env-$BUILD_ENV || exit 4
  13. fi
  14. cd ../../PF-build-env-$BUILD_ENV || exit 5
  15. BUILD_ENV_PATH="$( pwd -P )"
  16. cd ..
  17. if [ ! -d "Prusa-Firmware-build" ]; then
  18. mkdir Prusa-Firmware-build || exit 6
  19. fi
  20. cd Prusa-Firmware-build || exit 7
  21. BUILD_PATH="$( pwd -P )"
  22. if [ ! -f "$SCRIPT_PATH/Firmware/Configuration_prusa.h" ]; then
  23. cp $SCRIPT_PATH/Firmware/variants/1_75mm_MK3-EINSy10a-E3Dv6full.h $SCRIPT_PATH/Firmware/Configuration_prusa.h || exit 8
  24. fi
  25. $BUILD_ENV_PATH/arduino $SCRIPT_PATH/Firmware/Firmware.ino --verify --board rambo:avr:rambo --pref build.path=$BUILD_PATH || exit 9
  26. export ARDUINO=$BUILD_ENV_PATH
  27. cd $SCRIPT_PATH/lang
  28. ./lang-build.sh || exit 10
  29. ./fw-build.sh || exit 11