Overview
Comment:Fixed [ 647664 ] Namespace clash: LANG
Prepended MTT_ to SYS, OPTS and LANG environment variables.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: c084ef208029ec2c397b2e8344ac311f0700729d5a8366bb0da06463784c7afb
User & Date: geraint@users.sourceforge.net on 2002-12-12 17:18:43
Other Links: branch diff | manifest | tags
Context
2002-12-12
17:23:27
Fixed [ 647664 ] Namespace clash: LANG check-in: f79ccba358 user: geraint@users.sourceforge.net tags: origin/master, trunk
17:18:43
Fixed [ 647664 ] Namespace clash: LANG
Prepended MTT_ to SYS, OPTS and LANG environment variables.
check-in: c084ef2080 user: geraint@users.sourceforge.net tags: origin/master, trunk
16:07:13
Fix for [ 547513 ]
Re-written to eliminate need for installation.
Single C++ file (cxxsim.cc) handles the entire transformation which is
automatically compiled on invocation by "mtt sys cxxsim view".
check-in: 6c92018268 user: geraint@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/mtt from [9374ebd6b2] to [3f0717501a].

13
14
15
16
17
18
19



20
21
22
23
24
25
26
# Copyright (C) 2001 by Peter J. Gawthrop

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



## Revision 1.366  2002/12/06 21:56:21  geraint
## Cosmetic change: removed commented-out lines.
##
## Revision 1.365  2002/12/06 12:45:25  gawthrop
## Simplified rule for sub.sh: both fig and dia go via cmp.txt now.
##
## Revision 1.364  2002/12/03 23:28:44  geraint







>
>
>







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

###############################################################
## Version control history
###############################################################
## $Header$
## $Log$
## Revision 1.367  2002/12/09 00:14:08  geraint
## Hierarchical dia and mixed dia/fig bond graphs now working.
##
## Revision 1.366  2002/12/06 21:56:21  geraint
## Cosmetic change: removed commented-out lines.
##
## Revision 1.365  2002/12/06 12:45:25  gawthrop
## Simplified rule for sub.sh: both fig and dia go via cmp.txt now.
##
## Revision 1.364  2002/12/03 23:28:44  geraint
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
      filename=$1_$2.$3
   fi
    
   #if [ -f "$filename" ]; then
   #   echo $filename exists
   #else
     if [ -n "$Verbose" ]; then
      echo make -s -f $2_rep.make "SYS=$1" "LANG=$3" "ARG=$4" "OPTS=$mtt_switches" 
     fi
      make -s -f $2_rep.make "SYS=$1" "LANG=$3" "ARG=$4" "OPTS=$mtt_switches"
      if [ -n "$4" ]; then
         echo Copying  $1_$2$__ARGS.$ps
         cp  $1_$2$__ARGS.$ps ..
      fi
   #fi
    exit
fi







|

|







2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
      filename=$1_$2.$3
   fi
    
   #if [ -f "$filename" ]; then
   #   echo $filename exists
   #else
     if [ -n "$Verbose" ]; then
      echo make -s -f $2_rep.make "MTT_SYS=$1" "MTT_LANG=$3" "MTT_ARG=$4" "MTT_OPTS=$mtt_switches" 
     fi
      make -s -f $2_rep.make "MTT_SYS=$1" "MTT_LANG=$3" "MTT_ARG=$4" "MTT_OPTS=$mtt_switches"
      if [ -n "$4" ]; then
         echo Copying  $1_$2$__ARGS.$ps
         cp  $1_$2$__ARGS.$ps ..
      fi
   #fi
    exit
fi

Modified mttroot/mtt/lib/rep/cxxsim_rep.make from [6f40ee19ab] to [e3ace4cec8].

16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
CC=g++

INCLUDE=-I. -I${MTT_LIB}/cr/hh
OPTIMISE=-O0
WARNINGS=-Wall -ansi -pedantic


all: $(SYS)_cxxsim.$(LANG)

# view rule copied from gnuplot_rep.make
# need it here to prevent MTT using the default route (via dae)
$(SYS)_cxxsim.view: $(SYS)_gnuplot.wish $(SYS)_cxxsim.exe
	./$(SYS)_cxxsim.exe > $(SYS)_odes.dat2
	sh $(SYS)_gnuplot.wish			|\
		tee gnuplot_in.log		|\
		 gnuplot -geometry 400x300	\
		 > gnuplot_out.log 2> gnuplot_err.log &

$(SYS)_cxxsim.exe: $(SYS)_cxxsim.cc
	echo Creating $(SYS)_cxxsim.exe
	$(CC) -o $@ $^ $(OPTIMISE) $(WARNINGS) $(INCLUDE)

$(SYS)_cxxsim.cc: $(SYS)_cr.txt $(SYS)_ese.r $(SYS)_struc.txt $(SYS)_sympar.txt cxxsim
	./cxxsim $(SYS)
	cp $@ ..

cxxsim: ${MTT_LIB}/rep/cxxsim.cc
	echo creating $@
	echo Compiling $^
	$(CC) -o $@ $^ $(OPTIMISE) $(WARNINGS) $(INCLUDE)

# list of constitutive relationships
$(SYS)_cr.txt:
	mtt -q $(OPTS) $(SYS) cr txt

# elementary system equations
$(SYS)_ese.r:
	mtt -q $(OPTS) $(SYS) ese r

# system structure
$(SYS)_struc.txt:
	mtt -q $(OPTS) $(SYS) struc txt

# list of symbolic parameters
$(SYS)_sympar.txt:
	mtt -q $(OPTS) $(SYS) sympar txt

# gnuplot script
$(SYS)_gnuplot.wish:
	mtt -q $(OPTS) $(SYS) gnuplot wish







|



|
|
|




|
|


|
|








|
|


|
|


|
|


|
|


|
|
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
CC=g++

INCLUDE=-I. -I${MTT_LIB}/cr/hh
OPTIMISE=-O0
WARNINGS=-Wall -ansi -pedantic


all: $(MTT_SYS)_cxxsim.$(MTT_LANG)

