summaryrefslogtreecommitdiffhomepage
path: root/benchmarks/build_all.sh
blob: 348a79dd643483410b777a43894879e71f7dca16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
cc='g++ -std=c++17'
#cc='clang'
#cc='clang -c -DSTC_HEADER'
#cc='cl -nologo'
#cc='cl -nologo -TP'
#cc='cl -nologo -std:c11'
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 misc/*.c* picobench/*.cpp plotbench/*.cpp ; do
        echo $cc -I../include $i
        $cc -I../include $i
    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