Index: mttroot/mtt/bin/mtt ================================================================== --- mttroot/mtt/bin/mtt +++ mttroot/mtt/bin/mtt @@ -13,10 +13,13 @@ ############################################################### ## Version control history ############################################################### ## $Header$ ## $Log$ +## Revision 1.285 2000/11/27 11:51:21 peterg +## Fixed a few pdf /fig bugs +## ## Revision 1.284 2000/11/27 10:33:35 peterg ## -pdf option now coerces ps-->pdf ## ## Revision 1.283 2000/11/24 15:11:50 peterg ## -pdf switch for simple displays @@ -1070,11 +1073,13 @@ tidy=tidy ;; -T ) tidy=tidy; verytidy=verytidy ;; -u ) - tidy=untidy ;; + tidy=untidy ; + mtt_switches="$mtt_switches $1"; + ;; -l ) mtt_switches="$mtt_switches $1 $2"; level=$2; shift ;; -A ) mtt_switches="$mtt_switches $1"; @@ -1605,12 +1610,10 @@ ## Make ps pdf if -pdf set if [ "$lang" == "ps" ]; then lang=$ps fi -## Create the make target name -target=$1_$2.$lang # Create some strings Subsystem=$1$subsystem; Subsystem_=$Subsystem"_" @@ -1620,13 +1623,17 @@ Subsystem_dae=$Subsystem"_dae" Subsystem_subs=$Subsystem"_subs" Subsystem_cr=$Subsystem"_cr" Subsystem_cbg=$Subsystem"_cbg" +## Create the make target name +target=${sys}_${rep}.${lang} + +## Arguments +ARGS=$4; _ARGS=-$4; __ARGS=`echo $_ARGS | tr ',' '-'` + # Save up the argument list in a file; but only if argument has changed -#ARGS=$4; _ARGS=-$4; __ARGS=`echo $_ARGS | tr ',' '-'` - #DIFF doesn't like empty files - so put a blank if empty #if [ -z "$ARGS" ]; then # ARGS=' '; # _ARGS=''; #fi @@ -1680,16 +1687,17 @@ if [ "$3" != "view" ] && [ "$3" != "hview" ] && [ -z "$reset" ]; then if [ "$3" = "html" ]; then echo Moving $1_$2 mv $1_$2 .. else + if [ "$PLOTTYPE" = "multiple" ]; then + echo Copying $1_$2$__ARGS.$ps + cp $1_$2$__ARGS.$ps .. + else echo Copying $1$subsystem"_"$2.$lang cp -p -u $1$subsystem"_"$2.$lang .. - fi - if [ "$PLOTTYPE" = "multiple" ]; then - echo Copying $1_$2$__ARGS.$ps - cp $1_$2$__ARGS.$ps .. + fi fi fi # Remove the MTT_work directory if very tidy if [ "$verytidy" = "verytidy" ]; then @@ -1767,21 +1775,21 @@ ################################ # This is the main mtt programme ################################ -## echo Target is $target, Subsystem is $Subsystem, switches are $mtt_switches +##echo Target is $target, Subsystem is $Subsystem, options are $mtt_switches $MAKE -S $verbose -f - $target << EOF # Cancel implicit rules I don't want %.dvi: %.tex # MTT implicit rules ## .oct files ifneq ($2,ode2odes) %.oct: %.cc $1_def.h $1_sympar.h - echo Creating $1_$2.oct; mkoctfile $< + echo Creating $1_$2.oct; $MKOCTFILE $< endif ## .cc files ifneq ($2,ode2odes) %.cc: %.m @@ -2243,12 +2251,13 @@ #SUMMARY def definitions - system orders etc. (h) #SUMMARY struc* structure - list of inputs, outputs and states (txt) #SUMMARY struc structure - list of inputs, outputs and states (tex) #SUMMARY struc* structure - list of inputs, outputs and states (view) #Elementary system equations + definitions -$Subsystem_ese.r: $1_cbg.m +${sys}_ese.r: $1_cbg.m cbg2ese_m2r $partition $info_switch $Subsystem; #ese_tidy $1 + $1_def.r: $1_ese.r touch $1_def.r $1_struc.txt: $1_ese.r touch $1_struc.txt $1_aliased.txt: $1_ese.r @@ -2267,22 +2276,28 @@ #SUMMARY dae* differential-algebraic equations (m) #SUMMARY dae differential-algebraic equations (tex) #SUMMARY dae* differential-algebraic equations (view) #SUMMARY dae differential-algebraic equations (ps) #Differential-algebraic equations -$Subsystem_rdae.r: $Subsystem_ese.r $Subsystem_def.r - ese2rdae_r $partition $Subsystem; tidy $1_rdae.r -$1_dae.r: $Subsystem_rdae.r $Subsystem_def.r $Subsystem_subs.r $Subsystem_cr.r + +${sys}_rdae.r: ${sys}_ese.r ${sys}_def.r +ifneq ($partition,) + echo Doing subsystems + mtt_make_subsystems ${sys} rdae r +endif + ese2rdae_r ${Subsystem}; tidy ${Subsystem}_rdae.r + +${sys}_dae.r: ${Subsystem}_rdae.r ${Subsystem}_def.r ${Subsystem}_subs.r ${Subsystem}_cr.r ifneq ($partition,) echo Doing subsystems - mtt_make_subsystems $1 dae r + mtt_make_subsystems ${sys} dae r endif ifeq ($rdae_is_dae,1) echo Copying $1_rdae.r to $1_dae.r cp $1_rdae.r $1_dae.r else - rdae2dae_r $partition $Subsystem; tidy $Subsystem_dae.r + rdae2dae_r ${Subsystem}; tidy ${Subsystem}_dae.r endif $1_dae.m: $1_def.r $1_dae.r $1_sympars.txt dae_r2m $1; matlab_tidy $1_dae.m; matlab_tidy $1_daeo.m $1_dae.c: $1_def.r $1_dae.r $1_sympar.r @@ -2295,21 +2310,30 @@ #SUMMARY cse* constrained-state equations (oct) #SUMMARY cse constrained-state equations (tex) #SUMMARY cse* constrained-state equations (view) #SUMMARY cse constrained-state equations (ps) #Constrained-state equations -$1_cse.r: $1_dae.r $1_def.r $1_sympar.r $1_subs.r - dae2cse_r $Solve $1; tidy $1_cse.r $1_subs.r +${sys}_cse.r: ${Subsystem}_dae.r ${Subsystem}_dae.r ${Subsystem}_def.r ${Subsystem}_subs.r +ifneq ($partition,) + echo Doing subsystems + mtt_make_subsystems ${sys} cse r +endif + dae2cse_r $Solve ${Subsystem}; tidy ${Subsystem}_cse.r #$1_subs.r $1_csex.r: $1_cse.r touch $1_csex.r $1_cseo.r: $1_cse.r touch $1_cseo.r #$1_cse.m: $1_def.r $1_cse.r $1_sympar.r $1_subs.r # cse_r2m $1; matlab_tidy $1_cse.m -$1_cse.m: $1_def.r $1_cse.r $1_sympars.txt - mtt_r2m $optimise -parameters $1 cse;# matlab_tidy $1_cse.m; matlab_tidy $1_cseo.m; +${sys}_cse.m: ${Subsystem}_def.r ${Subsystem}_cse.r ${Subsystem}_sympar.txt +ifneq ($partition,) + echo Doing subsystems + ## mtt_cp_subrep ${sys} sympar txt + mtt_make_subsystems ${sys} cse m +endif + mtt_r2m -parameters ${Subsystem} cse;# matlab_tidy $1_cse.m; matlab_tidy $1_cseo.m; $1_csex.m: $1_def.r $1_csex.r $1_sympars.txt mtt_r2m $1 csex $1_cseo.m: $1_def.r $1_cseo.r $1_sympars.txt mtt_r2m $optimise -parameters $1 cseo;# matlab_tidy $1_cse.m; matlab_tidy $1_cseo.m; $1_cse.tex: $1_cse.r $1_sympar.r $1_simp.r @@ -2892,21 +2916,34 @@ echo Creating $1_odess.dat dat22dat $1 odes s #Generic conversion of data files from dat to (gplot) gdat format $1_$2.gdat: $1_$2.dat $1_struc.txt $1_args.m - dat2gdat $1 $2 "$4" "$NyquistStyle" + dat2gdat $1 $2 "$ARGS" "$NyquistStyle" - +## Conversion of gdat to fig files ifeq ($REPTYPE,data) -## Conversion of gdat to fig files $1_$2.fig: $1_$2.gdat - gdat2fig $1_$2 "$ARGS" + gdat2fig $1_$2 + +ifneq ($ARGS,) ## Multiple plots + echo Creating $1_$2$__ARGS.fig + mv $1_$2.fig $1_$2$__ARGS.fig + rm -f $1_$2.gdat +endif + ## Conversion of gdat fig files to ps/pdf +ifeq ($ARGS,) # single plot $1_$2.$ps : $1_$2.fig echo Creating $1_$2.$ps fig2dev -L$eps $1_$2.fig > $1_$2.$ps +else ## Multiple plots +$1_$2.$ps : $1_$2.fig + echo Creating $1_$2$__ARGS.$ps + fig2dev -L$eps $1_$2$__ARGS.fig > $1_$2$__ARGS.$ps +endif + endif #Generic conversion of Latex to latex document mtt.sty: @@ -2963,12 +3000,17 @@ $1_$2.view : $Subsystem_$2.pview endif ifeq ($REPTYPE,data) $1_$2.view: $1_$2.$ps +ifeq ($ARGS,) # single plot echo Creating view of $1_$2 - $ps file $psview $1_$2.$ps& +else + echo Creating view of $1_$2$__ARGS - $ps file + $psview $1_$2$__ARGS.$ps& +endif endif ifeq ($REPTYPE,tex) $1_$2.view : $1_$2.pview endif