aboutsummaryrefslogtreecommitdiff
path: root/tools/run_tool.sh
diff options
context:
space:
mode:
Diffstat (limited to 'tools/run_tool.sh')
-rwxr-xr-xtools/run_tool.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/tools/run_tool.sh b/tools/run_tool.sh
new file mode 100755
index 0000000..21b6ce9
--- /dev/null
+++ b/tools/run_tool.sh
@@ -0,0 +1,27 @@
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 -std=c99 -pedantic -Wall -Wextra \
9 -Wno-unused-parameter -Wno-unused-function -O3 -D$CUBETYPE \
10 -D_POSIX_C_SOURCE=199309L"
11
12[ "$CUBETYPE" = "CUBE_AVX2" ] && CC="$CC -mavx2"
13
14BIN="tools/run"
15CUBEOBJ="cube.o"
16d="$(date +'%Y-%m-%d-%H-%M-%S')"
17
18for t in tools/*; do
19 if [ ! -d "$t" ] || [ -z "$(echo "$t" | grep "$TOOL")" ]; then
20 continue
21 fi
22 $CC -o $BIN $t/*.c $CUBEOBJ || exit 1;
23 $BIN
24 break
25done
26
27rm -rf $BIN $CUBEOBJ

Generated with cgit - Back to sebastiano.tronto.net