]> asedeno.scripts.mit.edu Git - PuTTY.git/blob - doc/Makefile
first pass
[PuTTY.git] / doc / Makefile
1 all: man index.html
2
3 # Decide on the versionid policy.
4 #
5 # If the user has passed in $(VERSION) on the command line (`make
6 # VERSION="Release 0.56"'), we use that as an explicit version string.
7 # Otherwise, we use `svnversion' to examine the checked-out
8 # documentation source, and if that returns a single revision number
9 # then we invent a version string reflecting just that number. Failing
10 # _that_, we resort to versionids.but which gives 'version
11 # unavailable'.
12 #
13 # So here, we define VERSION using svnversion if it isn't already
14 # defined ...
15 ifndef VERSION
16 SVNVERSION=$(shell test -d .svn && svnversion .)
17 BADCHARS=$(findstring :,$(SVNVERSION))$(findstring S,$(SVNVERSION))
18 ifeq ($(BADCHARS),)
19 ifneq ($(SVNVERSION),)
20 ifneq ($(SVNVERSION),exported)
21 VERSION=Built from revision $(patsubst M,,$(SVNVERSION))
22 endif
23 endif
24 endif
25 endif
26 # ... and now, we condition our build behaviour on whether or not
27 # VERSION _is_ defined.
28 ifdef VERSION
29 VERSIONIDS=vstr
30 vstr.but: FORCE
31         printf '\\versionid $(VERSION)\n' > vstr.but
32 FORCE:;
33 else
34 VERSIONIDS=vids
35 endif
36
37 CHAPTERS := $(SITE) copy blurb intro gs using config pscp psftp plink
38 CHAPTERS += pubkey pageant errors faq feedback licence udp pgpkeys sshnames
39 CHAPTERS += index $(VERSIONIDS)
40
41 INPUTS = $(patsubst %,%.but,$(CHAPTERS))
42
43 # This is temporary. Hack it locally or something.
44 HALIBUT = halibut
45
46 index.html: $(INPUTS)
47         $(HALIBUT) --text --html --winhelp $(INPUTS)
48
49 # During formal builds it's useful to be able to build this one alone.
50 putty.hlp: $(INPUTS)
51         $(HALIBUT) --winhelp $(INPUTS)
52
53 putty.info: $(INPUTS)
54         $(HALIBUT) --info $(INPUTS)
55
56 chm: putty.hhp
57 putty.hhp: $(INPUTS) chm.but
58         $(HALIBUT) --html $(INPUTS) chm.but
59
60 MKMAN = $(HALIBUT) --man=$@ mancfg.but $<
61 MANPAGES = putty.1 puttygen.1 plink.1 pscp.1 psftp.1 puttytel.1 pterm.1 \
62            pageant.1
63 man: $(MANPAGES)
64
65 putty.1: man-putt.but mancfg.but; $(MKMAN)
66 puttygen.1: man-pg.but mancfg.but; $(MKMAN)
67 plink.1: man-pl.but mancfg.but; $(MKMAN)
68 pscp.1: man-pscp.but mancfg.but; $(MKMAN)
69 psftp.1: man-psft.but mancfg.but; $(MKMAN)
70 puttytel.1: man-ptel.but mancfg.but; $(MKMAN)
71 pterm.1: man-pter.but mancfg.but; $(MKMAN)
72 pageant.1: man-pag.but mancfg.but; $(MKMAN)
73
74 mostlyclean:
75         rm -f *.html *.txt *.hlp *.cnt *.1 *.info vstr.but *.hh[pck]
76 clean: mostlyclean
77         rm -f *.chm