Overview
Comment:Added path checking code -- mtt_check_vars
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: fb8c567bf533924e2d0d204d92329271f5952697e710b776b6bac026c97fab43
User & Date: gawthrop@users.sourceforge.net on 1997-07-27 13:11:11
Other Links: branch diff | manifest | tags
Context
1997-07-27
13:12:03
Initial revision check-in: 54a96339ac user: gawthrop@users.sourceforge.net tags: origin/master, trunk
13:11:11
Added path checking code -- mtt_check_vars check-in: fb8c567bf5 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
1997-07-06
16:35:20
Initial revision check-in: 5bb47c8759 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes

Modified mttroot/mtt/bin/mtt from [31b59df962] to [fe4073fa0a].

10
11
12
13
14
15
16



17
18
19
20
21
22
23
# Copyright (c) P.J.Gawthrop, 1989, 1990, 1991, 1993, 1994, 1995, 1996.

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



## Revision 1.85  1997/06/27 12:14:49  peterg
## Upped version to 2.4++
##
# Revision 1.84  1997/06/13  14:08:23  peterg
# Changed default rep.txt
#
# Revision 1.83  1997/06/13  09:18:28  peterg







>
>
>







10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# Copyright (c) P.J.Gawthrop, 1989, 1990, 1991, 1993, 1994, 1995, 1996.

###############################################################
## Version control history
###############################################################
## $Header$
## $Log$
# Revision 1.86  1997/06/29  19:05:51  peterg
# Seascale changes -- mainly to new rep format.
#
## Revision 1.85  1997/06/27 12:14:49  peterg
## Upped version to 2.4++
##
# Revision 1.84  1997/06/13  14:08:23  peterg
# Changed default rep.txt
#
# Revision 1.83  1997/06/13  09:18:28  peterg
295
296
297
298
299
300
301



302
303
304
305
306
307
308
## Put in fig.fig target.
##
## Revision 1.1  1996/08/04 17:29:42  peter
## Initial revision
##
###############################################################




# MTT recursion level is zero unless explicitly set
level=0

#Computation mode is octave by default
computation=octave

#By default, the dae and ode representations are different







>
>
>







298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
## Put in fig.fig target.
##
## Revision 1.1  1996/08/04 17:29:42  peter
## Initial revision
##
###############################################################

#Check $MTTPATH has bee set
mtt_check_var "$MTTPATH" "MTTPATH"

# MTT recursion level is zero unless explicitly set
level=0

#Computation mode is octave by default
computation=octave

#By default, the dae and ode representations are different
373
374
375
376
377
378
379

380
381
382
383
384

385
386
387
388
389
390
391
if [ "$1" = "help" ]; then
  mtt_help $2 $3
  exit
fi

if [ "$1" = "hinfo" ] && [$2 = ""]; then
   echo Invoking $HTMLVIEW

   (cd $MTTPATH/doc; $HTMLVIEW ./mtt_toc.html)&
   exit
fi

if [ "$1" = "manual" ] && [$2 = ""]; then

  echo Invoking $DVIVIEW
  $DVIVIEW  $MTTPATH/doc/mtt.dvi &
  exit
fi

if [ "$1" = "warranty" ] && [$2 = ""]; then
  cat << EOF







>





>







379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
if [ "$1" = "help" ]; then
  mtt_help $2 $3
  exit
fi

if [ "$1" = "hinfo" ] && [$2 = ""]; then
   echo Invoking $HTMLVIEW
   mtt_check_var "$HTMLVIEW" HTMLVIEW
   (cd $MTTPATH/doc; $HTMLVIEW ./mtt_toc.html)&
   exit
fi

if [ "$1" = "manual" ] && [$2 = ""]; then
  mtt_check_var "$DVIVIEW" DVIVIEW
  echo Invoking $DVIVIEW
  $DVIVIEW  $MTTPATH/doc/mtt.dvi &
  exit
fi

if [ "$1" = "warranty" ] && [$2 = ""]; then
  cat << EOF
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434

435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457

458
459
460
461
462
463
464
465

466
467
468
469
470
471
472

# Clean up 
if [ "$1" = "clean" ] && [ "$2" = "" ]; then
  echo 'Removing all generated files for all systems'
  rm -f *.log  mtt_info.txt warning.txt
  rm -f *_abg.m *_abg.ps *_args.* *_cr.r *_cr.txt *_abg.tex
  rm -f *_sabg.fig *_sabg.ps *_head.fig *_bnd.fig 
  rm -f *_sympar.r *_sympar.c *_sympar.h *_sympar.txt
  rm -f *_rbg.* *_cmp.* *_fig.fig *_*cbg.* *_ese.* *_def.* 
  rm -f *_sub.* *_type.sh
  rm -f *_dae*.* *_cse.* *_ode.*
  rm -f *_obs.* *_rfe.* *_ss.*
  rm -f *_dm.* *_csm.* *_sm.* *_tf.* *_sr*.* *_ir*.* *_*fr.*
  rm -f  *_numpar.m *_numpar.c *_input.m *_input.c *_switch.c *_switch.txt
  rm -f *_sm*.*
  rm -f *_struc.* 
  rm -f *_odes.c *_odes.dat *_odes.gdat *_odes.m *_odes.ps
  rm -f *_odeso.dat *_odeso.gdat *_odeso.m *_odeso.ps
  rm -f *_*.doc *_*.idx *_*.ind *_*.ilg *_*.dvi *_*.aux *_*.lof *_*.toc
  rm -f *_rep.tex
  rm -f  *_unique_raw_list *_raw_list
  rm -f mtt_error.txt mtt_info.txt a.out 

  exit
