/[putty]/trunk/build.bat
ViewVC logotype

Contents of /trunk/build.bat

Parent Directory Parent Directory | Revision Log Revision Log


Revision 143 - (show annotations)
Fri May 30 11:42:55 2008 UTC (17 months, 3 weeks ago) by dleonard
File MIME type: text/plain
File size: 5127 byte(s)
Use quest signing tool
1 @REM
2 @REM This is the top-level build script for Quest-PuTTY. It requires
3 @REM that the mkfiles.pl script has already been run in the source directory.
4 @REM Object files are written to %builddir% which defaults to a path
5 @REM under %TEMP%.
6 @REM $Id$
7 @REM
8
9 @REM The MAJOR.MINOR pair is the MSI product version. These numbers should
10 @REM never need touching. Importantly, *Never* decrease MINOR value.
11 @REM See the discussion below.
12 @REM I like to increase MINOR whenever we sync with a new release.
13 @REM The MAJOR version should follow the major version of PuTTY.
14 @REM
15 @REM The QRELEASE is the number that follows the "_q" part and
16 @REM indicates to customers successive patch releases of a product.
17 @REM The _q<n> part should start new from n=1 for each PuTTY release
18 @REM
19 @REM Historically:
20 @REM 0.1 PuTTY-0.58_q2 21 Dec 2006
21 @REM 0.2 PuTTY-0.59_q1 5 Apr 2007
22 @REM 0.3 PuTTY-0.60_q1 6 Jun 2007
23 @REM 0.4 PuTTY-0.60_q2
24 @REM
25 @set MAJOR=0
26 @set MINOR=4
27 @set QRELEASE=2
28
29 @REM Determine the subversion revision by examining the .svn subdir(!)
30 @REM This number is automatically incremented by subversion and we use it
31 @REM to determine unique and correct internal version numbers.
32 @set REVISION=0
33 @IF EXIST ".svn\entries" (
34 cscript /nologo svnversion.js >%TEMP%\revision.txt
35 set /p REVISION= <%TEMP%\revision.txt
36 del %TEMP%\revision.txt
37 )
38
39 @REM Calculate the whole version string
40 @set VERSION=0.60_q%QRELEASE%.%REVISION%
41 @set NAME=Quest-PuTTY
42 @set MSISUFFIX=
43
44 @echo ---- Building %NAME%-%VERSION%
45
46 @REM Notes on the MSI package version number
47 @REM
48 @REM The pkg version number for Quest-PuTTY is now the Quest version
49 @REM split into four parts as reqired by Quest ministandard #37.
50 @REM
51 @REM MAJOR.MINOR.patch.build
52 @REM
53 @REM When breaking (cli) interfaces: increment major
54 @REM When adding features/extending interface: increment minor
55 @REM
56 @REM (None of these numbers should exceed 32767.) We do not
57 @REM use the PuTTY version number in the package version metadata,
58 @REM but we do preserve it in the package's name. This is because
59 @REM Quest-PuTTY is a pretty much a separate product to Tatham's PuTTY.
60 @REM The build number should be derived from the revision number.
61
62 @set /a revisionhi=%REVISION% / 32768
63 @set /a revisionlo=%REVISION% %% 32768
64 set MSIVERSION=%MAJOR%.%MINOR%.%revisionhi%.%revisionlo%
65
66 @if not defined builddir set builddir=%TMP%/putty/
67 @set srcdir=%CD%/
68
69 @REM path %PATH%;C:\MinGW\bin
70 @REM path %PATH%;C:\Program Files\HTML Help Workshop
71 @set htmlhelpinc=-I\"C:\Program Files\HTML Help Workshop/include/\"
72 @set multimon=-DNO_MULTIMON
73 @set pubdir=R:\pub\rc\putty\
74
75 @set make=mingw32-make
76 @set codesigner=codesigner
77 @set WIXDIR=C:\Progra~1\WiX\
78 @set debug=
79 @REM set debug=-DDEBUG
80
81 @REM Look for a file called localconf.bat that can override settings
82 @if exist "localconf.bat" (
83 @echo Loading localconf.bat ...
84 call localconf.bat
85 )
86
87 @set MSINAME=%NAME%-%VERSION%%MSISUFFIX%
88
89 @if not "%1" == "" goto %1
90
91 :all
92 @echo ---- Create output directories
93 md "%builddir%"
94 @md "%builddir%charset"
95 @md "%builddir%halibut"
96 @md "%builddir%\putty"
97 @md "%builddir%\putty\windows"
98 @md "%builddir%\putty\doc"
99
100 :charset
101 @echo ---- Build charset library
102 %make% -C %builddir%charset -f %srcdir%charset/Makefile.quest ^
103 CC=gcc srcdir=%srcdir%charset/
104 @if %errorlevel% gtr 0 goto :EOF
105
106 :halibut
107 @echo ---- Build halibut documentation tool
108 %make% -C %builddir%halibut -f %srcdir%halibut/Makefile.quest ^
109 CC=gcc srcdir=%srcdir%halibut/
110 @if %errorlevel% gtr 0 goto :EOF
111
112 :help
113 @echo ---- Build PuTTY help/documentation
114 %make% -C %builddir%putty/doc -f %srcdir%putty/doc/Makefile ^
115 putty.chm putty.html ^
116 srcdir=%srcdir%putty/doc/ ^
117 HALIBUT=%builddir%halibut/halibut.exe ^
118 VERSION=%VERSION%
119 @REM if %errorlevel% gtr 0 goto :EOF
120
121 :build
122 @echo ---- Build PuTTY executables
123 %make% -C %builddir%putty/windows -f %srcdir%putty/windows/Makefile.cyg ^
124 VER=-DRELEASE=%VERSION% ^
125 srcdir=%srcdir%putty/windows/ ^
126 XFLAGS="-DSSPI_MECH -DFORCE_POLICY %multimon% %debug% %htmlhelpinc%"
127 @if %errorlevel% gtr 0 goto :EOF
128
129 :msi
130 @echo ---- Create installable package
131 set msimake=^
132 %make% -C %builddir%putty/windows -f %srcdir%putty/windows/Makefile.wix ^
133 VERSION=%VERSION% ^
134 srcdir=%srcdir%putty/windows/ ^
135 MSIVERSION=%MSIVERSION% ^
136 WIXDIR=%WIXDIR% ^
137 MSI=%builddir%%MSINAME%.msi
138 %msimake% clean
139 %msimake%
140 @if %errorlevel% gtr 0 goto :EOF
141
142 :sign
143 @echo ---- Signing package
144
145 @REM signtool sign /a ^
146 @REM /n "Quest Software" ^
147 @REM /du "http://rc.quest.com/topics/putty" ^
148 @REM %builddir%%MSINAME%.msi
149
150 %codesigner% ^
151 -l %builddir%.\codesign.log ^
152 -o %TEMP\%signed ^
153 -v ^
154 %builddir%.\%MSINAME%.msi
155 @if %errorlevel% gtr 0 goto :EOF
156
157 @echo.
158 @echo ---- Quest-PuTTY %VERSION% is now ready.
159 @echo.
160 @echo Options now are:
161 @echo build publish - copies MSI/MSMs to %pubdir%
162 @echo build clean - clean
163 goto :EOF
164
165 :publish
166 @echo ---- Publishing packages
167 copy %TEMP%\signed\%MSINAME%.msi %pubdir%%MSINAME%.msi
168 md %pubdir%msm/%MSINAME%
169 copy %builddir%putty/windows/*.msm %pubdir%msm/%MSINAME%/
170 goto :EOF
171
172 :clean
173 @echo ---- Cleaning
174 del /q /s "%builddir:~0,-1%"

Ted.Percival@quest.com
ViewVC Help
Powered by ViewVC 1.1.2