if [ -z "$SAGE_LOCAL" ]; then
    echo >&2 "SAGE_LOCAL undefined ... exiting"
    echo >&2 "Maybe run 'sage -sh'?"
    exit 1
fi

cd src

if [ "$SAGE_DEBUG" = "yes" ]; then
    export CFLAGS="-O0 -g $CFLAGS"
else
    export CFLAGS="-O2 -g $CFLAGS"
fi


echo "Testing the IML library"
$MAKE check
if [ $? -ne 0 ]; then
    echo >&2 "Error testing IML."
    exit 1
fi
