@ECHO OFF

echo Begining docs build process... 

rem ******************************
rem ******************************

if exist "c:\program files\HTML Help Workshop\HHC.exe" (
goto start_x86
)

if exist "c:\program files (x86)\HTML Help Workshop\HHC.exe" (
goto start_x64
)

goto fail

rem ******************************
rem ******************************

:start_x86

pushd .\
cd ..

if exist _Docs (
rmdir _Docs /Q /S
)

mkdir _Docs
mkdir log

doxygen "_build\doxygen_cfg\game_doxygen_x86.cfg" > "log\doxygen.log"

cd _Docs

rmdir html /Q /S

popd

goto success

rem ******************************
rem ******************************

:start_x64

pushd .\
cd ..

if exist _Docs (
rmdir _Docs /Q /S
)

mkdir _Docs
mkdir log

doxygen "_build\doxygen_cfg\game_doxygen_x64.cfg" > "log\doxygen.log"

cd _Docs

rmdir html /Q /S

popd

goto success

rem ******************************
rem ******************************

:fail

echo ERROR! MICROSOFT HTML HELP COMPILER IS REQUIRED TO BUILD DOCUMENTATION.
echo PLEASE INSTALL HTML HELP COMPILER- HTMLHELP.EXE

rem ******************************
rem ******************************

:success

rem ******************************
rem ******************************

pause