#!/bin/sh 

confin=$1
cd ../
ETAROOT=`pwd`
cd ../
HOME=`pwd`
#rm -R -f  $ETAROOT/$confin
#mkdir -p $ETAROOT/$confin/exe
#cp -R $ETAROOT/scripts $ETAROOT/$confin/scripts
#cp -R $ETAROOT/ucl $ETAROOT/$confin/ucl
#cp -R $ETAROOT/posfig $ETAROOT/$confin/posfig
#cp -R $ETAROOT/grb $ETAROOT/$confin/grb
cd $ETAROOT/install

cat Makefile.in | sed s:etaroot:$ETAROOT: > Makefile

cd $ETAROOT/install

./set_parmeta_$confin $confin
rm -f $ETAROOT/exe/*.x $ETAROOT/exe/*.exe
rm -f $ETAROOT/lib/*.a
rm -f $ETAROOT/src/model_with_kf/*.o $ETAROOT/src/model_with_kf/*.f
rm -f $ETAROOT/src/etafcst_all/*.o 
rm -f $ETAROOT/src/etafcst_CC/*.o

rm -f $ETAROOT/src/post/quilt/*.o
rm -f $ETAROOT/src/post/post_new/*.o
rm -f $ETAROOT/src/post/copygb/*.o
rm -f $ETAROOT/src/post/post0/*.o
rm -f $ETAROOT/src/post/sndp/*.o

exit 0
