
pgm=logic

if ( [ "$1" = "rm" -o "$1" = "-rm" ] ) then
  echo "Removing files (if any) created during translation of $pgm ..."
  rm -f $pgm.C
  rm -f $pgm
  echo 'Done.'
  exit 0
  fi

  if ( [ "$1" = "" ] ) then
    echo ' '
    echo 'Oops -- command line parameter 1 is missing!'
    echo "The parameter selects version of $pgm to translate:"
    echo '  1 = essentially original simpack code, using sim++ cAPI'
    echo 'Try again.  This time specify a parameter as above.'
    echo ' '
    exit 1
    fi

  if ( [ "$1" = "0" ] ) then
    echo ' '
    echo '  Version 0 is not compilable.  It is the simpack version, and is'
    echo '  present only so you can compare it with version 1, to see what'
    echo '  had to be changed to run under sim++.'
    echo ' '
    echo 'Try again.  This time specify a parameter in range 1..1.'
    echo ' '
    exit 2
    fi

  if ( [ "$1" -lt 1  -o  "$1" -gt 1 ] ) then
    echo 'No unnerstan.'
    echo ' '
    echo 'Try again.  This time specify a parameter in range 1..1.'
    echo ' '
    exit 3
    fi

  cp -p $pgm$1 $pgm.C
  make
  rm -f $pgm.o


