1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#! /usr/bin/make -f
all: $(SYS)_sfun.mexglx
$(SYS)_sfun.mexglx: $(SYS)_sfun.c sfun_debug.h $(SYS)_def.h $(SYS)_sympar.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 $(SYS)_def.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' > $@
|
|
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
#! /usr/bin/make -f
all: $(SYS)_sfun.mexglx
$(SYS)_sfun.mexglx: $(SYS)_sfun.c sfun_debug.h $(SYS)_def.h $(SYS)_sympar.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 $(SYS)_def.h $(SYS)_sympar.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' > $@
|
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
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 $^ $@
%::
mtt -q $(OPTS) `echo $* | sed 's/\(.*\)_\(.*\)\.\(.*\)/\1 \2 \3/'`
|
|
|
|
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
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 $^ $@
%::
mtt -q $(OPTS) `echo $* | sed 's/\(.*\)_\(.*\)\.\(.*\)/\1 \2 \3/'`
|