fi

# Clean up named system
if [ "$2" = "clean" ] && [ "$3" = "" ]; then
  echo 'Removing all generated files for system ' $1
  rm -f *.log  mtt_info.txt warning.txt
  rm -f $1_abg.m $1_abg.ps $1_args.* $1_cr.r $1_cr.txt $1_abg.tex
  rm -f $1_sabg.fig $1_sabg.ps $1_head.fig $1_bnd.fig 
  rm -f $1_sympar.r $1_sympar.c $1_sympar.h $1_sympar.txt
  rm -f $1_rbg.* $1_cmp.* $1_fig.fig $1*_*cbg.* $1*_ese.* $1_def.* 
  rm -f $1_sub.* $1_type.sh
  rm -f $1_dae*.* $1_cse.* $1_ode.*  $1_obs.* $1_rfe.* $1_ss.*
  rm -f $1_dm.* $1_csm.* $1_sm.* $1_tf.* $1_sr*.* $1_ir*.* $1_*fr.*
  rm -f  $1_numpar.m $1_numpar.c $1_input.m $1_input.c $1_switch.c $1_switch.txt
  rm -f $1_sm*.*
  rm -f $1_struc.*
  rm -f $1_odes.c $1_odes.dat $1_odes.gdat $1_odes.m $1_odes.ps
  rm -f $1_odeso.dat $1_odeso.gdat $1_odeso.m $1_odeso.ps
  rm -f $1_*.doc $1_*.idx $1_*.ind $1_*.ilg $1_*.dvi $1_*.aux $1_*.lof $1_*.toc
  rm -f $1_rep.tex
  rm -f $1_unique_raw_list $1_raw_list
  rm -f mtt_error.txt mtt_info.txt a.out 

  exit
fi

#SUMMARY abg	acausal bond graph (fig)
#SUMMARY abg	acausal bond graph (ps)
#SUMMARY abg	acausal bond graph (view)
# Invoke explicit requests for modification
if [ "$2" = "abg" ] && [ "$3" = "fig" ]; then

  echo Editing $1_$2.$3
  ($FIG $1_$2.$3; cp $1_abg.fig $1_$1_abg.fig) &
  exit
fi

# Copy systems from the library
if [ "$1" = "copy" ]; then







|







|






>









|






|






>








>







421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483

# Clean up 
if [ "$1" = "clean" ] && [ "$2" = "" ]; then
  echo 'Removing all generated files for all systems'
  rm -f *.log  mtt_info.txt warning.txt
  rm -f *_abg.m *_abg.ps *_args.* *_cr.r *_cr.txt *_abg.tex
  rm -f *_sabg.fig *_sabg.ps *_head.fig *_bnd.fig 
  rm -f *_sympar.r *_sympar.c *_sympar.h *_sympar.txt?
  rm -f *_rbg.* *_cmp.* *_fig.fig *_*cbg.* *_ese.* *_def.* 
  rm -f *_sub.* *_type.sh
  rm -f *_dae*.* *_cse.* *_ode.*
  rm -f *_obs.* *_rfe.* *_ss.*
  rm -f *_dm.* *_csm.* *_sm.* *_tf.* *_sr*.* *_ir*.* *_*fr.*
  rm -f  *_numpar.m *_numpar.c *_input.m *_input.c *_switch.c *_switch.txt
  rm -f *_sm*.*
  rm -f *_struc.* *_sympar.txt *_sympar.c *_sympar.h *_sympar.m
  rm -f *_odes.c *_odes.dat *_odes.gdat *_odes.m *_odes.ps
  rm -f *_odeso.dat *_odeso.gdat *_odeso.m *_odeso.ps
  rm -f *_*.doc *_*.idx *_*.ind *_*.ilg *_*.dvi *_*.aux *_*.lof *_*.toc
  rm -f *_rep.tex
  rm -f  *_unique_raw_list *_raw_list
  rm -f mtt_error.txt mtt_info.txt a.out 
  rm -fR *_rep
  exit
fi