# view rule copied from gnuplot_rep.make
# need it here to prevent MTT using the default route (via dae)
$(MTT_SYS)_cxxsim.view: $(MTT_SYS)_gnuplot.wish $(MTT_SYS)_cxxsim.exe
	./$(MTT_SYS)_cxxsim.exe > $(MTT_SYS)_odes.dat2
	sh $(MTT_SYS)_gnuplot.wish		|\
		tee gnuplot_in.log		|\
		 gnuplot -geometry 400x300	\
		 > gnuplot_out.log 2> gnuplot_err.log &

$(MTT_SYS)_cxxsim.exe: $(MTT_SYS)_cxxsim.cc
	echo Creating $(MTT_SYS)_cxxsim.exe
	$(CC) -o $@ $^ $(OPTIMISE) $(WARNINGS) $(INCLUDE)

$(MTT_SYS)_cxxsim.cc: $(MTT_SYS)_cr.txt $(MTT_SYS)_ese.r $(MTT_SYS)_struc.txt $(MTT_SYS)_sympar.txt cxxsim
	./cxxsim $(MTT_SYS)
	cp $@ ..

cxxsim: ${MTT_LIB}/rep/cxxsim.cc
	echo creating $@
	echo Compiling $^
	$(CC) -o $@ $^ $(OPTIMISE) $(WARNINGS) $(INCLUDE)

# list of constitutive relationships
$(MTT_SYS)_cr.txt:
	mtt -q $(MTT_OPTS) $(MTT_SYS) cr txt

# elementary system equations
$(MTT_SYS)_ese.r:
	mtt -q $(MTT_OPTS) $(MTT_SYS) ese r

# system structure
$(MTT_SYS)_struc.txt:
	mtt -q $(MTT_OPTS) $(MTT_SYS) struc txt

# list of symbolic parameters
$(MTT_SYS)_sympar.txt:
	mtt -q $(MTT_OPTS) $(MTT_SYS) sympar txt

# gnuplot script
$(MTT_SYS)_gnuplot.wish:
	mtt -q $(MTT_OPTS) $(MTT_SYS) gnuplot wish

Modified mttroot/mtt/lib/rep/gnuplot_rep.make from [654748f69a] to [e302751500].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# -*-makefile-*-
# create a gnuplot input file

MTTFLAGS	= $(OPTS)

all: $(SYS)_gnuplot.$(LANG)

$(SYS)_gnuplot.view: $(SYS)_gnuplot.wish
	mtt $(OPTS) $(SYS) odes dat2
	sh $(SYS)_gnuplot.wish			|\
		tee gnuplot_in.log		|\
		 gnuplot -geometry 400x300	\
		 > gnuplot_out.log 2> gnuplot_err.log &

$(SYS)_gnuplot.wish: $(SYS)_struc.txt
	$(MTTPATH)/trans/struc2gnuplot_txt2wish $(SYS)

$(SYS)_struc.txt:
	mtt $(MTTFLAGS) $(SYS) struc txt





|

|

|
|
|




|
|

|
|


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# -*-makefile-*-
# create a gnuplot input file

MTTFLAGS	= $(MTT_OPTS)

all: $(MTT_SYS)_gnuplot.$(MTT_LANG)

$(MTT_SYS)_gnuplot.view: $(MTT_SYS)_gnuplot.wish
	mtt $(MTT_OPTS) $(MTT_SYS) odes dat2
	sh $(MTT_SYS)_gnuplot.wish			|\
		tee gnuplot_in.log		|\
		 gnuplot -geometry 400x300	\
		 > gnuplot_out.log 2> gnuplot_err.log &

$(MTT_SYS)_gnuplot.wish: $(MTT_SYS)_struc.txt
	$(MTTPATH)/trans/struc2gnuplot_txt2wish $(MTT_SYS)

$(MTT_SYS)_struc.txt:
	mtt $(MTTFLAGS) $(MTT_SYS) struc txt


Modified mttroot/mtt/lib/rep/ident_rep.make from [a0d4f73f87] to [7792e45e2b].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# -*-makefile-*-

#SUMMARY 	Identification
#DESCRIPTION 	Partially know system identification using
#DESCRIPTION    using bond graphs

# Makefile for representation ident
# File ident_rep.make

#Copyright (C) 2000,2001,2002 by Peter J. Gawthrop

## Model targets
model_reps =  ${SYS}_sympar.m ${SYS}_simpar.m ${SYS}_state.m 
model_reps += ${SYS}_numpar.m ${SYS}_input.m ${SYS}_ode2odes.m  
model_reps += ${SYS}_def.m 

## Prepend s to get the sensitivity targets
sensitivity_reps = ${model_reps:%=s%}

## Model prerequisites
model_pre =  ${SYS}_abg.fig ${SYS}_lbl.txt 
model_pre += ${SYS}_rdae.r ${SYS}_numpar.txt

## Prepend s to get the sensitivity targets
sensitivity_pre = ${model_pre:%=s%}


## Simulation targets
sims = ${SYS}_sim.m s${SYS}_ssim.m

## m-files needed for ident
ident_m = ${SYS}_ident.m ${SYS}_ident_numpar.m 

## Targets for the ident simulation
ident_reps = ${ident_m} ${sims} ${model_reps} ${sensitivity_reps}

## ps output files etc
psfiles = ${SYS}_ident.ps ${SYS}_ident.comparison.ps
figfiles = ${psfiles:%.ps=%.fig}
gdatfiles = ${psfiles:%.ps=%.gdat}
datfiles = ${psfiles:%.ps=%.dat2}

## LaTeX files etc
latexfiles = ${SYS}_ident_par.tex

all: ${SYS}_ident.${LANG}

echo:
	echo "sims: ${sims}"
	echo "model_reps: ${model_reps}"
	echo "sensitivity_reps: ${sensitivity_reps}"
	echo "ident_reps: ${ident_reps}"

${SYS}_ident.view: ${psfiles}
	ident_rep.sh ${SYS} view

${psfiles}: ${figfiles}
	ident_rep.sh ${SYS} ps

${figfiles}: ${gdatfiles}
	ident_rep.sh ${SYS} fig

${gdatfiles}: ${datfiles}
	ident_rep.sh ${SYS} gdat

