#!/bin/sh

TAXSOLVEDIR=${PWD}/`dirname $0`

if [ ! -d ${TAXSOLVEDIR}/bin ] ; then
   mkdir ${TAXSOLVEDIR}/bin
fi

cd ${TAXSOLVEDIR}/src/GUI/
if [ !  -d  otk_lib ] ; then
   echo ""
   echo "Can't build GUI: src/GUI/otk_lib/ not found." 
   echo "" 
   echo "To build the GUI, get the latest otk_lib from:" 
   echo "  http://sourceforge.net/projects/otk/"; 
   echo "then open it in: src/GUI/" 
   echo "" 
   echo "Proceeding without building GUI ..." 
   echo "echo 'GUI did not compile.'" > ${TAXSOLVEDIR}/bin/ots_gui
   echo "echo 'You can run programs from the bin directory in text mode.'" >> ${TAXSOLVEDIR}/bin/ots_gui
   chmod 755 ${TAXSOLVEDIR}/bin/ots_gui
   sleep 5 
else 
   make -f Makefile.linux 
fi 

cd  ${TAXSOLVEDIR}/src
make -f Makefile.unix

