#!/bin/sh
#
# Constants that must be adjusted
#
SRC_DIR=Src
#
#######################################################################
if test -f .lastinstall
  then
     y=`cat .lastinstall`
     case $y in
         1|3|4)
           SUFFIX=c;;
         2)
           SUFFIX=C;;
         *)
           echo "Unknown compiler used for installation."
           exit 1;;
     esac
  else
     echo "make install must be executed first."
     exit 1
fi

#######################################################################
echo "Choose a main program from the following list."
echo
cat Drivers/EXAMPLES
echo
echo "Make your choice. \c"
read a
case $a in
    0)
      echo "Give the name of your example file."
      echo "(Full pathname from current position.)"
      read a
      cp $a $SRC_DIR/main.$SUFFIX ;;
   [1-9]|1[0-8])
      cp Drivers/vb${a}.c $SRC_DIR/main.$SUFFIX ;;
    *)
      echo "That was an illegal choice!"
      exit 1 ;;
esac
#######################################################################
#
echo
echo "Compilation will now start."
echo
cd $SRC_DIR
make tst
