Index: mttroot/mtt/bin/mtt ================================================================== --- mttroot/mtt/bin/mtt +++ mttroot/mtt/bin/mtt @@ -12,10 +12,13 @@ ############################################################### ## Version control history ############################################################### ## $Header$ ## $Log$ +## Revision 1.161 1998/07/08 11:21:32 peterg +## Added -I switch +## ## Revision 1.160 1998/07/04 11:38:51 peterg ## Version 3.0-- (Seascale) ## ## Revision 1.159 1998/07/04 11:37:43 peterg ## Aliases implemented for parameters + lots of associated goodies @@ -980,13 +983,11 @@ REPTYPE='bg' ;; sabg ) REPTYPE='bg' ;; cbg ) REPTYPE='bg' ;; - lbl ) - REPTYPE='txt' ;; - input ) + input ) REPTYPE='txt' ;; numpar ) REPTYPE='txt' ;; state ) REPTYPE='txt' ;; @@ -1060,10 +1061,17 @@ else Directory=$directory/MTT_work fi mtt -u -q $mtt_switches -S "$Directory" $1 $2 $3 $4 + mtt_status=$? + + # Exit on failure + if [ "mtt_status" != "0" ]; then + echo Exiting mtt with status $mtt_status + exit 1 + fi if [ "$3" != "view" ]; then if [ "$3" != "hview" ]; then echo Copying $1_$2.$3 cp -u -p $1_$2.$3 .. @@ -1090,11 +1098,11 @@ ################################ # This is the main mtt programme ################################ -$MAKE $verbose -f - $1_$2.$3 << EOF +$MAKE -S $verbose -f - $1_$2.$3 << EOF # Cancel implicit rules I don't want %.dvi: %.tex # If level>0, try and get subsystem files @@ -1106,14 +1114,17 @@ # Create an arg file if it doesn't exist $1_args.m: touch $1_args.m -#Create empty files (with titles) if not already there +#Create skeleton files (with titles) if not already there #SUMMARY lbl label file (txt) $1_lbl.txt: abg2lbl_fig2txt $1 + +$1_lbl.tex: $1_lbl.txt + lbl_txt2tex $1 #SUMMARY alias name aliases for each subsystem (txt) $1_alias.txt: $1_lbl.txt lbl2alias_txt2txt $1 @@ -1995,10 +2006,12 @@ echo Copying nrutil.h; cp $MTTPATH/trans/c/nrutil.h . sign.c: echo Copying sign.c; cp $MTTPATH/trans/c/sign.c . EOF +# Remember the exit status of make +make_status=$? # Tidy up. # echo Removing log files and other garbage rm -f *_unique_raw_list *_raw_list rm -f mtt_error.txt mtt_info.txt a.out @@ -2012,5 +2025,8 @@ echo Debugging - log files retained in LOGFILES mkdir -p LOGFILES mv -f *.log LOGFILES fi +if [ "$make_status" != "0" ]; then + exit 2 +fi