#! /bin/sh # provide 'runme' script for cat / csi / ttt2 umask 022 DIR=build/$1 if [ -z "$1" ]; then echo "usage: $0 (cat|csi|ttt2)" exit fi if [ ! -d "$DIR" ]; then echo "$DIR/ does not exist." exit 1 fi cp ttt2 $DIR/$1 case "$1" in cat) cp comp.conf $DIR CMD='$DIR/'$1' -cp PC -C "" -s COMPLEXITY -c $DIR/comp.conf "$@"' ;; csi) cp cr.conf $DIR CMD='$DIR/'$1' -s AUTO -c $DIR/cr.conf -C CR "$@"' CMD_CERT='$DIR/'$1' -s CERT -c $DIR/cr.conf -cpf -C CR "$@"' ;; ttt2) cp comp.conf $DIR CMD='$DIR/'$1' -s COMP -c $DIR/comp.conf "$@"' ;; *) echo unrecognized tool $1 exit 1 ;; esac #$1 filename #$2 command function write { cat > $DIR/$1 < [timeout]" elif [ -e "\$DIR/$1" ]; then exec $2 elif [ -e Makefile ]; then echo "Type 'make help' to get compilation instructions." else echo "Could not find \$DIR/$1 and this does not look like a source archive." echo "Giving up." fi EOF chmod +x $DIR/$1 } write "starexec_run_$1" "$CMD" write "starexec_run_$1_cert" "$CMD_CERT"