#!/bin/sh


if [ -d ./obj/ ]; then
	rm ./obj/*
else
	mkdir obj
fi


# using Xcode compiler...
# first, create oal.o:
g++ adainclude/adaOpenAL/OalBinding/oal.cpp -c \
-D obj \
-Iadainclude/adaOpenAL/OalBinding \
-Iadainclude/adaOpenAL/OalBinding/incoal


#--------------------------------------------------------

# this is newest compiler from AdaCore:
export PATH=$HOME/opt/GNAT/2020/bin:$PATH




gnatmake $1 \
-O3  \
-D $PWD/obj \
-I$PWD/src \
-I$PWD/adainclude \
-I$PWD/adainclude/fakeTime \
-I$PWD/adabindings/fake00 \
-I$PWD/adainclude/adaOpenAL \
-I$PWD/adainclude/adaOpenAL/OalBinding \
-largs -lm -lz -lc++ \
oal.o \
$PWD/libs/osx/libgnatcoll.a \
$PWD/libs/osx/libgpr.a \
\
-framework CoreAudio \
-framework AudioUnit \
-framework AudioToolBox \
-framework OpenAL \
-pthread


mv $1 ./bin/osx/


# -- Copyright (C) 2020  <fastrgv@gmail.com>
# --
# -- This program is free software: you can redistribute it and/or modify
# -- it under the terms of the GNU General Public License as published by
# -- the Free Software Foundation, either version 3 of the License, or
# -- (at your option) any later version.
# --
# -- This program is distributed in the hope that it will be useful,
# -- but WITHOUT ANY WARRANTY; without even the implied warranty of
# -- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# -- GNU General Public License for more details.
# --
# -- You may read the full text of the GNU General Public License
# -- at <http://www.gnu.org/licenses/>.

