X-Git-Url: http://gitweb.hachti.de/?a=blobdiff_plain;f=bin%2Ffrtn;h=31195a86fa1ce3f45aca2eb10db739fbe243e930;hb=7ced2dbeb1a104912fbdd041ce18b0e29a72d893;hp=c1d14b72159973a849890afce298797167931c3e;hpb=c08e22bbb226696a64764be9b466a02a3ab0d93f;p=h316.git diff --git a/bin/frtn b/bin/frtn index c1d14b7..31195a8 100755 --- a/bin/frtn +++ b/bin/frtn @@ -1,49 +1,94 @@ -#!/bin/bash +#!/bin/sh # FORTRAN IV compiler wrapper for simh h316 +if [ "$FRTN_ORIGINAL" ]; then + LOGNAME="FORTRAN IV COMPILER (Original):" +else + LOGNAME="FORTRAN IV COMPILER:" +fi + if [ ! $1 ] ; then - echo "Argument fehlt!" + echo "$LOGNAME Input file missing!" exit 2 fi name=`basename $1 .f` +if [ ! -f "$1" ]; then + echo "$LOGNAME Input file \"$name\" not found!" + exit 2 +fi + + listfile=$name.lst cat $1 | tab | paron > $name.par rm -f $name.lst rm -f $name.obj -echo "rest $H316/sys/frtn.sys" > $name.go +echo -n "$LOGNAME Compiling \"$1\":" -echo "r" >> $name.go +if [ "$FRTN_ORIGINAL" ]; then -echo "at ptr $name.par" >> $name.go -echo "at ptp $name.obj" >> $name.go -echo "at tty3 $listfile" >> $name.go -echo "set tty3 uascii" >> $name.go -echo "set tty3 start" >> $name.go +cat > $name.go <> $name.go -echo "d p 1000" >> $name.go -echo "go" >> $name.go -echo "quit" >> $name.go -h316 $name.go > /dev/null +else + +cat > $name.go < /dev/null if cat $name.lst | egrep "[*]{36,40}">/dev/null 2>&1; then cat $name.lst - echo -e "\n\nFORTRAN IV compilation FAILED!" + echo -e " FAILED!" rm -f $name.obj exit 77 fi if [ ! $2 ]; then rm $name.lst + rm -f $name.go + rm -f $name.par + fi -echo "FORTRAN IV compilation successfull." +echo " Success." exit 0