# Clean up named system
if [ "$2" = "clean" ] && [ "$3" = "" ]; then
  echo 'Removing all generated files for system ' $1
  rm -f *.log  mtt_info.txt warning.txt
  rm -f $1_abg.m $1_abg.ps $1_args.* $1_cr.r $1_cr.txt $1_abg.tex
  rm -f $1_sabg.fig $1_sabg.ps $1_head.fig $1_bnd.fig 
  rm -f $1_sympar.r $1_sympar.c $1_sympar.h $1_sympar.txt?
  rm -f $1_rbg.* $1_cmp.* $1_fig.fig $1*_*cbg.* $1*_ese.* $1_def.* 
  rm -f $1_sub.* $1_type.sh
  rm -f $1_dae*.* $1_cse.* $1_ode.*  $1_obs.* $1_rfe.* $1_ss.*
  rm -f $1_dm.* $1_csm.* $1_sm.* $1_tf.* $1_sr*.* $1_ir*.* $1_*fr.*
  rm -f  $1_numpar.m $1_numpar.c $1_input.m $1_input.c $1_switch.c $1_switch.txt
  rm -f $1_sm*.*
  rm -f $1_struc.* $1_sympar.txt $1_sympar.c $1_sympar.h $1_sympar.m
  rm -f $1_odes.c $1_odes.dat $1_odes.gdat $1_odes.m $1_odes.ps
  rm -f $1_odeso.dat $1_odeso.gdat $1_odeso.m $1_odeso.ps
  rm -f $1_*.doc $1_*.idx $1_*.ind $1_*.ilg $1_*.dvi $1_*.aux $1_*.lof $1_*.toc
  rm -f $1_rep.tex
  rm -f $1_unique_raw_list $1_raw_list
  rm -f mtt_error.txt mtt_info.txt a.out 
  rm -fR $1_rep
  exit
fi

#SUMMARY abg	acausal bond graph (fig)
#SUMMARY abg	acausal bond graph (ps)
#SUMMARY abg	acausal bond graph (view)
# Invoke explicit requests for modification
if [ "$2" = "abg" ] && [ "$3" = "fig" ]; then
  mtt_check_var "$FIG" FIG
  echo Editing $1_$2.$3
  ($FIG $1_$2.$3; cp $1_abg.fig $1_$1_abg.fig) &
  exit
fi

# Copy systems from the library
if [ "$1" = "copy" ]; then
593
594
595
596
597
598
599


600
601
602
603
604
605
606
607
608
609
		VCext='r' ;;
	*)
		echo Version control is not appropriate for representation $2
		exit  ;;
  esac
fi




# This is the main mtt programme
gmake -s  -f -  $1_$2.$3 << EOF

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

# If level>0, try and get subsystem files
ifneq ("$level","0")
$1_abg.fig:







>
>


|







604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
		VCext='r' ;;
	*)
		echo Version control is not appropriate for representation $2
		exit  ;;
  esac
fi

#Check the principle paths
mtt_check_vars

# This is the main mtt programme
$MAKE -s  -f -  $1_$2.$3 << EOF

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

# If level>0, try and get subsystem files
ifneq ("$level","0")
$1_abg.fig:
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
ifeq ($computation,octave)
$1_odes.m: $1_ode.m $1_numpar.m $1_args.m $1_def.m $1_input.m
	ode2odes_m $1 '$ARGS'
endif
ifeq ($computation,c)
$1_odes.m: $1_odes.c $1_ode.c $1_numpar.c $1_odes.h\
         $1_sympar.c $1_sympar.h\
         $1_numpar.c $1_input.c
	echo Creating $1_odes.m
	echo Creating $1_odeso.m
	echo 'Compiling ...'
	gcc $1_odes.c  -lm
	echo 'Running  ...'; time ./a.out; echo 'Done.'









|







1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
ifeq ($computation,octave)
$1_odes.m: $1_ode.m $1_numpar.m $1_args.m $1_def.m $1_input.m
	ode2odes_m $1 '$ARGS'
endif
ifeq ($computation,c)
$1_odes.m: $1_odes.c $1_ode.c $1_numpar.c $1_odes.h\
         $1_sympar.c $1_sympar.h\
         $1_numpar.c $1_input.c sign.c
	echo Creating $1_odes.m
	echo Creating $1_odeso.m
	echo 'Compiling ...'
	gcc $1_odes.c  -lm
	echo 'Running  ...'; time ./a.out; echo 'Done.'


1283
1284
1285
1286
1287
1288
1289
1290

1291
	echo Copying dsvdcmp.c; cp $MTTPATH/trans/c/dsvdcmp.c .
dpythag.c: 
	echo Copying dpythag.c; cp $MTTPATH/trans/c/dpythag.c .
nrutil.c: 
	echo Copying nrutil.c; cp $MTTPATH/trans/c/nrutil.c .
nrutil.h: 
	echo Copying nrutil.h; cp $MTTPATH/trans/c/nrutil.h .


EOF







|
>

1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
	echo Copying dsvdcmp.c; cp $MTTPATH/trans/c/dsvdcmp.c .
dpythag.c: 
	echo Copying dpythag.c; cp $MTTPATH/trans/c/dpythag.c .
nrutil.c: 
	echo Copying nrutil.c; cp $MTTPATH/trans/c/nrutil.c .
nrutil.h: 
	echo Copying nrutil.h; cp $MTTPATH/trans/c/nrutil.h .
sign.c:
	echo Copying sign.c; cp $MTTPATH/trans/c/sign.c .
EOF


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