${datfiles} ${latexfiles}: ${ident_reps}
	ident_rep.sh ${SYS} dat2

${SYS}_ident.m: 
	ident_rep.sh ${SYS} m

${SYS}_ident_numpar.m:
	ident_rep.sh ${SYS} numpar.m

## System model reps
## Generic txt files 
${SYS}_%.txt:
	mtt ${OPTS} -q -stdin ${SYS} $* txt

## Specific m files
${SYS}_ode2odes.m: ${model_pre}
	mtt -q -stdin ${OPTS} ${SYS} ode2odes m

${SYS}_sim.m: ${SYS}_ode2odes.m
	mtt ${OPTS} -q -stdin ${SYS} sim m

## Numpar files
${SYS}_numpar.m:
	mtt ${SYS} numpar m

## Sympar files
${SYS}_sympar.m:
	mtt ${SYS} sympar m

## Generic txt to m
${SYS}_%.m: ${SYS}_%.txt
	mtt ${OPTS} -q -stdin ${SYS} $* m

## r files
${SYS}_def.r: ${SYS}_abg.fig
	mtt ${OPTS} -q -stdin ${SYS} def r

${SYS}_rdae.r: 
	mtt ${OPTS} -q -stdin ${SYS} rdae r

## Sensitivity model reps
## Generic txt files 
s${SYS}_%.txt:
	mtt ${OPTS} -q -stdin -s s${SYS} $* txt

## Specific m files
## Numpar files
s${SYS}_numpar.m:
	mtt -s s${SYS} numpar m

## Sympar files
s${SYS}_sympar.m:
	mtt -s s${SYS} sympar m

s${SYS}_ode2odes.m: ${sensitivity_pre}
	mtt -q -stdin ${OPTS} -s s${SYS} ode2odes m

s${SYS}_ssim.m:
	mtt -q -stdin ${OPTS} -s s${SYS} ssim m

s${SYS}_def.m:
	mtt -q -stdin ${OPTS} -s s${SYS} def m


## Generic txt to m
s${SYS}_%.m: s${SYS}_%.txt
	mtt ${OPTS} -q -stdin s${SYS} $* m

## r files
s${SYS}_rdae.r: 
	mtt ${OPTS} -q -stdin -s s${SYS} rdae r













|
|
|





|
|






|


|





|





|

|







|
|


|


|


|


|

|
|

|
|



|
|


|
|

|
|


|
|


|
|


|
|


|
|

|
|



|
|



|
|


|
|

|
|

|
|

|
|



|
|


|
|

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
# -*-makefile-*-

#SUMMARY 	Identification
#DESCRIPTION 	Partially know system identification using
#DESCRIPTION    using bond graphs

# Makefile for representation ident
# File ident_rep.make

#Copyright (C) 2000,2001,2002 by Peter J. Gawthrop

## Model targets
model_reps =  ${MTT_SYS}_sympar.m ${MTT_SYS}_simpar.m ${MTT_SYS}_state.m 
model_reps += ${MTT_SYS}_numpar.m ${MTT_SYS}_input.m ${MTT_SYS}_ode2odes.m  
model_reps += ${MTT_SYS}_def.m 

## Prepend s to get the sensitivity targets
sensitivity_reps = ${model_reps:%=s%}

## Model prerequisites
model_pre =  ${MTT_SYS}_abg.fig ${MTT_SYS}_lbl.txt 
model_pre += ${MTT_SYS}_rdae.r ${MTT_SYS}_numpar.txt

## Prepend s to get the sensitivity targets
sensitivity_pre = ${model_pre:%=s%}


## Simulation targets
sims = ${MTT_SYS}_sim.m s${MTT_SYS}_ssim.m

## m-files needed for ident
ident_m = ${MTT_SYS}_ident.m ${MTT_SYS}_ident_numpar.m 

## Targets for the ident simulation
ident_reps = ${ident_m} ${sims} ${model_reps} ${sensitivity_reps}

## ps output files etc
psfiles = ${MTT_SYS}_ident.ps ${MTT_SYS}_ident.comparison.ps
figfiles = ${psfiles:%.ps=%.fig}
gdatfiles = ${psfiles:%.ps=%.gdat}
datfiles = ${psfiles:%.ps=%.dat2}

## LaTeX files etc
latexfiles = ${MTT_SYS}_ident_par.tex

all: ${MTT_SYS}_ident.${MTT_LANG}

echo:
	echo "sims: ${sims}"
	echo "model_reps: ${model_reps}"
	echo "sensitivity_reps: ${sensitivity_reps}"
	echo "ident_reps: ${ident_reps}"

${MTT_SYS}_ident.view: ${psfiles}
	ident_rep.sh ${MTT_SYS} view

${psfiles}: ${figfiles}
	ident_rep.sh ${MTT_SYS} ps

${figfiles}: ${gdatfiles}
	ident_rep.sh ${MTT_SYS} fig

${gdatfiles}: ${datfiles}
	ident_rep.sh ${MTT_SYS} gdat

${datfiles} ${latexfiles}: ${ident_reps}
	ident_rep.sh ${MTT_SYS} dat2

${MTT_SYS}_ident.m: 
	ident_rep.sh ${MTT_SYS} m

${MTT_SYS}_ident_numpar.m:
	ident_rep.sh ${MTT_SYS} numpar.m

## System model reps
## Generic txt files 
${MTT_SYS}_%.txt:
	mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} $* txt

## Specific m files
${MTT_SYS}_ode2odes.m: ${model_pre}
	mtt -q -stdin ${MTT_OPTS} ${MTT_SYS} ode2odes m

${MTT_SYS}_sim.m: ${MTT_SYS}_ode2odes.m
	mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} sim m

## Numpar files
${MTT_SYS}_numpar.m:
	mtt ${MTT_SYS} numpar m

## Sympar files
${MTT_SYS}_sympar.m:
	mtt ${MTT_SYS} sympar m

## Generic txt to m
${MTT_SYS}_%.m: ${MTT_SYS}_%.txt
	mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} $* m

## r files
${MTT_SYS}_def.r: ${MTT_SYS}_abg.fig
	mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} def r

