#!/bin/bash
# build script to compile an ADA program
# src/ contains ada source code: ads and abd files
# obj/ is where the ADA object files are output
# bin/ is where executables are put
# pass primary program name in as argument
# example:
# ./build.sh main
FILE="$1"
if [ -z "$FILE" ]; then
echo "missing program argument to compile"
exit 1
fi
# build and run
gnatmake -D obj/ -o bin/$1 src/$1.adb && echo '>>>>' && bin/$1