mk 876 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/usr/bin/env sh
  2. # SPDX-License-Identifier: GPL-3.0-or-later
  3. # Copyright (c) 2020-2025 Leah Rowe <leah@libreboot.org>
  4. # Copyright (c) 2022 Caleb La Grange <thonkpeasant@protonmail.com>
  5. set -u -e
  6. if [ "./${0##*/}" != "${0}" ] || [ ! -f "mk" ] || [ -L "mk" ]; then
  7. printf "You must run this in the proper work directory.\n" 1>&2
  8. exit 1
  9. fi
  10. . "include/lib.sh"
  11. . "include/init.sh"
  12. . "include/vendor.sh"
  13. . "include/inject.sh"
  14. . "include/mrc.sh"
  15. . "include/rom.sh"
  16. . "include/release.sh"
  17. . "include/get.sh"
  18. main()
  19. {
  20. cmd="" && [ $# -gt 0 ] && cmd="$1" && shift 1
  21. case "$cmd" in
  22. version) printf "%s\nWebsite: %s\n" "$relname" "$projectsite" ;;
  23. release|download|inject) $cmd "$@" ;;
  24. -*) return 1 ;;
  25. *) err "bad command" ;;
  26. esac
  27. set -u -e # some commands disable them. turn them on!
  28. }
  29. main "$@" && exit 0
  30. . "include/tree.sh"
  31. trees "$@" || exit 0
  32. . "$mkhelpercfg"
  33. $cmd