1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/bin/bash
  2. . mkit/include/build.sh || die "cannot import ini.sh"
  3. . mkit/include/deploy.sh || die "cannot import ini.sh"
  4. . mkit/include/ini.sh || die "cannot import ini.sh"
  5. MKIT_INI=${MKIT_INI:-mkit/config.ini}
  6. MKIT_INI_EXPAND=2
  7. MKIT_PROJNAME=$(ini 1value "ENV:PROJNAME")
  8. configure() {
  9. #
  10. # Load variables fdom config.mk
  11. #
  12. tmp=$(mktemp)
  13. sed -e 's/ = /=/' < config.mk > $tmp
  14. . $tmp
  15. rm -f $tmp
  16. PREFIX="$(readlink -f "$PREFIX")"
  17. }
  18. die() {
  19. #
  20. # Exit with message and non-zero exit status
  21. #
  22. echo "$@" >&2
  23. exit 4
  24. }
  25. route() {
  26. #
  27. # Call correct function based on $1
  28. #
  29. case $1 in
  30. build|build_manpages|clean|dist|install|uninstall)
  31. $1
  32. ;;
  33. *)
  34. echo "usage: $(basename $0) build|clean|dist|install|uninstall" >&2
  35. esac
  36. }