summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
Diffstat (limited to 'mk')
-rwxr-xr-xmk71
1 files changed, 71 insertions, 0 deletions
diff --git a/mk b/mk
new file mode 100755
index 00000000..53de360c
--- /dev/null
+++ b/mk
@@ -0,0 +1,71 @@
+#!/usr/bin/env sh
+
+# SPDX-License-Identifier: GPL-3.0-or-later
+
+# Copyright (c) 2020-2025 Leah Rowe <leah@libreboot.org>
+# Copyright (c) 2022 Caleb La Grange <thonkpeasant@protonmail.com>
+
+set -u -e
+
+ispwd="true"
+
+if [ "$0" != "./mk" ]; then
+ ispwd="false"
+fi
+if [ "$ispwd" = "true" ] && [ -L "mk" ]; then
+ ispwd="false"
+fi
+if [ "$ispwd" = "false" ]; then
+ printf "You must run this in the proper work directory.\n" 1>&2
+ exit 1
+fi
+
+. "include/lib.sh"
+. "include/init.sh"
+. "include/vendor.sh"
+. "include/mrc.sh"
+. "include/inject.sh"
+. "include/rom.sh"
+. "include/release.sh"
+. "include/get.sh"
+
+main()
+{
+ cmd=""
+ if [ $# -gt 0 ]; then
+ cmd="$1"
+
+ shift 1
+ fi
+
+ case "$cmd" in
+ version)
+ printf "%s\nWebsite: %s\n" "$relname" "$projectsite"
+ ;;
+ release|download|inject)
+ $cmd "$@"
+ ;;
+ -*)
+ return 0
+ ;;
+ *)
+ err "bad command" main "$@"
+ ;;
+ esac
+
+ # some commands disable them. turn them back on!
+ set -u -e
+
+ return 1
+}
+
+main "$@" || exit 0
+
+. "include/tree.sh"
+
+trees "$@" || exit 0
+
+x_ touch "$mkhelpercfg"
+
+. "$mkhelpercfg"
+$cmd