summaryrefslogtreecommitdiffhomepage
path: root/misc/benchmarks/build_all.sh
diff options
context:
space:
mode:
Diffstat (limited to 'misc/benchmarks/build_all.sh')
-rw-r--r--misc/benchmarks/build_all.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/misc/benchmarks/build_all.sh b/misc/benchmarks/build_all.sh
new file mode 100644
index 00000000..54340998
--- /dev/null
+++ b/misc/benchmarks/build_all.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+cc='g++ -I../../include -s -O3 -Wall -pedantic -x c++ -std=c++20'
+#cc='clang++ -I../include -s -O3 -Wall -pedantic -x c++ -std=c++20'
+#cc='cl -nologo -I../include -O2 -TP -EHsc -std:c++20'
+run=0
+if [ "$1" == '-h' -o "$1" == '--help' ]; then
+ echo usage: runall.sh [-run] [compiler + options]
+ exit
+fi
+if [ "$1" == '-run' ]; then
+ run=1
+ shift
+fi
+if [ ! -z "$1" ] ; then
+ cc=$@
+fi
+if [ $run = 0 ] ; then
+ for i in *.cpp misc/*.c* picobench/*.cpp plotbench/*.cpp ; do
+ echo $cc -I../include $i -o $(basename -s .cpp $i).exe
+ $cc -I../include $i -o $(basename -s .cpp $i).exe
+ done
+else
+ for i in misc/*.c* picobench/*.cpp ; do
+ echo $cc -O3 -I../include $i
+ $cc -O3 -I../include $i
+ if [ -f $(basename -s .c $i).exe ]; then ./$(basename -s .c $i).exe; fi
+ if [ -f ./a.exe ]; then ./a.exe; fi
+ if [ -f ./a.out ]; then ./a.out; fi
+ done
+fi
+
+rm -f a.out *.o *.obj # *.exe