Differences From Artifact [6c6f6f23cc]:

To Artifact [9014841ce0]:


11
12
13
14
15
16
17



18
19
20
21
22
23
24
# Copyright (C) 2000 by Peter J. Gawthrop

###############################################################
## Version control history
###############################################################
## $Header$
## $Log$



## Revision 1.282  2000/11/24 14:53:53  peterg
## Added lagrange rep : lde.r and lde.tex
##
## Revision 1.281  2000/11/16 13:51:15  peterg
## Added units stuff
##
## Revision 1.280  2000/11/10 14:45:16  peterg







>
>
>







11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Copyright (C) 2000 by Peter J. Gawthrop

###############################################################
## Version control history
###############################################################
## $Header$
## $Log$
## Revision 1.283  2000/11/24 15:11:50  peterg
## -pdf switch for simple displays
##
## Revision 1.282  2000/11/24 14:53:53  peterg
## Added lagrange rep : lde.r and lde.tex
##
## Revision 1.281  2000/11/16 13:51:15  peterg
## Added units stuff
##
## Revision 1.280  2000/11/10 14:45:16  peterg
1087
1088
1089
1090
1091
1092
1093
1094

1095
1096
1097

1098
1099
1100
1101
1102
1103
1104
                mtt_switches="$mtt_switches $1";
                using_oct=yes;
                m=oct
                ;;
	-opt )  mtt_switches="$mtt_switches $1";
                optimise='-optimise';;
	-partition ) mtt_switches="$mtt_switches $1";
                     partition='-partition';;

	-pdf )   mtt_switches="$mtt_switches $1";
                 ps=pdf;
                 eps=pdf;

                 psview=$PDFVIEW;
                ;;
	-viewlevel )  mtt_switches="$mtt_switches $1 $2";
                      viewlevel=$2;
                      shift;;
        --version)                
                  echo 'MTT version' $version; exit;;







|
>

|

>







1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
                mtt_switches="$mtt_switches $1";
                using_oct=yes;
                m=oct
                ;;
	-opt )  mtt_switches="$mtt_switches $1";
                optimise='-optimise';;
	-partition ) mtt_switches="$mtt_switches $1";
                     partition='-partition';
                ;;
	-pdf )   mtt_switches="$mtt_switches $1";
                 ps=pdf; 
                 eps=pdf;
                 pdf='-pdf';
                 psview=$PDFVIEW;
                ;;
	-viewlevel )  mtt_switches="$mtt_switches $1 $2";
                      viewlevel=$2;
                      shift;;
        --version)                
                  echo 'MTT version' $version; exit;;
1585
1586
1587
1588
1589
1590
1591

























1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
	nifr)
		REPTYPE='data' ;;
	*)
		REPTYPE='tex' ;;
esac



























# 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

cat > $1_args.new <<EOF
$ARGS
EOF

DIFF=`diff -bq $1_args.m $1_args.new 2>/dev/null`

if [ -n "$DIFF" ]; then
  mv $1_args.new $1_args.m
fi

# Tidy mode - operate in the directory MTT-work
if [ "$tidy" = "tidy" ]; then
   mkdir -p MTT_work
   cp -p -u  Makefile Make *.* .* MTT_work  2>/dev/null
   cd MTT_work








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>

|


|
|
|
|

|
|
|

|

|
|
|







1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
	nifr)
		REPTYPE='data' ;;
	*)
		REPTYPE='tex' ;;
esac


## Set up the main arguments
sys=$1
rep=$2
lang=$3

## 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"_"
Subsystem_ese=$Subsystem"_ese"
Subsystem_def=$Subsystem"_def"
Subsystem_rdae=$Subsystem"_rdae"
Subsystem_dae=$Subsystem"_dae"
Subsystem_subs=$Subsystem"_subs"
Subsystem_cr=$Subsystem"_cr"
Subsystem_cbg=$Subsystem"_cbg"

# 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

#cat > $1_args.new <<EOF
#$ARGS
##EOF

#DIFF=`diff -bq $1_args.m $1_args.new 2>/dev/null`

