#! /bin/sh
######################################
##### Model Transformation Tools #####
######################################
# Bourne shell script: simpar_txt2h
# Numerical parameters to c format
# P.J.Gawthrop May 1997
# Copyright (c) P.J.Gawthrop, 1997.
###############################################################
## Version control history
###############################################################
## $Id$
## $Log$
## Revision 1.1 1998/05/13 08:56:28 peterg
## Initial revision
##
###############################################################
system=$1
# Inform user
echo "Creating $1_simpar.h"
rm -f mtt_error
#Write some file headers
echo '/*' > $1_simpar.h
echo "Simulation parameter file for system $1 ($1_simpar.h)" >> $1_simpar.h
echo "This file provides the system simulation parameters in c form" >> $1_simpar.h
echo "Generated by MTT at `date`" >> $1_simpar.h
echo "from $1_simpar.txt" >> $1_simpar.h
echo '*/' >> $1_simpar.h
echo >> $1_simpar.h
# Now do the parameters
sed 's/ //g' $1_simpar.txt |\
gawk -F '=' '/=/ {print "#define", $1, $2}' >> $1_simpar.h