Added -t flag to keep temporaries around

This commit is contained in:
ceriel 1990-12-17 14:22:09 +00:00
parent 4e4d3290d4
commit ab62dda2fc
2 changed files with 19 additions and 5 deletions

View file

@ -7,7 +7,7 @@ SHARE=../share
LDFLAGS=-i LDFLAGS=-i
CPPFLAGS=-DVERBOSE -DNOTCOMPACT CPPFLAGS=-DVERBOSE -DNOTCOMPACT
CFLAGS=$(CPPFLAGS) -O CFLAGS=$(CPPFLAGS) -O
LINTFLAGS=-hbac LINTFLAGS=-hbu
all: all:

View file

@ -5,6 +5,7 @@ PHASES=''
FLAGS='' FLAGS=''
LEVEL=xxx LEVEL=xxx
EM=$1 EM=$1
KEEPTEMPS=no
shift shift
@ -28,6 +29,7 @@ do
-BO) PHASES="$PHASES bo " ; continue;; -BO) PHASES="$PHASES bo " ; continue;;
-CJ) PHASES="$PHASES cj " ; continue;; -CJ) PHASES="$PHASES cj " ; continue;;
-O*) LEVEL=$A ; continue;; -O*) LEVEL=$A ; continue;;
-t) KEEPTEMPS=yes ; continue;;
-*) FLAGS="$FLAGS $A"; continue;; -*) FLAGS="$FLAGS $A"; continue;;
esac esac
done done
@ -54,7 +56,10 @@ for i in $PASSES
do INFILES=$OUTFILES do INFILES=$OUTFILES
OUTFILES="$TMP.p.$c.$$ $TMP.d.$c.$$ $TMP.l.$c.$$ $TMP.b.$c.$$" OUTFILES="$TMP.p.$c.$$ $TMP.d.$c.$$ $TMP.l.$c.$$ $TMP.b.$c.$$"
FILES="$FILES $OUTFILES" FILES="$FILES $OUTFILES"
trap "rm -f $FILES; exit 1" 0 1 2 15 if [ $KEEPTEMPS = no ]
then
trap "rm -f $FILES; exit 1" 0 1 2 15
fi
case $i in case $i in
ic) $OPT/ic $INFILES - - $OUTFILES $ICARG || exit 1 ic) $OPT/ic $INFILES - - $OUTFILES $ICARG || exit 1
;; ;;
@ -64,14 +69,23 @@ do INFILES=$OUTFILES
$OPT/ca $INFILES $PDUMP $DDUMP - - | $EM/lib/em_opt2 > $TMPOPT || exit 1 $OPT/ca $INFILES $PDUMP $DDUMP - - | $EM/lib/em_opt2 > $TMPOPT || exit 1
ICARG=$TMPOPT ICARG=$TMPOPT
OUTFILES="$PDUMP $DDUMP" OUTFILES="$PDUMP $DDUMP"
rm -f $INFILES $PDUMP $DDUMP if [ $KEEPTEMPS = no ]
then
rm -f $INFILES $PDUMP $DDUMP
fi
;; ;;
*) $OPT/$i $INFILES $OUTFILES $FLAGS || exit 1 *) $OPT/$i $INFILES $OUTFILES $FLAGS || exit 1
rm -f $INFILES if [ $KEEPTEMPS = no ]
then
rm -f $INFILES
fi
;; ;;
esac esac
c=`expr $c + 1` c=`expr $c + 1`
done done
rm -f $FILES if [ $KEEPTEMPS = no ]
then
rm -f $FILES
fi
trap 0 trap 0
exit 0 exit 0