config.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. export ARDUINO=C:/arduino-1.8.5
  9. #
  10. # Arduino builder:
  11. export BUILDER=$ARDUINO/arduino_debug.exe
  12. #
  13. # AVR gcc tools:
  14. export OBJCOPY=$ARDUINO/hardware/tools/avr/bin/avr-objcopy.exe
  15. export OBJDUMP=$ARDUINO/hardware/tools/avr/bin/avr-objdump.exe
  16. #
  17. # Output folder:
  18. export OUTDIR="../../output"
  19. #
  20. # Objects folder:
  21. export OBJDIR="$OUTDIR/sketch"
  22. #
  23. # Generated elf file:
  24. export INOELF="$OUTDIR/Firmware.ino.elf"
  25. #
  26. # Generated hex file:
  27. export INOHEX="$OUTDIR/Firmware.ino.hex"
  28. echo "config.sh started" >&2
  29. _err=0
  30. echo -n " Arduino main folder: " >&2
  31. if [ -e $ARDUINO ]; then echo 'OK' >&2; else echo 'NG!' >&2; _err=1; fi
  32. echo -n " Arduino builder: " >&2
  33. if [ -e $BUILDER ]; then echo 'OK' >&2; else echo 'NG!' >&2; _err=2; fi
  34. echo " AVR gcc tools:" >&2
  35. echo -n " objcopy " >&2
  36. if [ -e $OBJCOPY ]; then echo 'OK' >&2; else echo 'NG!' >&2; _err=3; fi
  37. echo -n " objdump " >&2
  38. if [ -e $OBJDUMP ]; then echo 'OK' >&2; else echo 'NG!' >&2; _err=4; fi
  39. echo -n " Output folder: " >&2
  40. if [ -e $OUTDIR ]; then echo 'OK' >&2; else echo 'NG!' >&2; _err=5; fi
  41. echo -n " Objects folder: " >&2
  42. if [ -e $OBJDIR ]; then echo 'OK' >&2; else echo 'NG!' >&2; _err=6; fi
  43. echo -n " Generated elf file: " >&2
  44. if [ -e $INOELF ]; then echo 'OK' >&2; else echo 'NG!' >&2; _err=7; fi
  45. echo -n " Generated hex file: " >&2
  46. if [ -e $INOHEX ]; then echo 'OK' >&2; else echo 'NG!' >&2; _err=8; fi
  47. if [ $_err -eq 0 ]; then
  48. echo "config.sh finished with success" >&2
  49. export CONFIG_OK=1
  50. else
  51. echo "config.sh finished with errors!" >&2
  52. export CONFIG_OK=0
  53. fi