${MTT_SYS}_rdae.r: 
	mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} rdae r

## Sensitivity model reps
## Generic txt files 
s${MTT_SYS}_%.txt:
	mtt ${MTT_OPTS} -q -stdin -s s${MTT_SYS} $* txt

## Specific m files
## Numpar files
s${MTT_SYS}_numpar.m:
	mtt -s s${MTT_SYS} numpar m

## Sympar files
s${MTT_SYS}_sympar.m:
	mtt -s s${MTT_SYS} sympar m

s${MTT_SYS}_ode2odes.m: ${sensitivity_pre}
	mtt -q -stdin ${MTT_OPTS} -s s${MTT_SYS} ode2odes m

s${MTT_SYS}_ssim.m:
	mtt -q -stdin ${MTT_OPTS} -s s${MTT_SYS} ssim m

s${MTT_SYS}_def.m:
	mtt -q -stdin ${MTT_OPTS} -s s${MTT_SYS} def m


## Generic txt to m
s${MTT_SYS}_%.m: s${MTT_SYS}_%.txt
	mtt ${MTT_OPTS} -q -stdin s${MTT_SYS} $* m

## r files
s${MTT_SYS}_rdae.r: 
	mtt ${MTT_OPTS} -q -stdin -s s${MTT_SYS} rdae r

Modified mttroot/mtt/lib/rep/ippp_rep.make from [aaaaecfa67] to [093030e2cb].

1
2
3
4
5
6
7
8
9
10
11
12
13



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# -*-makefile-*-
# Makefile for representation ippp - ppp system identification
# File ippp_rep.make

  ###################################### 
  ##### Model Transformation Tools #####
  ######################################

  ###############################################################
  ## Version control history
  ###############################################################
  ## $Id$
  ## $Log$



  ## Revision 1.3  2001/04/11 07:52:45  gawthrop
  ## Temporary fix to avoid incorrect _input.cc with stdin
  ##
  ## Revision 1.2  2001/04/05 11:49:07  gawthrop
  ## Fixed a number of bugs to as to work with reports.
  ##
  ## Revision 1.1  2001/04/04 10:05:38  gawthrop
  ## Reresentation for system identification for ppp
  ##
  ###############################################################

#Copyright (C) 2000 by Peter J. Gawthrop

all: $(SYS)_ippp.$(LANG)

$(SYS)_ippp.view:  $(SYS)_ippp.pdf
	acroread *.pdf

$(SYS)_ippp.ps: $(SYS)_parameters.ps $(SYS)_error.ps $(SYS)_outputs.ps $(SYS)_ippp.pdf
	cp $(SYS)_parameters.ps $(SYS)_ippp.ps

$(SYS)_ippp.pdf: $(SYS)_parameters.pdf $(SYS)_error.pdf $(SYS)_outputs.pdf
	cp $(SYS)_parameters.pdf $(SYS)_ippp.pdf

$(SYS)_parameters.ps: s$(SYS)_ode2odes.m s$(SYS)_ssim.m $(SYS)_ippp.m s$(SYS)_sympar.m s$(SYS)_simpar.m
	octave $(SYS)_ippp.m

$(SYS)_error.ps: $(SYS)_parameters.ps
	touch $(SYS)_error.ps

$(SYS)_outputs.ps: $(SYS)_parameters.ps
	touch $(SYS)_outputs.ps

$(SYS)_parameters.pdf: s$(SYS)_ode2odes.m s$(SYS)_ssim.m $(SYS)_ippp.m s$(SYS)_sympar.m s$(SYS)_simpar.m
	octave $(SYS)_ippp.m

$(SYS)_error.pdf: $(SYS)_parameters.pdf
	touch $(SYS)_error.pdf

$(SYS)_outputs.pdf: $(SYS)_parameters.pdf
	touch $(SYS)_outputs.pdf

s$(SYS)_ode2odes.m: 
	echo Starting creation of s$(SYS)_ode2odes.m with options $(OPTS)
	mtt -q $(OPTS) -stdin -s s$(SYS) ode2odes oct

s$(SYS)_ssim.m: s$(SYS)_def.m
	mtt -q $(OPTS) -s s$(SYS) ssim m

s$(SYS)_sympar.m:
	mtt -q $(OPTS) -s s$(SYS) sympar m

s$(SYS)_simpar.m:
	mtt -q $(OPTS) -s s$(SYS) simpar m

s$(SYS)_def.m:
	mtt -q $(OPTS) -s s$(SYS) def m














>
>
>













|

|


|
|

|
|

|
|

|
|

|
|

|
|

|
|

|
|

|
|
|

|
|

|
|

|
|

|
|

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# -*-makefile-*-
# Makefile for representation ippp - ppp system identification
# File ippp_rep.make

  ###################################### 
  ##### Model Transformation Tools #####
  ######################################

  ###############################################################
  ## Version control history
  ###############################################################
  ## $Id$
  ## $Log$
  ## Revision 1.4  2001/04/23 15:06:21  gawthrop
  ## Removed stdin bug workaround
  ##
  ## Revision 1.3  2001/04/11 07:52:45  gawthrop
  ## Temporary fix to avoid incorrect _input.cc with stdin
  ##
  ## Revision 1.2  2001/04/05 11:49:07  gawthrop
  ## Fixed a number of bugs to as to work with reports.
  ##
  ## Revision 1.1  2001/04/04 10:05:38  gawthrop
  ## Reresentation for system identification for ppp
  ##
  ###############################################################

#Copyright (C) 2000 by Peter J. Gawthrop

all: $(MTT_SYS)_ippp.$(MTT_LANG)

$(MTT_SYS)_ippp.view:  $(MTT_SYS)_ippp.pdf
	acroread *.pdf

$(MTT_SYS)_ippp.ps: $(MTT_SYS)_parameters.ps $(MTT_SYS)_error.ps $(MTT_SYS)_outputs.ps $(MTT_SYS)_ippp.pdf
	cp $(MTT_SYS)_parameters.ps $(MTT_SYS)_ippp.ps

