#!/bin/sh

# usage:    rabbit8.sh processor_type processor_mhz [test cases]
# example:  rabbit8.sh athlon 800
#           rabbit8.sh pentium-II 450

p=$1
shift
m=$1
shift

if [ "X$*" = "X" ]
then
  A="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20"
else
  A=$*
fi

rm z8
touch z8

for i in 1 2 3 4 5 6
do
  make PROC=$p MHZ=$m READ=$i Clean module rabbit
  # wait for root to install from another window
  echo "root should now 'make install unload load', enter when ready"
  read junk
  for t in $A
  do
    cc -DTESTNUMBER=$t -O `pmc_options` -o rabbit8 rabbit8.c -lm -lpmc
    { pmc_options
      echo  " "
      rabbit8 1000 2>&1
      rabbit8 10000 2>&1
      rabbit8 100000 2>&1
    } >> z8
  done
done


echo > rabbit8.ss

for t in $A
do
  cc -DTESTNUMBER=$t -O `pmc_options` -S rabbit8.c
  echo test number $t >> rabbit8.ss
  cat rabbit8.s >> rabbit8.ss
  rm rabbit8.s
done
