Index: mttroot/mtt/bin/mtt ================================================================== --- mttroot/mtt/bin/mtt +++ mttroot/mtt/bin/mtt @@ -12,10 +12,13 @@ ############################################################### ## Version control history ############################################################### ## $Header$ ## $Log$ +## Revision 1.73 1997/05/09 09:18:45 peterg +## Put ./ in front of a.out (again) +## # Revision 1.72 1997/05/06 13:54:21 peterg # Changed gcc arguments for the ode simulation -- all files now included # in the _odes.c file # # Revision 1.71 1997/05/03 15:50:18 peterg @@ -266,10 +269,13 @@ #Computation mode is octave by default computation=octave #By default, the dae and ode representations are different dae_is_ode=0 + +# By default, don't look for BG switches +switches=0 #Look for a command line argument while [ -n "`echo $1 | grep '-'`" ]; do case $1 in -q ) @@ -276,12 +282,16 @@ quiet=quiet ;; -c ) computation=c ;; -o ) dae_is_ode=1 ;; + -s ) + switches=1 ;; -l ) level=$2; shift ;; + *) + echo "$1 is an invalid argument - ignoring" ;; esac shift done #Print header if not in quiet (-q) mode. @@ -361,17 +371,20 @@ # Clean up if [ "$1" = "clean" ] && [ "$2" = "" ]; then echo 'Removing all generated files for all systems' rm -f *.log mtt_info.txt warning.txt rm -f *_abg.m *_abg.ps *_args.* *_cr.r *_cr.txt - rm -f *_sabg.fig *_sabg.ps + rm -f *_sabg.fig *_sabg.ps *_head.fig *_bnd.fig rm -f *_sympar.r *_sympar.c *_sympar.h *_sympar.txt rm -f *_rbg.* *_cmp.* *_fig.fig *_*cbg.* *_ese.* *_def.* rm -f *_sub.sh *_type.sh - rm -f *_dae*.* *_cse.* *_ode*.c *_ode*.m *_obs.* *_rfe.* *_ss.* + rm -f *_dae*.* *_cse.* *_ode.* + rm -f *_obs.* *_rfe.* *_ss.* rm -f *_dm.* *_csm.* *_sm.* *_tf.* *_sr*.* *_ir*.* *_*fr.* rm -f *_numpar.m *_numpar.c + rm -f *_sm*.* + rm -f *_struc.* rm -f *_unique_raw_list *_raw_list rm -f mtt_error.txt mtt_info.txt a.out exit fi @@ -378,17 +391,19 @@ # Clean up named system if [ "$2" = "clean" ] && [ "$3" = "" ]; then echo 'Removing all generated files for system ' $1 rm -f *.log mtt_info.txt warning.txt rm -f $1_abg.m $1_abg.ps $1_args.* $1_cr.r $1_cr.txt - rm -f $1_sabg.fig $1_sabg.ps + rm -f $1_sabg.fig $1_sabg.ps $1_head.fig $1_bnd.fig rm -f $1_sympar.r $1_sympar.c $1_sympar.h $1_sympar.txt rm -f $1_rbg.* $1_cmp.* $1_fig.fig $1*_*cbg.* $1*_ese.* $1_def.* rm -f $1_sub.sh $1_type.sh - rm -f $1_dae*.* $1_cse.* $1_ode*.c $1_ode*.m $1_obs.* $1_rfe.* $1_ss.* + rm -f $1_dae*.* $1_cse.* $1_ode.* $1_obs.* $1_rfe.* $1_ss.* rm -f $1_dm.* $1_csm.* $1_sm.* $1_tf.* $1_sr*.* $1_ir*.* $1_*fr.* rm -f $1_numpar.m $1_numpar.c + rm -f $1_sm*.* + rm -f $1_struc.* rm -f $1_unique_raw_list $1_raw_list rm -f mtt_error.txt mtt_info.txt a.out exit fi @@ -576,10 +591,11 @@ $1_cr.r: $1_cr.txt cr_txt2r $1 #SUMMARY sympar symbolic parameters (txt) # Lbl to sympar conversion +ifeq ($switches,0) $1_sympar.txt: $1_sub.sh lbl2sympar_txt2txt $1 if [ "$level" = "0" ]; then \ mv $1_sympar.txt MTT_sympar.txt; \ @@ -591,10 +607,35 @@ sh $1_sub.sh "mtt -q -l $level+1 " ' sympar txt' # and recreate them if [ "$level" = "0" ]; then \ sort -u MTT_sympar.txt> $1_sympar.txt; \ fi +endif +ifeq ($switches,1) +$1_sympar.txt: $1_sub.sh $1_struc.txt + lbl2sympar_txt2txt $1 + + if [ "$level" = "0" ]; then \ + mv $1_sympar.txt MTT_sympar.txt; \ + else \ + cat $1_sympar.txt >> MTT_sympar.txt; \ + fi + + sh $1_sub.sh "rm -f " '_sympar.txt' # Delete sympar files + sh $1_sub.sh "mtt -q -l $level+1 " ' sympar txt' # and recreate them + + if [ "$level" = "0" ]; then \ + sort -u MTT_sympar.txt> $1_sympar.txt1; \ + struc2switch_txt $1; \ + echo "Appending switch declarations"; \ + cat $1_sympar.txt1 $1_switch.txt> $1_sympar.txt; \ + fi + +$1_switch.c: $1_sub.sh + struc2switch_txt2c $1 +endif + # ## Old version -- just looks on top level # ## $1_sympar.r: $1_lbl.txt $1_params.r # ## lbl2sympar_txt2r $1 # ## echo "IN \"$1_params.r\";" >> $1_sympar.r @@ -642,12 +683,20 @@ #SUMMARY input numerical input declaration (m) $1_input.m: $1_input.txt $1_sympar.txt input_txt2m $1 #SUMMARY input numerical input declaration (c) +ifeq ($switches,0) $1_input.c: $1_input.txt $1_sympar.c input_txt2c $1 +endif + +ifeq ($switches,1) +$1_input.c: $1_input.txt $1_sympar.c + input_txt2c -s $1 +endif + #SUMMARY odes ODE simulation header file (h) $1_odes.h: echo Creating $1_odes.h