#! /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$
###############################################################
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 |\
awk -F '=' '/=/ {print "#define", $1, $2}' >> $1_simpar.h