Remove building with NOCRYPTO option
[minix3.git] / minix / commands / worldstone / worldstone.sh
blob0868219fec4415f11c90f7d14eee6e69980e3e0e
2 if [ ! "$MAKE" ]; then MAKE=make; fi
3 ITERATIONS=5
4 PRECMD="$MAKE clean"
5 COMMAND="$MAKE all"
6 TAG=time.$(basename $(git --git-dir=/usr/src/.git describe --all --dirty))
8 set -e
10 while getopts "n:d:p:c:r:s" c
12 case "$c" in
13 s) PROFILE=1 ;;
14 n) ITERATIONS=$OPTARG ;;
15 p) PRECMD="$OPTARG" ;;
16 c) COMMAND="$OPTARG" ;;
17 t) TAG=$OPTARG ;;
18 r) echo "Reading settings from $OPTARG"; cat $OPTARG; . $OPTARG ; echo "Reading done.";;
19 *) exit 1 ;;
20 esac
21 done
23 CONFIGPREFIX=".worldstone"
24 CONFIGVARS="ITERATIONS PRECMD COMMAND MAKE"
25 TMPF=.worldstone.tmpconfig.$$
26 rm -f $TMPF
27 for d in $CONFIGVARS
28 do eval "echo $d=\\\"\$$d\\\"" >>$TMPF
29 done
30 CONFIGTAG=`crc <$TMPF | awk '{ print $1 }'`
31 CONFIGFILE=$CONFIGPREFIX.$CONFIGTAG
32 mv -f $TMPF $CONFIGFILE
34 LOGFILE=$TAG.worldstone.log
36 while [ -f $LOGFILE ]
37 do echo "$0: WARNING: $LOGFILE already exists, appending."
38 LOGFILE=$LOGFILE.next
39 done
41 echo "Logging to $LOGFILE."
43 echo "First run."
44 sh -c "$PRECMD"
45 sh -c "$COMMAND"
47 if [ "$PROFILE" ]; then profile stop || true; fi
49 for n in `seq 1 $ITERATIONS`
50 do echo -n "$n"
51 sh -c "$PRECMD >/dev/null 2>&1"
52 echo -n "."
53 sync
54 PROF=$LOGFILE.p.$n
55 if [ "$PROFILE" ]; then profile start --rtc -o $PROF -f 3; fi
56 time -C sh -c "$COMMAND >/dev/null 2>&1; sync" 2>>$LOGFILE
57 if [ "$PROFILE" ]; then profile stop; sprofalyze -d $PROF >$PROF.d; fi
58 echo -n " "
59 done
60 echo "Done."
61 echo "Time measurements logfile is $LOGFILE."
62 echo "Config file is $CONFIGFILE."