Deobfuscate and correct documentation
[dormin.git] / tbs
blob528becbe830ff18eac08964d7cae43d415c54965
1 #!/bin/sh
3 #set -x
4 set -e
6 h=$(readlink -f $(dirname $0))
7 r=$(readlink -f $h/../..)
8 t=$r/tbs
9 d=MD5
11 export OCAMLRUNPARAM=b
13 if test $h = $PWD; then
14 mkdir -p build
15 cd build
18 if ! md5sum --status -c $d; then
19 md5sum $h/build.ml $h/tbs $t/tbs.cma >$d.tmp
20 ocamlc.opt -o build.cmo -c -g -I $t $h/build.ml
21 ocamlc.opt -g -thread -I $t unix.cma threads.cma tbs.cma build.cmo -o b
22 mv $d.tmp $d
25 altivec=true
27 case $(hostname) in
28 laptop)
29 cc="gcc-4.3.0"
30 ccopt="-Wall -Werror -Wextra -Wno-unused-function"
31 ccopt="$ccopt -O3 -march=athlon64 -mtune=athlon64 -fprefetch-loop-arrays"
32 ccopt="$ccopt -DTIMING"
35 linmac)
36 cc="$HOME/x/dev/gcc-4.3.0/bin/gcc";
37 ccopt="-Wall -Werror -Wextra -O3 -Wno-unused-function";
38 ccopt="$ccopt -DTIMING"
39 if $altivec; then
40 ccopt="$ccopt -fprefetch-loop-arrays -mtune=power6 -mcpu=G4"
41 ccopt="$ccopt -DG4 -DUSE_ALTIVEC"
42 ccopt="$ccopt --param l1-cache-line-size=32"
43 else
44 ccopt="$ccopt -fprefetch-loop-arrays -mtune=power6 -mcpu=G4 -funroll-all-loops"
45 ccopt="$ccopt -ftree-loop-linear -ftree-vectorize"
49 ps3)
50 cc="gcc-4.3.1 -m32";
51 ccopt="-Wall -Werror -Wextra -O3 -Wno-unused-function";
52 ccopt="$ccopt -fprefetch-loop-arrays -mtune=power6 -mcpu=cell"
53 ccopt="$ccopt --param l1-cache-line-size=128"
54 ccopt="$ccopt -DTIMING"
55 if $altivec; then
56 ccopt="$ccopt -DUSE_ALTIVEC"
57 else
58 ccopt="$ccopt -ftree-loop-linear -ftree-vectorize"
63 cc=cc
64 ccopt=-O2
66 esac
68 targets="dormin"
69 ./b -O src:$h -r -O ccopt:"$ccopt" -O cc:"$cc" $* $targets