aboutsummaryrefslogtreecommitdiff
path: root/tools/tool.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/tool.sh')
-rwxr-xr-xtools/tool.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/tools/tool.sh b/tools/tool.sh
new file mode 100755
index 0000000..64bfd89
--- /dev/null
+++ b/tools/tool.sh
@@ -0,0 +1,22 @@
1#!/bin/sh
2
3if [ -z "$TOOL" ]; then
4 echo "No tool selected (TOOL variable must be set)"
5 exit 1
6fi
7
8CC="$CC -D_POSIX_C_SOURCE=199309L" # For timer
9
10BIN="tools/run"
11d="$(date +'%Y-%m-%d-%H-%M-%S')"
12
13for t in tools/*; do
14 if [ ! -d "$t" ] || ! (echo "$t" | grep -q "$TOOL"); then
15 continue
16 fi
17 toolname="$(basename "$t" .c)"
18 $CC -o $BIN "$t"/*.c "$OBJ" || exit 1;
19 $BIN $TOOLARGS \
20 | tee "tools/results/$toolname-$d.txt" "tools/results/last.out"
21 break
22done

Generated with cgit - Back to sebastiano.tronto.net