$(MTT_SYS)_ippp.pdf: $(MTT_SYS)_parameters.pdf $(MTT_SYS)_error.pdf $(MTT_SYS)_outputs.pdf
	cp $(MTT_SYS)_parameters.pdf $(MTT_SYS)_ippp.pdf

$(MTT_SYS)_parameters.ps: s$(MTT_SYS)_ode2odes.m s$(MTT_SYS)_ssim.m $(MTT_SYS)_ippp.m s$(MTT_SYS)_sympar.m s$(MTT_SYS)_simpar.m
	octave $(MTT_SYS)_ippp.m

$(MTT_SYS)_error.ps: $(MTT_SYS)_parameters.ps
	touch $(MTT_SYS)_error.ps

$(MTT_SYS)_outputs.ps: $(MTT_SYS)_parameters.ps
	touch $(MTT_SYS)_outputs.ps

$(MTT_SYS)_parameters.pdf: s$(MTT_SYS)_ode2odes.m s$(MTT_SYS)_ssim.m $(MTT_SYS)_ippp.m s$(MTT_SYS)_sympar.m s$(MTT_SYS)_simpar.m
	octave $(MTT_SYS)_ippp.m

$(MTT_SYS)_error.pdf: $(MTT_SYS)_parameters.pdf
	touch $(MTT_SYS)_error.pdf

$(MTT_SYS)_outputs.pdf: $(MTT_SYS)_parameters.pdf
	touch $(MTT_SYS)_outputs.pdf

s$(MTT_SYS)_ode2odes.m: 
	echo Starting creation of s$(MTT_SYS)_ode2odes.m with options $(MTT_OPTS)
	mtt -q $(MTT_OPTS) -stdin -s s$(MTT_SYS) ode2odes oct

s$(MTT_SYS)_ssim.m: s$(MTT_SYS)_def.m
	mtt -q $(MTT_OPTS) -s s$(MTT_SYS) ssim m

s$(MTT_SYS)_sympar.m:
	mtt -q $(MTT_OPTS) -s s$(MTT_SYS) sympar m

s$(MTT_SYS)_simpar.m:
	mtt -q $(MTT_OPTS) -s s$(MTT_SYS) simpar m

s$(MTT_SYS)_def.m:
	mtt -q $(MTT_OPTS) -s s$(MTT_SYS) def m

Modified mttroot/mtt/lib/rep/nppp_rep.make from [0545d82e23] to [53790be183].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# -*-makefile-*-

#SUMMARY 	Nonlinear pole-placement predictive control (nPPP)
#DESCRIPTION 	

# Makefile for representation nppp
# File nppp_rep.make

#Copyright (C) 2000,2001,2002 by Peter J. Gawthrop

## Model targets
model_reps =  ${SYS}_sympar.m ${SYS}_simpar.m ${SYS}_state.m 
model_reps += ${SYS}_numpar.m ${SYS}_input.m ${SYS}_ode2odes.m  
model_reps += ${SYS}_def.m

## Prepend s to get the sensitivity targets
sensitivity_reps = ${model_reps:%=s%}

## Simulation targets
sims = ${SYS}_sim.m s${SYS}_ssim.m

## m-files needed for nppp
nppp_m = ${SYS}_nppp.m ${SYS}_nppp_numpar.m 

## Targets for the nppp simulation
nppp_reps = ${nppp_m} ${sims} ${model_reps} ${sensitivity_reps}

## ps output files
psfiles = ${SYS}_nppp.ps ${SYS}_nppp.basis.ps ${SYS}_nppp.par.ps ${SYS}_nppp.U.ps
figfiles = ${psfiles:%.ps=%.fig}

all: ${SYS}_nppp.${LANG}

echo:
	echo "sims: ${sims}"
	echo "model_reps: ${model_reps}"
	echo "sensitivity_reps: ${sensitivity_reps}"
	echo "nppp_reps: ${nppp_reps}"

${SYS}_nppp.view: ${SYS}_nppp.ps
	nppp_rep.sh ${SYS} view

${psfiles}: ${SYS}_nppp.fig
	nppp_rep.sh ${SYS} ps

${SYS}_nppp.gdat: ${SYS}_nppp.dat2
	nppp_rep.sh ${SYS} gdat

${SYS}_nppp.fig ${SYS}_nppp.dat2: ${nppp_reps}
	nppp_rep.sh ${SYS} dat2

${SYS}_nppp.m: 
	nppp_rep.sh ${SYS} m

${SYS}_nppp_numpar.m:
	nppp_rep.sh ${SYS} numpar.m

## System model reps
## Generic txt files 
${SYS}_%.txt:
	mtt ${OPTS} -q -stdin ${SYS} $* txt

## Specific m files
${SYS}_ode2odes.m: ${SYS}_rdae.r
	mtt -q -stdin ${OPTS} ${SYS} ode2odes m

${SYS}_sim.m: ${SYS}_ode2odes.m
	mtt ${OPTS} -q -stdin ${SYS} sim m

## Generic txt to m
${SYS}_%.m: ${SYS}_%.txt
	mtt ${OPTS} -q -stdin ${SYS} $* m

## r files
${SYS}_def.r: ${SYS}_abg.fig
	mtt ${OPTS} -q -stdin ${SYS} def r

${SYS}_rdae.r: 
	mtt ${OPTS} -q -stdin ${SYS} rdae r

## Sensitivity model reps
## Generic txt files 
s${SYS}_%.txt:
	mtt ${OPTS} -q -stdin s${SYS} $* txt

## Specific m files
s${SYS}_ode2odes.m: s${SYS}_rdae.r
	mtt -q -stdin ${OPTS} -s s${SYS} ode2odes m

s${SYS}_ssim.m:
	mtt -q -stdin ${OPTS} -s s${SYS} ssim m

s${SYS}_def.m:
	mtt -q -stdin ${OPTS} -s s${SYS} def m


## Generic txt to m
s${SYS}_%.m: s${SYS}_%.txt
	mtt ${OPTS} -q -stdin s${SYS} $* m


## r files
s${SYS}_rdae.r: 
	mtt ${OPTS} -q -stdin -s s${SYS} rdae r













|
|
|





|


|





|


|







|
|

|
|

|
|

|
|

