#! /bin/sh

if [ ! -d compile.$SYS ]; then
mkdir compile.$SYS
fi

if [ `hostname` = "bonang" ];then
CC=/usr/local/bin/gcc
export CC
fi



INSTALL="`pwd`/install-sh -c"
export INSTALL 

cd compile.$SYS
if [ `pwd` == "$HOME" ];then
echo error will not delete home
exit
fi
rm -rf *
../configure --prefix=/u/formes/share --bindir=/u/formes/share/bin/$SYS --libdir=/u/formes/share/lib/$SYS  --cache-file=config.cache.$SYS 

make 
make test
if [ $? != "0" ]; then
    exit 1
fi 

make install

make clean
rm -f config.cache.$SYS
../configure --prefix=/u/formes/share --bindir=/u/formes/share/bin/$SYS --libdir=/u/formes/share/lib/$SYS  --cache-file=config.cache.$SYS --enable-debug
make 
make test
if [ $? != "0" ]; then
    exit 1
fi 

make install
make clean
