Build script for PuTTY using bob.
[u/mdw/putty] / Buildscr
1 # -*- sh -*-
2 # Build script to construct a full distribution directory of PuTTY.
3
4 # Set up the arguments for the main make command.
5 set Makeargs
6 ifneq "$(RELEASE)" "" set Makeargs VER="-DRELEASE=$(RELEASE)"
7 ifneq "$(SNAPSHOT)" "" set Makeargs VER="-DSNAPSHOT=$(SNAPSHOT)"
8 ifneq "$(XFLAGS)" "" set Makeargs $(makeargs) XFLAGS="$(XFLAGS)"
9 ifneq "$(MAKEARGS)" "" set Makeargs $(makeargs) $(MAKEARGS)
10
11 # Set up the version string for the docs build.
12 set Docmakeargs
13 ifneq "$(RELEASE)" "" set Docmakeargs VERSION="PuTTY release $(RELEASE)"
14 ifneq "$(SNAPSHOT)" "" set Docmakeaargs VERSION="PuTTY development snapshot $(SNAPSHOT)"
15
16 # Set up the version string for the installer.
17 set Iversion
18 ifneq "$(RELEASE)" "" set Iversion $(RELEASE)
19 ifneq "$(SNAPSHOT)" "" set Iversion $(SNAPSHOT)
20 # FIXME: what about the static version numbers in putty.iss?
21
22 in putty do ./mksrcarc.sh
23 in putty do ./mkunxarc.sh $(RELEASE)
24 in putty do perl mkfiles.pl
25 in putty/doc do make $(Docmakeargs) putty.hlp
26 in putty/doc do make $(Docmakeargs) chm
27 delegate windows
28 # FIXME: Cygwin alternative?
29 in putty/windows do cmd /c 'vcvars32 & nmake -f Makefile.vc $(Makeargs)'
30 # Ignore exit code from hhc, in favour of seeing whether the .chm
31 # file was created. (Yuck; but hhc appears to return non-zero
32 # exit codes on whim.)
33 in putty/doc do hhc putty.hhp; test -f putty.chm
34 in putty/windows do iscc putty.iss
35 return putty/windows/*.exe
36 return putty/doc/putty.chm
37 return putty/windows/Output/setup.exe
38 enddelegate
39 in putty/doc do make mostlyclean
40 in putty/doc do make $(Docmakeargs)
41 in putty/windows do zip -k -j putty.zip `ls *.exe | grep -v puttytel` ../doc/putty.chm ../doc/putty.hlp ../doc/putty.cnt
42 in putty/doc do zip puttydoc.zip *.html
43
44 deliver putty/windows/*.exe x86/$@
45 deliver putty/windows/putty.zip x86/$@
46 deliver putty/windows/Output/setup.exe x86/putty-$(Iversion)-installer.exe
47 deliver putty/doc/puttydoc.zip $@
48 deliver putty/doc/putty.chm $@
49 deliver putty/doc/putty.hlp $@
50 deliver putty/doc/putty.cnt $@
51 deliver putty/doc/puttydoc.txt $@
52 deliver putty/doc/*.html htmldoc/$@
53 deliver putty/putty-src.zip $@
54 deliver putty/*.tar.gz $@
55
56 # Building the md5sums file is most easily done in the destination
57 # directory.
58 in-dest . do md5sum `\find * -type f -print` > md5sums