Version management updates for the new bob build script. There's now
[u/mdw/putty] / Buildscr
CommitLineData
1e07e676 1# -*- sh -*-
2# Build script to construct a full distribution directory of PuTTY.
3
4# Set up the arguments for the main make command.
30ea5678 5set Makeargs VER="-DSVN_REV=$(revision)"
6ifneq "$(RELEASE)" "" set Makeargs $(Makeargs) VER="-DRELEASE=$(RELEASE)"
7ifneq "$(date)" "" set Makeargs $(Makeargs) VER="-DSNAPSHOT=$(date)"
1e07e676 8ifneq "$(XFLAGS)" "" set Makeargs $(makeargs) XFLAGS="$(XFLAGS)"
9ifneq "$(MAKEARGS)" "" set Makeargs $(makeargs) $(MAKEARGS)
10
11# Set up the version string for the docs build.
30ea5678 12set Docmakeargs VERSION="PuTTY revision $(revision)"
1e07e676 13ifneq "$(RELEASE)" "" set Docmakeargs VERSION="PuTTY release $(RELEASE)"
30ea5678 14ifneq "$(date)" "" set Docmakeaargs VERSION="PuTTY development snapshot $(date)"
15
16# Set up the various version strings for the installer.
17set Iversion r$(revision)
18set Iname PuTTY revision $(revision)
19set Ivertext Revision $(revision)
20set Irev $(revision)
21ifneq "$(RELEASE)" "" set Iversion $(RELEASE)
22ifneq "$(RELEASE)" "" set Iname PuTTY version $(RELEASE)
23ifneq "$(RELEASE)" "" set Ivertext Release $(RELEASE)
24ifneq "$(RELEASE)" "" set Irev
25ifneq "$(date)" "" set Iversion $(date):r$(revision)
26ifneq "$(date)" "" set Iname PuTTY development snapshot $(date):r$(revision)
27ifneq "$(date)" "" set Ivertext Development snapshot $(date):r$(revision)
1e07e676 28
29# Set up the version string for the installer.
30ea5678 30set Iversion r$(revision)
1e07e676 31ifneq "$(RELEASE)" "" set Iversion $(RELEASE)
30ea5678 32ifneq "$(date)" "" set Iversion $(date):r$(revision)
1e07e676 33
34in putty do ./mksrcarc.sh
35in putty do ./mkunxarc.sh $(RELEASE)
36in putty do perl mkfiles.pl
37in putty/doc do make $(Docmakeargs) putty.hlp
38in putty/doc do make $(Docmakeargs) chm
30ea5678 39
40# Munge the installer script locally so that it reports the version
41# we're really building.
42in putty/windows do perl -i~ -pe 'BEGIN{$$a=shift@ARGV;}s/^(AppVerName=).*$$/$$1$$a/' '$(Iname)' putty.iss
43in putty/windows do perl -i~ -pe 'BEGIN{$$a=shift@ARGV;}s/^(VersionInfoTextVersion=).*$$/$$1$$a/' '$(Ivertext)' putty.iss
44in putty/windows do perl -i~ -pe 'BEGIN{$$a=shift@ARGV;}s/^(AppVersion=).*$$/$$1$$a/' '$(Iversion)' putty.iss
45in putty/windows do perl -i~ -pe 'BEGIN{$$a=shift@ARGV;$$a=~s/M//;}s/^(VersionInfoVersion=\d+\.\d+\.)\d+(\.\d+)\r?$$/$$1$$a$$2/' '$(Irev)' putty.iss
46
1e07e676 47delegate windows
48 # FIXME: Cygwin alternative?
49 in putty/windows do cmd /c 'vcvars32 & nmake -f Makefile.vc $(Makeargs)'
50 # Ignore exit code from hhc, in favour of seeing whether the .chm
51 # file was created. (Yuck; but hhc appears to return non-zero
52 # exit codes on whim.)
53 in putty/doc do hhc putty.hhp; test -f putty.chm
54 in putty/windows do iscc putty.iss
55 return putty/windows/*.exe
56 return putty/doc/putty.chm
57 return putty/windows/Output/setup.exe
58enddelegate
59in putty/doc do make mostlyclean
60in putty/doc do make $(Docmakeargs)
61in putty/windows do zip -k -j putty.zip `ls *.exe | grep -v puttytel` ../doc/putty.chm ../doc/putty.hlp ../doc/putty.cnt
62in putty/doc do zip puttydoc.zip *.html
63
64deliver putty/windows/*.exe x86/$@
65deliver putty/windows/putty.zip x86/$@
66deliver putty/windows/Output/setup.exe x86/putty-$(Iversion)-installer.exe
67deliver putty/doc/puttydoc.zip $@
68deliver putty/doc/putty.chm $@
69deliver putty/doc/putty.hlp $@
70deliver putty/doc/putty.cnt $@
71deliver putty/doc/puttydoc.txt $@
72deliver putty/doc/*.html htmldoc/$@
73deliver putty/putty-src.zip $@
74deliver putty/*.tar.gz $@
75
76# Building the md5sums file is most easily done in the destination
77# directory.
78in-dest . do md5sum `\find * -type f -print` > md5sums