summaryrefslogtreecommitdiff
path: root/mk.sh
diff options
context:
space:
mode:
authorNathan Ringo <nathan@remexre.com>2024-11-16 12:38:37 -0600
committerNathan Ringo <nathan@remexre.com>2024-11-16 12:38:37 -0600
commit57331ba9756df043b5c665aa4952a0a7b38799e5 (patch)
tree0feb2ca5cbe38744088845b8bb105673016c1fac /mk.sh
Initial commit
Diffstat (limited to 'mk.sh')
-rwxr-xr-xmk.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/mk.sh b/mk.sh
new file mode 100755
index 0000000..1f749eb
--- /dev/null
+++ b/mk.sh
@@ -0,0 +1,21 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+repo=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd -P)
+srcdir="$repo/src"
+
+if [[ "$(pwd -P)" = "$repo" ]]; then
+ test ! -d build || rm -r build
+ mkdir build
+ cd build
+fi
+
+cat >config.mak <<EOF
+CONFIGURED = 1
+srcdir = $srcdir
+EOF
+ln -s "$srcdir/Makefile"
+
+n="$(nproc)"
+watchexec -w "$srcdir" -- \
+make "-j$n" "-l$n" "$@"