mk_versionrc.bat 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. @echo off
  2. rem mk_versionrc.bat
  3. rem without params:
  4. rem create version.rc.in from version.rc.in.in
  5. rem with params:
  6. rem create a final version.rc from version.rc.in
  7. rem param 1..4 : version numbers (major, minor, micro, extra)
  8. rem 5 : file description (text)
  9. rem 6 : input file (e.g. c:\foo\version.rc.in)
  10. rem 7 : output file (e.g. c:\bar\version.rc)
  11. if %1x==x goto TEMPLATE
  12. :FINAL
  13. sed -e "s/@FILE_MAJOR_VERSION@/%1/;s/@FILE_MINOR_VERSION@/%2/;s/@FILE_MICRO_VERSION@/%3/;s/@FILE_EXTRA_VERSION@/%4/; s/@FILEDESCRIPTION@/%5/" %6 > %7
  14. goto END
  15. :TEMPLATE
  16. SET VERTMP=mkvertmp.bat
  17. if EXIST %VERTMP% del %VERTMP%
  18. rem create version.rc.in from configure.ac / version.rc.in.in using grep, sed and helper batchfile
  19. set ROOT=..\..
  20. set BUILD=..
  21. echo @ECHO OFF > %VERTMP%
  22. rem --- extract version info ---
  23. grep -e "^[^ ]*VERSION=" %ROOT%\configure.ac | sed -e "s/^/SET /;">> %VERTMP%
  24. rem ---- create version.rc.in ----
  25. echo if %%EXTRA_VERSION%%x==x%%EXTRA_VERSION%% goto RELEASE>> %VERTMP%
  26. echo if %%EXTRA_VERSION%%==0 goto RELEASE>> %VERTMP%
  27. echo SET VERSION=%%MAJOR_VERSION%%.%%MINOR_VERSION%%.%%MICRO_VERSION%%cvs%%EXTRA_VERSION%%%%EXTRA_GTK2_VERSION%%%%EXTRA_WIN32_VERSION%% Win32 (GTK2)>> %VERTMP%
  28. echo goto VERSIONEND>> %VERTMP%
  29. echo :RELEASE>> %VERTMP%
  30. echo SET EXTRA_VERSION=0>> %VERTMP%
  31. echo SET VERSION=%%MAJOR_VERSION%%.%%MINOR_VERSION%%.%%MICRO_VERSION%%%%EXTRA_GTK2_VERSION%%%%EXTRA_WIN32_VERSION%% Win32 (GTK2)>> %VERTMP%
  32. echo :VERSIONEND>> %VERTMP%
  33. echo sed -e "s/@MAJOR_VERSION@/%%MAJOR_VERSION%%/;s/@MINOR_VERSION@/%%MINOR_VERSION%%/;s/@MICRO_VERSION@/%%MICRO_VERSION%%/;s/@EXTRA_VERSION@/%%EXTRA_VERSION%%/;s/@EXTRA_WIN32_VERSION@/%%EXTRA_WIN32_VERSION%%/;s/@VERSION@/%%VERSION%%/;" %BUILD%\version.rc.in.in>> %VERTMP%
  34. rem ---- create version.rc for Sylpheed and plugins ----
  35. echo call %0 %%MAJOR_VERSION%% %%MINOR_VERSION%% %%MICRO_VERSION%% %%EXTRA_VERSION%% Sylpheed-Claws %BUILD%\version.rc.in %BUILD%\version.rc>> %VERTMP%
  36. echo call %0 %%MAJOR_VERSION%% %%MINOR_VERSION%% %%MICRO_VERSION%% %%EXTRA_VERSION%% Demo-plugin %BUILD%\version.rc.in %BUILD%\demo_version.rc>> %VERTMP%
  37. echo call %0 %%MAJOR_VERSION%% %%MINOR_VERSION%% %%MICRO_VERSION%% %%EXTRA_VERSION%% SpamAssassin-plugin %BUILD%\version.rc.in %BUILD%\spamassassin_version.rc>> %VERTMP%
  38. echo call %0 %%MAJOR_VERSION%% %%MINOR_VERSION%% %%MICRO_VERSION%% %%EXTRA_VERSION%% GnuPG-plugin %BUILD%\version.rc.in %BUILD%\pgpmime_version.rc>> %VERTMP%
  39. type %VERTMP%
  40. call %VERTMP% > %BUILD%\version.rc.in
  41. if EXIST %VERTMP% del %VERTMP%
  42. set ROOT=
  43. set BUILD=
  44. SET VERTMP=
  45. :END