summaryrefslogtreecommitdiff
path: root/compile_ai.sh
diff options
context:
space:
mode:
Diffstat (limited to 'compile_ai.sh')
-rwxr-xr-xcompile_ai.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/compile_ai.sh b/compile_ai.sh
new file mode 100755
index 0000000..a24cd3f
--- /dev/null
+++ b/compile_ai.sh
@@ -0,0 +1,16 @@
+#!/usr/bin/env bash
+set -eo pipefail
+
+cd "$(dirname "$0")"
+
+if [[ -f main ]]; then
+ have_main=1
+ mv main .compile_ai_main_bak
+fi
+
+make AI="$1" -W main.cpp
+mv main "$1"
+
+if [[ $have_main -eq 1 ]]; then
+ mv .compile_ai_main_bak main
+fi