]> git.saurik.com Git - apple/objc4.git/blob - version.bat
objc4-781.2.tar.gz
[apple/objc4.git] / version.bat
1 :: version.bat
2 :: Writes version numbers from B&I into version.h for use by version.rc.
3
4 @ECHO OFF
5
6 :: Set default values for environment variables if not set by B&I
7 IF "%OBJROOT%"=="" SET OBJROOT=.
8 IF "%RC_PROJECTSOURCEVERSION%"=="" SET RC_PROJECTSOURCEVERSION=0.0
9 IF "%RC_PROJECTBUILDVERSION%"=="" SET RC_PROJECTBUILDVERSION=0
10
11 :: Get version numbers from environment variables
12 SET major=1
13 SET patch=0
14 FOR /F "tokens=1* eol= delims=." %%i IN ("%RC_PROJECTSOURCEVERSION%") DO (
15 SET minor=%%i
16 IF NOT "%%j"=="" SET patch=%%j
17 )
18 SET build=%RC_PROJECTBUILDVERSION%
19
20 ECHO version %major% . %minor% . %patch% . %build%
21
22 :: Write version.h
23 ECHO // This file is automatically generated by version.bat. > "%OBJROOT%\version.h"
24 ECHO // DO NOT EDIT >> "%OBJROOT%\version.h"
25 ECHO #define major %major% >> "%OBJROOT%\version.h"
26 ECHO #define minor %minor% >> "%OBJROOT%\version.h"
27 ECHO #define patch %patch% >> "%OBJROOT%\version.h"
28 ECHO #define build %build% >> "%OBJROOT%\version.h"
29 ECHO #define string "%major%,%minor%,%patch%,%build%" >> "%OBJROOT%\version.h"