Index: mttroot/mtt/bin/mtt ================================================================== --- mttroot/mtt/bin/mtt +++ mttroot/mtt/bin/mtt @@ -15,10 +15,13 @@ ############################################################### ## 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. @@ -2207,13 +2210,13 @@ #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" + 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 "SYS=$1" "LANG=$3" "ARG=$4" "OPTS=$mtt_switches" + 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 Index: mttroot/mtt/lib/rep/cxxsim_rep.make ================================================================== --- mttroot/mtt/lib/rep/cxxsim_rep.make +++ mttroot/mtt/lib/rep/cxxsim_rep.make @@ -18,48 +18,48 @@ INCLUDE=-I. -I${MTT_LIB}/cr/hh OPTIMISE=-O0 WARNINGS=-Wall -ansi -pedantic -all: $(SYS)_cxxsim.$(LANG) +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) -$(SYS)_cxxsim.view: $(SYS)_gnuplot.wish $(SYS)_cxxsim.exe - ./$(SYS)_cxxsim.exe > $(SYS)_odes.dat2 - sh $(SYS)_gnuplot.wish |\ +$(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 & -$(SYS)_cxxsim.exe: $(SYS)_cxxsim.cc - echo Creating $(SYS)_cxxsim.exe +$(MTT_SYS)_cxxsim.exe: $(MTT_SYS)_cxxsim.cc + echo Creating $(MTT_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) +$(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 -$(SYS)_cr.txt: - mtt -q $(OPTS) $(SYS) cr txt +$(MTT_SYS)_cr.txt: + mtt -q $(MTT_OPTS) $(MTT_SYS) cr txt # elementary system equations -$(SYS)_ese.r: - mtt -q $(OPTS) $(SYS) ese r +$(MTT_SYS)_ese.r: + mtt -q $(MTT_OPTS) $(MTT_SYS) ese r # system structure -$(SYS)_struc.txt: - mtt -q $(OPTS) $(SYS) struc txt +$(MTT_SYS)_struc.txt: + mtt -q $(MTT_OPTS) $(MTT_SYS) struc txt # list of symbolic parameters -$(SYS)_sympar.txt: - mtt -q $(OPTS) $(SYS) sympar txt +$(MTT_SYS)_sympar.txt: + mtt -q $(MTT_OPTS) $(MTT_SYS) sympar txt # gnuplot script -$(SYS)_gnuplot.wish: - mtt -q $(OPTS) $(SYS) gnuplot wish +$(MTT_SYS)_gnuplot.wish: + mtt -q $(MTT_OPTS) $(MTT_SYS) gnuplot wish Index: mttroot/mtt/lib/rep/gnuplot_rep.make ================================================================== --- mttroot/mtt/lib/rep/gnuplot_rep.make +++ mttroot/mtt/lib/rep/gnuplot_rep.make @@ -1,21 +1,21 @@ # -*-makefile-*- # create a gnuplot input file -MTTFLAGS = $(OPTS) +MTTFLAGS = $(MTT_OPTS) -all: $(SYS)_gnuplot.$(LANG) +all: $(MTT_SYS)_gnuplot.$(MTT_LANG) -$(SYS)_gnuplot.view: $(SYS)_gnuplot.wish - mtt $(OPTS) $(SYS) odes dat2 - sh $(SYS)_gnuplot.wish |\ +$(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 & -$(SYS)_gnuplot.wish: $(SYS)_struc.txt - $(MTTPATH)/trans/struc2gnuplot_txt2wish $(SYS) +$(MTT_SYS)_gnuplot.wish: $(MTT_SYS)_struc.txt + $(MTTPATH)/trans/struc2gnuplot_txt2wish $(MTT_SYS) -$(SYS)_struc.txt: - mtt $(MTTFLAGS) $(SYS) struc txt +$(MTT_SYS)_struc.txt: + mtt $(MTTFLAGS) $(MTT_SYS) struc txt Index: mttroot/mtt/lib/rep/ident_rep.make ================================================================== --- mttroot/mtt/lib/rep/ident_rep.make +++ mttroot/mtt/lib/rep/ident_rep.make @@ -8,130 +8,130 @@ # 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 +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 = ${SYS}_abg.fig ${SYS}_lbl.txt -model_pre += ${SYS}_rdae.r ${SYS}_numpar.txt +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 = ${SYS}_sim.m s${SYS}_ssim.m +sims = ${MTT_SYS}_sim.m s${MTT_SYS}_ssim.m ## m-files needed for ident -ident_m = ${SYS}_ident.m ${SYS}_ident_numpar.m +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 = ${SYS}_ident.ps ${SYS}_ident.comparison.ps +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 = ${SYS}_ident_par.tex +latexfiles = ${MTT_SYS}_ident_par.tex -all: ${SYS}_ident.${LANG} +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}" -${SYS}_ident.view: ${psfiles} - ident_rep.sh ${SYS} view +${MTT_SYS}_ident.view: ${psfiles} + ident_rep.sh ${MTT_SYS} view ${psfiles}: ${figfiles} - ident_rep.sh ${SYS} ps + ident_rep.sh ${MTT_SYS} ps ${figfiles}: ${gdatfiles} - ident_rep.sh ${SYS} fig + ident_rep.sh ${MTT_SYS} fig ${gdatfiles}: ${datfiles} - ident_rep.sh ${SYS} gdat + ident_rep.sh ${MTT_SYS} gdat ${datfiles} ${latexfiles}: ${ident_reps} - ident_rep.sh ${SYS} dat2 + ident_rep.sh ${MTT_SYS} dat2 -${SYS}_ident.m: - ident_rep.sh ${SYS} m +${MTT_SYS}_ident.m: + ident_rep.sh ${MTT_SYS} m -${SYS}_ident_numpar.m: - ident_rep.sh ${SYS} numpar.m +${MTT_SYS}_ident_numpar.m: + ident_rep.sh ${MTT_SYS} numpar.m ## System model reps ## Generic txt files -${SYS}_%.txt: - mtt ${OPTS} -q -stdin ${SYS} $* txt +${MTT_SYS}_%.txt: + mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} $* txt ## Specific m files -${SYS}_ode2odes.m: ${model_pre} - mtt -q -stdin ${OPTS} ${SYS} ode2odes m +${MTT_SYS}_ode2odes.m: ${model_pre} + mtt -q -stdin ${MTT_OPTS} ${MTT_SYS} ode2odes m -${SYS}_sim.m: ${SYS}_ode2odes.m - mtt ${OPTS} -q -stdin ${SYS} sim m +${MTT_SYS}_sim.m: ${MTT_SYS}_ode2odes.m + mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} sim m ## Numpar files -${SYS}_numpar.m: - mtt ${SYS} numpar m +${MTT_SYS}_numpar.m: + mtt ${MTT_SYS} numpar m ## Sympar files -${SYS}_sympar.m: - mtt ${SYS} sympar m +${MTT_SYS}_sympar.m: + mtt ${MTT_SYS} sympar m ## Generic txt to m -${SYS}_%.m: ${SYS}_%.txt - mtt ${OPTS} -q -stdin ${SYS} $* m +${MTT_SYS}_%.m: ${MTT_SYS}_%.txt + mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} $* m ## r files -${SYS}_def.r: ${SYS}_abg.fig - mtt ${OPTS} -q -stdin ${SYS} def r +${MTT_SYS}_def.r: ${MTT_SYS}_abg.fig + mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} def r -${SYS}_rdae.r: - mtt ${OPTS} -q -stdin ${SYS} rdae r +${MTT_SYS}_rdae.r: + mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} rdae r ## Sensitivity model reps ## Generic txt files -s${SYS}_%.txt: - mtt ${OPTS} -q -stdin -s s${SYS} $* txt +s${MTT_SYS}_%.txt: + mtt ${MTT_OPTS} -q -stdin -s s${MTT_SYS} $* txt ## Specific m files ## Numpar files -s${SYS}_numpar.m: - mtt -s s${SYS} numpar m +s${MTT_SYS}_numpar.m: + mtt -s s${MTT_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 +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${SYS}_%.m: s${SYS}_%.txt - mtt ${OPTS} -q -stdin s${SYS} $* m +s${MTT_SYS}_%.m: s${MTT_SYS}_%.txt + mtt ${MTT_OPTS} -q -stdin s${MTT_SYS} $* m ## r files -s${SYS}_rdae.r: - mtt ${OPTS} -q -stdin -s s${SYS} rdae r +s${MTT_SYS}_rdae.r: + mtt ${MTT_OPTS} -q -stdin -s s${MTT_SYS} rdae r Index: mttroot/mtt/lib/rep/ippp_rep.make ================================================================== --- mttroot/mtt/lib/rep/ippp_rep.make +++ mttroot/mtt/lib/rep/ippp_rep.make @@ -9,10 +9,13 @@ ############################################################### ## 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. @@ -22,50 +25,50 @@ ## ############################################################### #Copyright (C) 2000 by Peter J. Gawthrop -all: $(SYS)_ippp.$(LANG) +all: $(MTT_SYS)_ippp.$(MTT_LANG) -$(SYS)_ippp.view: $(SYS)_ippp.pdf +$(MTT_SYS)_ippp.view: $(MTT_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 +$(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 Index: mttroot/mtt/lib/rep/nppp_rep.make ================================================================== --- mttroot/mtt/lib/rep/nppp_rep.make +++ mttroot/mtt/lib/rep/nppp_rep.make @@ -7,100 +7,100 @@ # 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 +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 = ${SYS}_sim.m s${SYS}_ssim.m +sims = ${MTT_SYS}_sim.m s${MTT_SYS}_ssim.m ## m-files needed for nppp -nppp_m = ${SYS}_nppp.m ${SYS}_nppp_numpar.m +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 = ${SYS}_nppp.ps ${SYS}_nppp.basis.ps ${SYS}_nppp.par.ps ${SYS}_nppp.U.ps +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: ${SYS}_nppp.${LANG} +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}" -${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 +${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 -${SYS}_%.txt: - mtt ${OPTS} -q -stdin ${SYS} $* txt +${MTT_SYS}_%.txt: + mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} $* txt ## Specific m files -${SYS}_ode2odes.m: ${SYS}_rdae.r - mtt -q -stdin ${OPTS} ${SYS} ode2odes m +${MTT_SYS}_ode2odes.m: ${MTT_SYS}_rdae.r + mtt -q -stdin ${MTT_OPTS} ${MTT_SYS} ode2odes m -${SYS}_sim.m: ${SYS}_ode2odes.m - mtt ${OPTS} -q -stdin ${SYS} sim m +${MTT_SYS}_sim.m: ${MTT_SYS}_ode2odes.m + mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} sim m ## Generic txt to m -${SYS}_%.m: ${SYS}_%.txt - mtt ${OPTS} -q -stdin ${SYS} $* m +${MTT_SYS}_%.m: ${MTT_SYS}_%.txt + mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} $* m ## r files -${SYS}_def.r: ${SYS}_abg.fig - mtt ${OPTS} -q -stdin ${SYS} def r +${MTT_SYS}_def.r: ${MTT_SYS}_abg.fig + mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} def r -${SYS}_rdae.r: - mtt ${OPTS} -q -stdin ${SYS} rdae r +${MTT_SYS}_rdae.r: + mtt ${MTT_OPTS} -q -stdin ${MTT_SYS} rdae r ## Sensitivity model reps ## Generic txt files -s${SYS}_%.txt: - mtt ${OPTS} -q -stdin s${SYS} $* txt +s${MTT_SYS}_%.txt: + mtt ${MTT_OPTS} -q -stdin s${MTT_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 +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${SYS}_%.m: s${SYS}_%.txt - mtt ${OPTS} -q -stdin s${SYS} $* m +s${MTT_SYS}_%.m: s${MTT_SYS}_%.txt + mtt ${MTT_OPTS} -q -stdin s${MTT_SYS} $* m ## r files -s${SYS}_rdae.r: - mtt ${OPTS} -q -stdin -s s${SYS} rdae r +s${MTT_SYS}_rdae.r: + mtt ${MTT_OPTS} -q -stdin -s s${MTT_SYS} rdae r Index: mttroot/mtt/lib/rep/sfun_rep.make ================================================================== --- mttroot/mtt/lib/rep/sfun_rep.make +++ mttroot/mtt/lib/rep/sfun_rep.make @@ -1,6 +1,4 @@ # -*-makefile-*- -REP ?= "sfun" - all: - ${MTT_REP}/sfun_rep.sh "$(OPTS)" "$(SYS)" "$(REP)" "$(LANG)" + ${MTT_REP}/sfun_rep.sh "$(MTT_OPTS)" "$(MTT_SYS)" "$(MTT_LANG)" Index: mttroot/mtt/lib/rep/sfun_rep.sh ================================================================== --- mttroot/mtt/lib/rep/sfun_rep.sh +++ mttroot/mtt/lib/rep/sfun_rep.sh @@ -1377,7 +1377,7 @@ ### 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} +MTT_OPTS="$1" MTT_SYS="$2" MTT_LANG="$3" make $make_debug -f ${MTT_REP}/sfun_rep/Makefile ${2}_sfun.${3} exit 0 Index: mttroot/mtt/lib/rep/sfun_rep/Makefile ================================================================== --- mttroot/mtt/lib/rep/sfun_rep/Makefile +++ mttroot/mtt/lib/rep/sfun_rep/Makefile @@ -1,90 +1,90 @@ #! /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//$(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//$(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//$(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 +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_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_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_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//$(SYS)/g' |\ + sed 's//$(MTT_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 +$(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 $@ $^ -$(SYS).mdl: ${MTT_REP}/sfun_rep/mdl.tmpl +$(MTT_SYS).mdl: ${MTT_REP}/sfun_rep/mdl.tmpl echo Creating $@ - cat $^ | sed 's//$(SYS)/g' > $@ + cat $^ | sed 's//$(MTT_SYS)/g' > $@ README:: ${MTT_REP}/sfun_rep/README.tmpl README.CVS echo Creating $@ - cat $^ | sed 's//$(SYS)/g' > $@ + cat $^ | sed 's//$(MTT_SYS)/g' > $@ rm -f README.CVS README.CVS: echo Getting CVS status - cvs status ../$(SYS)_abg.fig > $@ 2>1 + cvs status ../$(MTT_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 +$(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 }\ @@ -98,6 +98,6 @@ useful-functions.hh:: ${MTT_CC}/include/useful-functions.hh echo Copying $@ cp $^ $@ %:: - mtt -q $(OPTS) `echo $* | sed 's/\(.*\)_\(.*\)\.\(.*\)/\1 \2 \3/'` + mtt -q $(MTT_OPTS) `echo $* | sed 's/\(.*\)_\(.*\)\.\(.*\)/\1 \2 \3/'`