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


rem using 64-bit GNU Ada:
rem PATH=c:\msys64\mingw64\bin;%PATH%  ...OR...
rem PATH=c:\Users\fastr\opt\gnat-x86_64-windows64-12.1.0-2\bin;%PATH%
rem First, use setpath64

del obj\*




rem build realWinTime.o:
g++ ^
 src\adautils\realTime\realWinTime.cpp -c -fPIC ^
 -Isrc\adautils\realTime

move realWinTime.o obj\


rem build cls.o
g++ ^
 src\adabindings\win00\cls.cc -c -fPIC

move cls.o obj\





rem build oal.o:
g++ ^
 src\adabindings\adaOpenAL\OalBinding\oal.cpp -c ^
 -D obj ^
 -Isrc\adabindings\adaOpenAL\OalBinding ^
 -Isrc\adabindings\adaOpenAL\OalBinding\incoal

move oal.o obj\


rem next, create terminals.o
gcc src\adautils\terminals.c -c

move terminals.o obj\




rem ----------------------------------------
rem libs\w64ming\ are all static
rem ----------------------------------------

gnatmake.exe adaventure ^
 -o adaventure64 ^
 -O3 -gnat12 -m64 ^
 -D obj ^
 -Isrc ^
 -Isrc\adautils ^
 -Isrc\adautils\realTime ^
 -Isrc\adabindings\win00 ^
 -Isrc\adabindings\gl ^
 -Isrc\adabindings\glfwada ^
 -Isrc\adabindings\AdaPngLib ^
 -Isrc\adabindings\adaOpenAL ^
 -Isrc\adabindings\adaOpenAL\OalBinding ^
 -Isrc\adabindings\Tables ^
 -Isrc\adabindings\FreeTypeAda ^
 -largs ^
 obj\oal.o obj\realWinTime.o obj\cls.o ^
 obj\terminals.o ^
 -lOpenGL32 -lGdi32 -lwinmm ^
 	binw64\openal32.dll ^
 	binw64\libstdc++-6.dll ^
 	binw64\zlib1.dll ^
 	binw64\glext.lib ^
 	binw64\freetype.dll ^
	-Llibs\w64ming ^
	-lglfw3dll

move adaventure64.exe binw64\

rem removed: binw64\glfw3.dll ^
