summaryrefslogtreecommitdiffhomepage
path: root/misc/benchmarks/build_all.sh
blob: d055bd2e3bd4fc497768f49a5dab84f132dc1218 (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
#!/bin/bash
cc='g++ -I../../include -s -O3 -Wall -pedantic -x c++ -std=c++2a'
#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 various/*.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 various/*.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