|
|

|
|



|
|


|
|

|
|


|
|


|
|

|
|



|
|


|
|

|
|

|
|



|
|



|
|


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
# -*-makefile-*-

#SUMMARY 	Nonlinear pole-placement predictive control (nPPP)
#DESCRIPTION 	

# Makefile for representation nppp
# File nppp_rep.make

#Copyright (C) 2000,2001,2002 by Peter J. Gawthrop

## Model targets
model_reps =  ${MTT_SYS}_sympar.m ${MTT_SYS}_simpar.m ${MTT_SYS}_state.m 
model_reps += ${MTT_SYS}_numpar.m ${MTT_SYS}_input.m ${MTT_SYS}_ode2odes.m  
model_reps += ${MTT_SYS}_def.m

## Prepend s to get the sensitivity targets
sensitivity_reps = ${model_reps:%=s%}

## Simulation targets
sims = ${MTT_SYS}_sim.m s${MTT_SYS}_ssim.m

## m-files needed for nppp
nppp_m = ${MTT_SYS}_nppp.m ${MTT_SYS}_nppp_numpar.m 

## Targets for the nppp simulation
nppp_reps = ${nppp_m} ${sims} ${model_reps} ${sensitivity_reps}

## ps output files
psfiles = ${MTT_SYS}_nppp.ps ${MTT_SYS}_nppp.basis.ps ${MTT_SYS}_nppp.par.ps ${MTT_SYS}_nppp.U.ps
figfiles = ${psfiles:%.ps=%.fig}

all: ${MTT_SYS}_nppp.${MTT_LANG}

echo:
	echo "sims: ${sims}"
	echo "model_reps: ${model_reps}"
	echo "sensitivity_reps: ${sensitivity_reps}"
	echo "nppp_reps: ${nppp_reps}"

${MTT_SYS}_nppp.view: ${MTT_SYS}_nppp.ps
	nppp_rep.sh ${MTT_SYS} view

${psfiles}: ${MTT_SYS}_nppp.fig
	nppp_rep.sh ${MTT_SYS} ps

${MTT_SYS}_nppp.gdat: ${MTT_SYS}_nppp.dat2
	nppp_rep.sh ${MTT_SYS} gdat

${MTT_SYS}_nppp.fig ${MTT_SYS}_nppp.dat2: ${nppp_reps}
	nppp_rep.sh ${MTT_SYS} dat2

${MTT_SYS}_nppp.m: 
	nppp_rep.sh ${MTT_SYS} m

${MTT_SYS}_nppp_numpar.m:
	nppp_rep.sh ${MTT_SYS} numpar.m

## System model reps
## Generic txt files 
${MTT_SYS}_%.txt:
	mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} $* txt

## Specific m files
${MTT_SYS}_ode2odes.m: ${MTT_SYS}_rdae.r
	mtt -q -stdin ${MTT_OPTS} ${MTT_SYS} ode2odes m

${MTT_SYS}_sim.m: ${MTT_SYS}_ode2odes.m
	mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} sim m

## Generic txt to m
${MTT_SYS}_%.m: ${MTT_SYS}_%.txt
	mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} $* m

## r files
${MTT_SYS}_def.r: ${MTT_SYS}_abg.fig
	mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} def r

${MTT_SYS}_rdae.r: 
	mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} rdae r

## Sensitivity model reps
## Generic txt files 
s${MTT_SYS}_%.txt:
	mtt ${MTT_OPTS} -q -stdin s${MTT_SYS} $* txt

## Specific m files
s${MTT_SYS}_ode2odes.m: s${MTT_SYS}_rdae.r
	mtt -q -stdin ${MTT_OPTS} -s s${MTT_SYS} ode2odes m

s${MTT_SYS}_ssim.m:
	mtt -q -stdin ${MTT_OPTS} -s s${MTT_SYS} ssim m

s${MTT_SYS}_def.m:
	mtt -q -stdin ${MTT_OPTS} -s s${MTT_SYS} def m


## Generic txt to m
s${MTT_SYS}_%.m: s${MTT_SYS}_%.txt
	mtt ${MTT_OPTS} -q -stdin s${MTT_SYS} $* m


## r files
s${MTT_SYS}_rdae.r: 
	mtt ${MTT_OPTS} -q -stdin -s s${MTT_SYS} rdae r


Modified mttroot/mtt/lib/rep/sfun_rep.make from [47318c59e0] to [a81b02cdc5].

1
2
3
4
5
6
# -*-makefile-*-

REP ?= "sfun"

all:
	${MTT_REP}/sfun_rep.sh "$(OPTS)" "$(SYS)" "$(REP)" "$(LANG)"


<
<

|
1
2


3
4
# -*-makefile-*-



all:
	${MTT_REP}/sfun_rep.sh "$(MTT_OPTS)" "$(MTT_SYS)" "$(MTT_LANG)"

Modified mttroot/mtt/lib/rep/sfun_rep.sh from [fe83bc4dd5] to [4e120748b1].

1375
1376
1377
1378
1379
1380
1381
1382
1383


### main program

set_debug false
check_for_valid_input "$*"

OPTS="$1" SYS="$2" REP="$3" LANG="$4" make $make_debug -f ${MTT_REP}/sfun_rep/Makefile ${2}_${3}.${4}
exit 0







|

1375
1376
1377
1378
1379
1380
1381
1382
1383


### main program

set_debug false
check_for_valid_input "$*"

MTT_OPTS="$1" MTT_SYS="$2" MTT_LANG="$3" make $make_debug -f ${MTT_REP}/sfun_rep/Makefile ${2}_sfun.${3}
exit 0

Modified mttroot/mtt/lib/rep/sfun_rep/Makefile from [f386a128ec] to [974e36d4ad].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#! /usr/bin/make -f

all: $(SYS)_sfun.mexglx

$(SYS)_sfun.mexglx: $(SYS)_sfun.c sfun_debug.h useful-functions.hh $(SYS)_def.h $(SYS)_sympar.h $(SYS)_cr.h $(SYS)_numpar.c $(SYS)_ode.c $(SYS)_odeo.c $(SYS)_state.c $(SYS)_sfun_ae.mexglx $(SYS)_sfun_input.mexglx $(SYS)_sfun_interface.mexglx $(SYS).mdl
	echo Creating $@
	mex $(SYS)_sfun.c
	cp *_sfun*mexglx $(SYS).mdl ..

