makerelease.sh 762 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/sh
  2. srcdir="$(dirname "$0")"
  3. [ "$(echo "$srcdir" | cut -c1)" = '/' ] || srcdir="$PWD/$srcdir"
  4. die() { echo "$*"; exit 1; }
  5. # Import the makerelease.lib
  6. for path in $(echo "$PATH" | tr ':' ' '); do
  7. [ -f "$MAKERELEASE_LIB" ] && break
  8. MAKERELEASE_LIB="$path/makerelease.lib"
  9. done
  10. [ -f "$MAKERELEASE_LIB" ] && . "$MAKERELEASE_LIB" || die "makerelease.lib not found."
  11. hook_get_version()
  12. {
  13. local file="$1/firmware/cpu-firmware/main.h"
  14. local major="$(cat "$file" | grep -e 'VERSION_MAJOR' | head -n1 | cut -f2)"
  15. local minor="$(cat "$file" | grep -e 'VERSION_MINOR' | head -n1 | cut -f2)"
  16. version="$major.$minor"
  17. }
  18. hook_testbuild()
  19. {
  20. cd "$1/firmware/cpu-firmware" && make
  21. cd "$1/firmware/coproc-firmware" && make
  22. }
  23. project=cnc-control
  24. makerelease $@