buildconf.bat: Added error messages on failure

This commit is contained in:
Steve Holme 2015-08-09 11:27:33 +01:00
parent 55a255ee9c
commit 39dcf352d2
1 changed files with 82 additions and 14 deletions

View File

@ -59,35 +59,60 @@ rem snapshot archives.
:start :start
if "%MODE%" == "GENERATE" ( if "%MODE%" == "GENERATE" (
echo.
echo Generating prerequisite files
call :generate call :generate
if errorlevel 3 goto nogencurlbuild
if errorlevel 2 goto nogenhugehelp
if errorlevel 1 goto nogenmakefile
) else ( ) else (
echo.
echo Removing prerequisite files
call :clean call :clean
if errorlevel 3 goto nocleancurlbuild
if errorlevel 2 goto nocleanhugehelp
if errorlevel 1 goto nocleanmakefile
) )
goto success goto success
rem Main generate function. rem Main generate function.
rem Returns:
rem
rem 0 - success
rem 1 - failure to generate Makefile
rem 2 - failure to generate tool_hugehelp.c
rem 3 - failure to generate curlbuild.h
rem
rem rem
:generate :generate
echo.
echo Generating prerequisite files
rem create Makefile rem create Makefile
if exist Makefile.dist ( if exist Makefile.dist (
echo * %CD%\Makefile echo * %CD%\Makefile
copy /Y Makefile.dist Makefile 1>NUL copy /Y Makefile.dist Makefile 1>NUL 2>&1
if errorlevel 1 (
exit /B 1
)
) )
rem create tool_hugehelp.c rem create tool_hugehelp.c
if exist src\tool_hugehelp.c.cvs ( if exist src\tool_hugehelp.c.cvs (
echo * %CD%\src\tool_hugehelp.c echo * %CD%\src\tool_hugehelp.c
copy /Y src\tool_hugehelp.c.cvs src\tool_hugehelp.c 1>NUL copy /Y src\tool_hugehelp.c.cvs src\tool_hugehelp.c 1>NUL 2>&1
if errorlevel 1 (
exit /B 2
)
) )
rem create curlbuild.h rem create curlbuild.h
if exist include\curl\curlbuild.h.dist ( if exist include\curl\curlbuild.h.dist (
echo * %CD%\include\curl\curlbuild.h echo * %CD%\include\curl\curlbuild.h
copy /Y include\curl\curlbuild.h.dist include\curl\curlbuild.h 1>NUL copy /Y include\curl\curlbuild.h.dist include\curl\curlbuild.h 1>NUL 2>&1
if errorlevel 1 (
exit /B 3
)
) )
rem setup c-ares git tree rem setup c-ares git tree
@ -99,30 +124,43 @@ rem
cd .. cd ..
) )
exit /B exit /B 0
rem Main clean function. rem Main clean function.
rem rem
rem Returns:
rem
rem 0 - success
rem 1 - failure to clean Makefile
rem 2 - failure to clean tool_hugehelp.c
rem 3 - failure to clean curlbuild.h
rem
:clean :clean
echo.
echo Removing prerequisite files
echo * %CD%\Makefile echo * %CD%\Makefile
if exist Makefile ( if exist Makefile (
del Makefile del Makefile 2>NUL
if exist Makefile (
exit /B 1
)
) )
echo * %CD%\src\tool_hugehelp.c echo * %CD%\src\tool_hugehelp.c
if exist src\tool_hugehelp.c ( if exist src\tool_hugehelp.c (
del src\tool_hugehelp.c del src\tool_hugehelp.c 2>NUL
if exist src\tool_hugehelp.c (
exit /B 2
)
) )
echo * %CD%\include\curl\curlbuild.h echo * %CD%\include\curl\curlbuild.h
if exist include\curl\curlbuild.h ( if exist include\curl\curlbuild.h (
del include\curl\curlbuild.h del include\curl\curlbuild.h 2>NUL
if exist include\curl\curlbuild.h (
exit /B 3
)
) )
exit /B exit /B 0
:syntax :syntax
rem Display the help rem Display the help
@ -142,6 +180,36 @@ rem
echo Error: This batch file should only be used with a curl git repository echo Error: This batch file should only be used with a curl git repository
goto error goto error
:nogenmakefile
echo.
echo Error: Unable to generate Makefile
goto error
:nogenhugehelp
echo.
echo Error: Unable to generate src\tool_hugehelp.c
goto error
:nogencurlbuild
echo.
echo Error: Unable to generate include\curl\curlbuild.h
goto error
:nocleanmakefile
echo.
echo Error: Unable to clean Makefile
goto error
:nocleanhugehelp
echo.
echo Error: Unable to clean src\tool_hugehelp.c
goto error
:nocleancurlbuild
echo.
echo Error: Unable to clean include\curl\curlbuild.h
goto error
:error :error
if "%OS%" == "Windows_NT" ( if "%OS%" == "Windows_NT" (
endlocal endlocal