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

cd ../..
if [ ! -f libnomointerpreter.so ]
then
    bash build.sh
fi
cd $(dirname $0)
cp ../HelloWorld.seed ./

echo Compilation Ada

rm *.o
rm *.ali
rm test

export PATH=/usr/gnat/bin:$PATH
export LIBRARY_PATH=/usr/lib/i386-linux-gnu:$LIBRARY_PATH
export LIBRARY_PATH=../..:$LIBRARY_PATH

gnatmake test.adb -o test -cargs -O2

echo Compilations ok
echo Press any key to continue
read

export LD_LIBRARY_PATH=../..:$LD_LIBRARY_PATH
./test

echo Press any key to exit
read

exit 0