$(SYS)_sfun.c:: ${MTT_REP}/sfun_rep/sfun.c.tmpl
	echo Creating $@
	cat $^ | sed 's/<mtt_model_name>/$(SYS)/g' > $@

$(SYS)_sfun_ae.mexglx: $(SYS)_sfun_ae.c sfun_debug.h useful-functions.hh $(SYS)_def.h $(SYS)_sympar.h $(SYS)_cr.h $(SYS)_ae.c
	echo Creating $@
	mex $(SYS)_sfun_ae.c

$(SYS)_sfun_ae.c:: ${MTT_REP}/sfun_rep/mex_ae.c.tmpl
	echo Creating $@
	cat $^ | sed 's/<mtt_model_name>/$(SYS)/g' > $@

$(SYS)_sfun_input.mexglx: $(SYS)_sfun_input.c sfun_debug.h useful-functions.hh $(SYS)_def.h $(SYS)_sympar.h $(SYS)_cr.h $(SYS)_input.c $(SYS)_numpar.c
	echo Creating $@
	mex $(SYS)_sfun_input.c

$(SYS)_sfun_input.c:: ${MTT_REP}/sfun_rep/sfun_input.c.tmpl
	echo Creating $@
	cat $^ | sed 's/<mtt_model_name>/$(SYS)/g' > $@

$(SYS)_sfun_interface.mexglx: $(SYS)_sfun_interface.c sfun_debug.h useful-functions.hh $(SYS)_def.h $(SYS)_sympar.h $(SYS)_numpar.c
	echo Creating $@
	mex $(SYS)_sfun_interface.c

$(SYS)_sfun_interface.c: ${MTT_REP}/sfun_rep/sfun_interface.c.tmpl $(SYS)_struc.c
	echo Creating $@
	cat ${MTT_REP}/sfun_rep/sfun_interface.c.tmpl	|\
	 sed 's/<mtt_model_name>/$(SYS)/g'		|\
	 ${MTT_REP}/sfun_rep/insert_file.sh > $@

$(SYS)_sfun.zip: $(SYS)_sfun.c sfun_debug.h useful-functions.hh $(SYS)_sfun_ae.c $(SYS)_sfun_input.c $(SYS)_sfun_interface.c \
	 $(SYS)_def.h $(SYS)_sympar.h $(SYS)_cr.h\
	 $(SYS)_ae.c $(SYS)_input.c $(SYS)_numpar.c $(SYS)_ode.c $(SYS)_odeo.c $(SYS)_state.c \
	 $(SYS).mdl README
	echo Creating $@
	zip $@ $^

$(SYS).mdl: ${MTT_REP}/sfun_rep/mdl.tmpl
	echo Creating $@
	cat $^ | sed 's/<mtt_model_name>/$(SYS)/g' > $@

README:: ${MTT_REP}/sfun_rep/README.tmpl README.CVS
	echo Creating $@
	cat $^ | sed 's/<mtt_model_name>/$(SYS)/g' > $@
	rm -f README.CVS

README.CVS:
	echo Getting CVS status
	cvs status ../$(SYS)_abg.fig > $@ 2>1
	date >> $@

$(SYS)_ae.c: $(SYS)_ae.m
	echo Creating $@
	${MTT_CC}/mtt_m2cc.sh $(SYS) ae c cat 

$(SYS)_input.c: $(SYS)_input.m
	echo Creating $@
	${MTT_CC}/mtt_m2cc.sh $(SYS) input c cat 

$(SYS)_numpar.c: $(SYS)_numpar.m
	echo Creating $@
	${MTT_CC}/mtt_m2cc.sh $(SYS) numpar c cat

$(SYS)_ode.c: $(SYS)_ode.m
	echo Creating $@
	${MTT_CC}/mtt_m2cc.sh $(SYS) ode c cat

$(SYS)_odeo.c: $(SYS)_odeo.m
	echo Creating $@
	${MTT_CC}/mtt_m2cc.sh $(SYS) odeo c cat

$(SYS)_state.c: $(SYS)_state.m
	echo Creating $@
	${MTT_CC}/mtt_m2cc.sh $(SYS) state c cat

$(SYS)_struc.c: $(SYS)_struc.txt
	echo Creating $@
	gawk '\
($$1 == "input")  { printf "         double *%s\t= &(mttu[%d]);\t/* input and output */\n", $$4, $$2-1 }\
($$1 == "state")  { printf "   const double *_%s\t= &(mttx[%d]);\t/* input */\n", $$4, $$2-1 }\
($$1 == "output") { printf "   const double *_%s\t= &(mtty[%d]);\t/* input */\n", $$4, $$2-1 }\
($$1 != "input" && $$1 != "state" && $$1 != "output") { }\
	' $^ > $@

sfun_debug.h:: ${MTT_REP}/sfun_rep/sfun_debug.h
	echo Copying $@
	cp $^ $@

useful-functions.hh:: ${MTT_CC}/include/useful-functions.hh
	echo Copying $@
	cp $^ $@

%::
	mtt -q $(OPTS) `echo $* | sed 's/\(.*\)_\(.*\)\.\(.*\)/\1 \2 \3/'`


|

|

|
|

|

|

|

|

|

|

|

|

|

|

|

|

|


|


|
|
|
|



|

|



|




|


|

|

|

|

|

|

|

|

|

|

|

|

|

















|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#! /usr/bin/make -f

all: $(MTT_SYS)_sfun.mexglx

$(MTT_SYS)_sfun.mexglx: $(MTT_SYS)_sfun.c sfun_debug.h useful-functions.hh $(MTT_SYS)_def.h $(MTT_SYS)_sympar.h $(MTT_SYS)_cr.h $(MTT_SYS)_numpar.c $(MTT_SYS)_ode.c $(MTT_SYS)_odeo.c $(MTT_SYS)_state.c $(MTT_SYS)_sfun_ae.mexglx $(MTT_SYS)_sfun_input.mexglx $(MTT_SYS)_sfun_interface.mexglx $(MTT_SYS).mdl
	echo Creating $@
	mex $(MTT_SYS)_sfun.c
	cp *_sfun*mexglx $(MTT_SYS).mdl ..

