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