#!/bin/bash
cd $(dirname $0)

rm -f nomotime.exe
rm -f libnomointerpreter.so
cd ../nomointerpreter
if [ ! -f libnomointerpreter.so ]
then
    bash build.sh
fi
cp libnomointerpreter.so ../nomotime
cp libnomointerpreter.so ../../src/nomotime
cd ../../src/nomotime

echo Build executable nomotime

gnatmake -Pnomotime.gpr 

rm -f b~nomotime.ads
rm -f b~nomotime.adb
rm -f *.o
rm -f *.ali
mv nomotime ../../build/nomotime/nomoTime
cd $(dirname $0)
exit 0