$(MTT_SYS)_sfun.c:: ${MTT_REP}/sfun_rep/sfun.c.tmpl
	echo Creating $@
	cat $^ | sed 's/<mtt_model_name>/$(MTT_SYS)/g' > $@

$(MTT_SYS)_sfun_ae.mexglx: $(MTT_SYS)_sfun_ae.c sfun_debug.h useful-functions.hh $(MTT_SYS)_def.h $(MTT_SYS)_sympar.h $(MTT_SYS)_cr.h $(MTT_SYS)_ae.c
	echo Creating $@
	mex $(MTT_SYS)_sfun_ae.c

$(MTT_SYS)_sfun_ae.c:: ${MTT_REP}/sfun_rep/mex_ae.c.tmpl
	echo Creating $@
	cat $^ | sed 's/<mtt_model_name>/$(MTT_SYS)/g' > $@

$(MTT_SYS)_sfun_input.mexglx: $(MTT_SYS)_sfun_input.c sfun_debug.h useful-functions.hh $(MTT_SYS)_def.h $(MTT_SYS)_sympar.h $(MTT_SYS)_cr.h $(MTT_SYS)_input.c $(MTT_SYS)_numpar.c
	echo Creating $@
	mex $(MTT_SYS)_sfun_input.c

$(MTT_SYS)_sfun_input.c:: ${MTT_REP}/sfun_rep/sfun_input.c.tmpl
	echo Creating $@
	cat $^ | sed 's/<mtt_model_name>/$(MTT_SYS)/g' > $@

$(MTT_SYS)_sfun_interface.mexglx: $(MTT_SYS)_sfun_interface.c sfun_debug.h useful-functions.hh $(MTT_SYS)_def.h $(MTT_SYS)_sympar.h $(MTT_SYS)_numpar.c
	echo Creating $@
	mex $(MTT_SYS)_sfun_interface.c

$(MTT_SYS)_sfun_interface.c: ${MTT_REP}/sfun_rep/sfun_interface.c.tmpl $(MTT_SYS)_struc.c
	echo Creating $@
	cat ${MTT_REP}/sfun_rep/sfun_interface.c.tmpl	|\
	 sed 's/<mtt_model_name>/$(MTT_SYS)/g'		|\
	 ${MTT_REP}/sfun_rep/insert_file.sh > $@

$(MTT_SYS)_sfun.zip: $(MTT_SYS)_sfun.c sfun_debug.h useful-functions.hh $(MTT_SYS)_sfun_ae.c $(MTT_SYS)_sfun_input.c $(MTT_SYS)_sfun_interface.c \
	 $(MTT_SYS)_def.h $(MTT_SYS)_sympar.h $(MTT_SYS)_cr.h\
	 $(MTT_SYS)_ae.c $(MTT_SYS)_input.c $(MTT_SYS)_numpar.c $(MTT_SYS)_ode.c $(MTT_SYS)_odeo.c $(MTT_SYS)_state.c \
	 $(MTT_SYS).mdl README
	echo Creating $@
	zip $@ $^

$(MTT_SYS).mdl: ${MTT_REP}/sfun_rep/mdl.tmpl
	echo Creating $@
	cat $^ | sed 's/<mtt_model_name>/$(MTT_SYS)/g' > $@

README:: ${MTT_REP}/sfun_rep/README.tmpl README.CVS
	echo Creating $@
	cat $^ | sed 's/<mtt_model_name>/$(MTT_SYS)/g' > $@
	rm -f README.CVS

README.CVS:
	echo Getting CVS status
	cvs status ../$(MTT_SYS)_abg.fig > $@ 2>1
	date >> $@

$(MTT_SYS)_ae.c: $(MTT_SYS)_ae.m
	echo Creating $@
	${MTT_CC}/mtt_m2cc.sh $(MTT_SYS) ae c cat 

$(MTT_SYS)_input.c: $(MTT_SYS)_input.m
	echo Creating $@
	${MTT_CC}/mtt_m2cc.sh $(MTT_SYS) input c cat 

$(MTT_SYS)_numpar.c: $(MTT_SYS)_numpar.m
	echo Creating $@
	${MTT_CC}/mtt_m2cc.sh $(MTT_SYS) numpar c cat

$(MTT_SYS)_ode.c: $(MTT_SYS)_ode.m
	echo Creating $@
	${MTT_CC}/mtt_m2cc.sh $(MTT_SYS) ode c cat

$(MTT_SYS)_odeo.c: $(MTT_SYS)_odeo.m
	echo Creating $@
	${MTT_CC}/mtt_m2cc.sh $(MTT_SYS) odeo c cat

$(MTT_SYS)_state.c: $(MTT_SYS)_state.m
	echo Creating $@
	${MTT_CC}/mtt_m2cc.sh $(MTT_SYS) state c cat

$(MTT_SYS)_struc.c: $(MTT_SYS)_struc.txt
	echo Creating $@
	gawk '\
($$1 == "input")  { printf "         double *%s\t= &(mttu[%d]);\t/* input and output */\n", $$4, $$2-1 }\
($$1 == "state")  { printf "   const double *_%s\t= &(mttx[%d]);\t/* input */\n", $$4, $$2-1 }\
($$1 == "output") { printf "   const double *_%s\t= &(mtty[%d]);\t/* input */\n", $$4, $$2-1 }\
($$1 != "input" && $$1 != "state" && $$1 != "output") { }\
	' $^ > $@

sfun_debug.h:: ${MTT_REP}/sfun_rep/sfun_debug.h
	echo Copying $@
	cp $^ $@

useful-functions.hh:: ${MTT_CC}/include/useful-functions.hh
	echo Copying $@
	cp $^ $@

%::
	mtt -q $(MTT_OPTS) `echo $* | sed 's/\(.*\)_\(.*\)\.\(.*\)/\1 \2 \3/'`


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