@echo off
cls
echo    File:     zz_BuildGenericBkMFC64.bat
echo.
echo    Created:  26/Jan/2018
echo    Updated:  06/Jan/2026
echo.
echo    Author:   Davide Calabro'     info@softechsoftware.it
echo                                  www.softechsoftware.it
echo.
echo.
set PREVDIR=%~dp0
if not exist "C:\Program Files\Microsoft Visual Studio\18\Professional\VC\Auxiliary\Build\vcvars64.bat" goto programfilesx86
call "C:\Program Files\Microsoft Visual Studio\18\Professional\VC\Auxiliary\Build\vcvars64.bat"
goto aftervcvars

:programfilesx86
call "C:\Program Files (x86)\Microsoft Visual Studio\18\Professional\VC\Auxiliary\Build\vcvars64.bat"

:aftervcvars
cd %PREVDIR%
echo.

echo Your %%include%% is:
echo %include%
echo.
pause
cls
echo #
echo #  GenericBkMFC 64 bit
echo #
TITLE GenericBkMFC 64 bit
msbuild /m /p:Configuration=Release;Platform=x64 /T:rebuild GenericBkMFC.slnx
if errorlevel == 255 goto failed
if errorlevel == 4 goto failed
if errorlevel == 2 goto failed
if errorlevel == 1 goto failed

msbuild /m /p:Configuration=Debug;Platform=x64 /T:rebuild GenericBkMFC.slnx
if errorlevel == 255 goto failed
if errorlevel == 4 goto failed
if errorlevel == 2 goto failed
if errorlevel == 1 goto failed

msbuild /m /p:Configuration="Release NO Unicode";Platform=x64 /T:rebuild GenericBkMFC.slnx
if errorlevel == 255 goto failed
if errorlevel == 4 goto failed
if errorlevel == 2 goto failed
if errorlevel == 1 goto failed

msbuild /m /p:Configuration="Debug NO Unicode";Platform=x64 /T:rebuild GenericBkMFC.slnx
if errorlevel == 255 goto failed
if errorlevel == 4 goto failed
if errorlevel == 2 goto failed
if errorlevel == 1 goto failed

del *.aps
del *.ncb
del *.user
del *.sdf
del /AH *.suo
del Bin64\*.ilk
del Bin64\*.exp
del Bin64\*.pdb
del Bin64\*.ipdb
del Bin64\*.iobj
rmdir /S /Q IntermediateFiles64
rmdir /S /Q ipch
rmdir /S /Q .vs

goto success

:failed
echo #
echo #  Failed!!!!!
echo #
pause

:success