checksrc.bat 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. @echo off
  2. rem ***************************************************************************
  3. rem * _ _ ____ _
  4. rem * Project ___| | | | _ \| |
  5. rem * / __| | | | |_) | |
  6. rem * | (__| |_| | _ <| |___
  7. rem * \___|\___/|_| \_\_____|
  8. rem *
  9. rem * Copyright (C) 2014, Steve Holme, <steve_holme@hotmail.com>.
  10. rem *
  11. rem * This software is licensed as described in the file COPYING, which
  12. rem * you should have received as part of this distribution. The terms
  13. rem * are also available at http://curl.haxx.se/docs/copyright.html.
  14. rem *
  15. rem * You may opt to use, copy, modify, merge, publish, distribute and/or sell
  16. rem * copies of the Software, and permit persons to whom the Software is
  17. rem * furnished to do so, under the terms of the COPYING file.
  18. rem *
  19. rem * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
  20. rem * KIND, either express or implied.
  21. rem *
  22. rem ***************************************************************************
  23. :begin
  24. rem Check we are running on a Windows NT derived OS
  25. if not "%OS%" == "Windows_NT" goto nodos
  26. setlocal
  27. rem Display the help
  28. if /i "%~1" == "-?" goto syntax
  29. if /i "%~1" == "-h" goto syntax
  30. if /i "%~1" == "-help" goto syntax
  31. :prerequisites
  32. rem Check we have Perl installed
  33. if not exist "C:\Perl" (
  34. if not exist "C:\Perl64" goto noperl
  35. )
  36. :configure
  37. if "%1" == "" set SRC_DIR=..
  38. if not "%1" == "" set SRC_DIR=%~1%
  39. if not exist "%SRC_DIR%" goto nosrc
  40. :start
  41. for /F %%i in ('dir %SRC_DIR%\src\*.c.* /b') do @perl %SRC_DIR%\lib\checksrc.pl -D%SRC_DIR%\src %%i
  42. for /F %%i in ('dir %SRC_DIR%\src\*.h.* /b') do @perl %SRC_DIR%\lib\checksrc.pl -D%SRC_DIR%\src %%i
  43. for /F %%i in ('dir %SRC_DIR%\lib\*.c.* /b') do @perl %SRC_DIR%\lib\checksrc.pl -D%SRC_DIR%\lib %%i
  44. for /F %%i in ('dir %SRC_DIR%\lib\*.h.* /b') do @perl %SRC_DIR%\lib\checksrc.pl -D%SRC_DIR%\lib -Wcurl_config.h.cmake %%i
  45. goto success
  46. :syntax
  47. rem Display the help
  48. echo.
  49. echo Usage: checksrc [directory]
  50. echo.
  51. echo directory - Specifies the curl source directory
  52. goto success
  53. :nodos
  54. echo.
  55. echo Error: Only a Windows NT based Operating System is supported
  56. goto error
  57. :noperl
  58. echo.
  59. echo Error: Perl is not installed
  60. goto error
  61. :nosrc
  62. echo.
  63. echo Error: "%SRC_DIR%" does not exist
  64. goto error
  65. :error
  66. if "%OS%" == "Windows_NT" endlocal
  67. exit /B 1
  68. :success
  69. endlocal
  70. exit /B 0