#!/bin/sh
#
# $Id$
#
# Copyright 1989-2016 MINES ParisTech
#
# This file is part of PIPS.
#
# PIPS is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# any later version.
#
# PIPS is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.
#
# See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with PIPS. If not, see .
#
# Formattage sous latex de certaines des informations conservees
# optionnellement lors du calcul des regions
# Be'atrice Creusillet, Fe'vrier 1997
workspace=$1
prefix=$2
global=tmp$$
#echo $workspace
#echo $prefix
#dir=$PIPS_ROOT/Utils
dir=$PIPS_DEVEDIR/Scripts/stats
awk=/usr5/gnu/SPARC/bin/gawk
if [ ! -d $workspace.database ]
then
echo Workspace $workspace does not exist!
exit
fi
>$global.$prefix
for source in $workspace.database/*.f
do
module=`basename $source .f`
module=`echo $module | tr a-z A-Z`
#echo module=$module
stats=$workspace.database/$module.$prefix\_inter_trans_stat
#echo stats="$stats"
if [ -f $stats ]
then
#echo $0: including statistics for module $module
cat $stats >>$global.$prefix
else
echo $0: missing statistics for module $module
echo "$module 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0">>$global.$prefix
fi
done
cat >$workspace-$prefix.tex <>$workspace-$prefix.tex
cat >>$workspace-$prefix.tex <>$workspace-$prefix.tex
cat >>$workspace-$prefix.tex <>$workspace-$prefix.tex
cat >>$workspace-$prefix.tex <>$workspace-$prefix.tex
cat >>$workspace-$prefix.tex <>$workspace-$prefix.tex
cat >>$workspace-$prefix.tex <>$workspace-$prefix.tex
cat >>$workspace-$prefix.tex <>$workspace-$prefix.tex
cat >>$workspace-$prefix.tex <>$workspace-$prefix.tex
cat >>$workspace-$prefix.tex <>$workspace-$prefix.tex
cat >>$workspace-$prefix.tex <>$workspace-$prefix.tex
cat >>$workspace-$prefix.tex <>$workspace-$prefix.tex <