#if [ -n "$DIFF" ]; then
#  mv $1_args.new $1_args.m
#fi

# Tidy mode - operate in the directory MTT-work
if [ "$tidy" = "tidy" ]; then
   mkdir -p MTT_work
   cp -p -u  Makefile Make *.* .* MTT_work  2>/dev/null
   cd MTT_work

1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660

  # Copy back form working directory
   if [ "$3" != "view" ] && [ "$3" != "hview" ] && [ -z "$reset" ]; then
      if [ "$3" = "html" ]; then
	  echo Moving $1_$2
          mv $1_$2 ..
      else
          echo Copying  $1$subsystem"_"$2.$3
          cp  -p -u $1$subsystem"_"$2.$3 ..
      fi
      if [ "$PLOTTYPE" = "multiple" ]; then
        echo Copying  $1_$2$__ARGS.$ps
        cp  $1_$2$__ARGS.$ps ..
      fi
    fi








|
|







1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690

  # Copy back form working directory
   if [ "$3" != "view" ] && [ "$3" != "hview" ] && [ -z "$reset" ]; then
      if [ "$3" = "html" ]; then
	  echo Moving $1_$2
          mv $1_$2 ..
      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

1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
  sys_abg=$sys"_abg"
fi

################################
# This is the main mtt programme
################################

target=$1_$2.$3

# Create some strings
Subsystem=$1$subsystem;

Subsystem_=$Subsystem"_"
Subsystem_ese=$Subsystem"_ese"
Subsystem_def=$Subsystem"_def"
Subsystem_rdae=$Subsystem"_rdae"
Subsystem_dae=$Subsystem"_dae"
Subsystem_subs=$Subsystem"_subs"
Subsystem_cr=$Subsystem"_cr"
Subsystem_cbg=$Subsystem"_cbg"

#echo Target is $target, Subsystem is $Subsystem
$MAKE -S $verbose  -f  -  $target << EOF

# Cancel implicit rules I don't want
%.dvi: %.tex

# MTT implicit rules
## .oct files







<

<
<
<
<
<
<
<
<
<
<
<
<
|







1761
1762
1763
1764
1765
1766
1767

1768












1769
1770
1771
1772
1773
1774
1775
1776
  sys_abg=$sys"_abg"
fi

################################
# This is the main mtt programme
################################















## echo Target is $target, Subsystem is $Subsystem, switches are $mtt_switches
$MAKE -S $verbose  -f  -  $target << EOF

# Cancel implicit rules I don't want
%.dvi: %.tex

# MTT implicit rules
## .oct files
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
	dat2gdat $1 $2 "$4" "$NyquistStyle"

#Generic conversion of Latex to latex document
mtt.sty:
	echo Copying mtt.sty to here
	cp $MTTPATH/trans/mtt.sty .
$1_$2.doc: $1_$2.tex
	makedoc "$mtt_switches" "$1" "$2" "$3" "$4" "$documenttype"


#Create PostScript version of fig files
ifeq ($REPTYPE,bg)
$1_$2.$ps : $1_$2.fig
	echo Creating $1_$2.$ps
	multi_command2 "fig2dev -L$eps" $1 $2.fig $2.$ps | sh
else
#Generic conversion of LaTeX doc to dvi or pdf
$1_$2.dvi: $1_$2.doc
	doc2dvi $1_$2 "$documenttype"
#$1_$2.pdf: $1_$2.doc
#	doc2pdf $1_$2 "$documenttype"
endif


ifeq ($REPTYPE,data)
#Create PostScript version of dat file 







|









|
|







2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
	dat2gdat $1 $2 "$4" "$NyquistStyle"

#Generic conversion of Latex to latex document
mtt.sty:
	echo Copying mtt.sty to here
	cp $MTTPATH/trans/mtt.sty .
$1_$2.doc: $1_$2.tex
	makedoc "$mtt_switches" "$1" "$2" "$3" "$4" "$documenttype" "$ps"


#Create PostScript version of fig files
ifeq ($REPTYPE,bg)
$1_$2.$ps : $1_$2.fig
	echo Creating $1_$2.$ps
	multi_command2 "fig2dev -L$eps" $1 $2.fig $2.$ps | sh
