config.sh 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #!/bin/sh
  2. #
  3. # config.sh - multi-language support configuration script
  4. # Definition of absolute paths etc.
  5. # This file is 'included' in all scripts.
  6. #
  7. # Arduino main folder:
  8. if [ -z "$ARDUINO" ]; then
  9. export ARDUINO=C:/arduino-1.8.5
  10. fi
  11. #
  12. # Arduino builder:
  13. export BUILDER=$ARDUINO/arduino-builder
  14. #
  15. # AVR gcc tools:
  16. export OBJCOPY=$ARDUINO/hardware/tools/avr/bin/avr-objcopy
  17. export OBJDUMP=$ARDUINO/hardware/tools/avr/bin/avr-objdump
  18. #
  19. # Output folder:
  20. export OUTDIR="../../Prusa-Firmware-build"
  21. #
  22. # Objects folder:
  23. export OBJDIR="$OUTDIR/sketch"
  24. #
  25. # Generated elf file:
  26. export INOELF="$OUTDIR/Firmware.ino.elf"
  27. #
  28. # Generated hex file:
  29. export INOHEX="$OUTDIR/Firmware.ino.hex"
  30. echo "config.sh started" >&2
  31. _err=0
  32. echo -n " Arduino main folder: " >&2
  33. if [ -e $ARDUINO ]; then echo 'OK' >&2; else echo 'NG!' >&2; _err=1; fi
  34. echo -n " Arduino builder: " >&2
  35. if [ -e $BUILDER ]; then echo 'OK' >&2; else echo 'NG!' >&2; _err=2; fi
  36. echo " AVR gcc tools:" >&2
  37. echo -n " objcopy " >&2
  38. if [ -e $OBJCOPY ]; then echo 'OK' >&2; else echo 'NG!' >&2; _err=3; fi
  39. echo -n " objdump " >&2
  40. if [ -e $OBJDUMP ]; then echo 'OK' >&2; else echo 'NG!' >&2; _err=4; fi
  41. echo -n " Output folder: " >&2
  42. if [ -e $OUTDIR ]; then echo 'OK' >&2; else echo 'NG!' >&2; _err=5; fi
  43. echo -n " Objects folder: " >&2
  44. if [ -e $OBJDIR ]; then echo 'OK' >&2; else echo 'NG!' >&2; _err=6; fi
  45. echo -n " Generated elf file: " >&2
  46. if [ -e $INOELF ]; then echo 'OK' >&2; else echo 'NG!' >&2; _err=7; fi
  47. echo -n " Generated hex file: " >&2
  48. if [ -e $INOHEX ]; then echo 'OK' >&2; else echo 'NG!' >&2; _err=8; fi
  49. if [ $_err -eq 0 ]; then
  50. echo "config.sh finished with success" >&2
  51. export CONFIG_OK=1
  52. else
  53. echo "config.sh finished with errors!" >&2
  54. export CONFIG_OK=0
  55. fi