@echo off
cls
echo    File:     zz_BuildGenericBkMFC.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\vcvars32.bat" goto programfilesx86
call "C:\Program Files\Microsoft Visual Studio\18\Professional\VC\Auxiliary\Build\vcvars32.bat"
goto aftervcvars

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

:aftervcvars
cd %PREVDIR%
echo.

echo Your %%include%% is:
echo %include%
echo.
pause
cls
echo #
echo #  GenericBkMFC 32 bit
echo #
TITLE GenericBkMFC 32 bit
msbuild /m /p:Configuration=Release;Platform=x86 /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=x86 /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=x86 /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=x86 /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 Bin\*.ilk
del Bin\*.exp
del Bin\*.pdb
del Bin\*.ipdb
del Bin\*.iobj
rmdir /S /Q IntermediateFiles32
rmdir /S /Q ipch
rmdir /S /Q .vs

goto success

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

:success