else
#Generic conversion of LaTeX doc to dvi or pdf
$1_$2.$ps: $1_$2.doc
	doc2$ps $1_$2 "$documenttype"
#$1_$2.pdf: $1_$2.doc
#	doc2pdf $1_$2 "$documenttype"
endif


ifeq ($REPTYPE,data)
#Create PostScript version of dat file 
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
endif
$1_$2.$ps: $1_$2.fig
	echo Creating $1_$2.$ps
	fig2dev -L$eps $1_$2.fig> $1_$2.$ps

endif

ifeq ($REPTYPE,tex)
#Create PostScript version of dvi file
$1_$2.$ps: $1_$2.dvi
	echo Creating $1_$2.$ps
	dvips -o $1_$2.$ps $1_$2
endif

ifeq ($REPTYPE,tex)
#Create html version of dvi file
$1_$2.html: $1_$2.dvi $1_$2.doc
	echo Creating $1_$2/$1_$2.html
	$LATEX2HTML $1_$2.doc>latex2html.log 2>latex2html.log
endif







|

|
|
|
|







2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
endif
$1_$2.$ps: $1_$2.fig
	echo Creating $1_$2.$ps
	fig2dev -L$eps $1_$2.fig> $1_$2.$ps

endif

#ifeq ($REPTYPE,tex)
#Create PostScript version of dvi file
#$1_$2.$ps: $1_$2.dvi
#	echo Creating $1_$2.$ps
#	dvips -o $1_$2.$ps $1_$2
#endif

ifeq ($REPTYPE,tex)
#Create html version of dvi file
$1_$2.html: $1_$2.dvi $1_$2.doc
	echo Creating $1_$2/$1_$2.html
	$LATEX2HTML $1_$2.doc>latex2html.log 2>latex2html.log
endif
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
# $1_$2.view : $1_$2.dview
$1_$2.view: $1_$2.$ps
	echo Creating view of $1_$2 - $ps file
	$psview $1_$2.$ps&
endif

ifeq ($REPTYPE,tex)
$1_$2.view : $1_$2.tview
endif

ifeq ($REPTYPE,txt)
$1_$2.view : $1_$2.tview
endif

# Hypertext view







|







2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
# $1_$2.view : $1_$2.dview
$1_$2.view: $1_$2.$ps
	echo Creating view of $1_$2 - $ps file
	$psview $1_$2.$ps&
endif

ifeq ($REPTYPE,tex)
$1_$2.view : $1_$2.pview
endif

ifeq ($REPTYPE,txt)
$1_$2.view : $1_$2.tview
endif

# Hypertext view
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
#	ps2pdf $1_$2.ps $1_$2.pdf

#Report generation
$1_rep.make: $1_rep.txt
	rep_txt2make $1 "$mtt_switches"

$1_reps_made:
	rep_txt2sh $1;  touch $1_reps_made

$1_rep.tex: $1_rep.txt $1_reps_made
	rep_txt2tex $1 "$documenttype" "$directory";

#SUMMARY abg Acausal bond graph report (tex)
$1_abg.tex: $1_sub.sh
	abg2tex $1

#SUMMARY tf Transfer function (mml)
$1_$2.mml: $1_$2.r
	mtt_r2mml $1 $2


# Version control system - uses RCS







|






|







2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
#	ps2pdf $1_$2.ps $1_$2.pdf

#Report generation
$1_rep.make: $1_rep.txt
	rep_txt2make $1 "$mtt_switches"

$1_reps_made:
	rep_txt2sh $1 "$mtt_switches";  touch $1_reps_made

$1_rep.tex: $1_rep.txt $1_reps_made
	rep_txt2tex $1 "$documenttype" "$directory";

#SUMMARY abg Acausal bond graph report (tex)
$1_abg.tex: $1_sub.sh
	echo abg2tex $pdf $1; abg2tex $pdf $1

#SUMMARY tf Transfer function (mml)
$1_$2.mml: $1_$2.r
	mtt_r2mml $1 $2


# Version control system - uses RCS

MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]