Now we use Subversion, it seems excessive to have an individual $Id$
[u/mdw/putty] / doc / Makefile
CommitLineData
39a938f7 1all: 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
7# string. Otherwise, we use `svnversion' to examine the checked-out
8# documentation source, and if that returns a single revision
9# number then we invent a version string reflecting just that
10# number. Failing _that_, we resort to versionids.but which shows a
11# $Id for each individual file.
12#
13# So here, we define VERSION using svnversion if it isn't already
14# defined ...
15ifndef VERSION
16SVNVERSION=$(shell test -d .svn && svnversion .)
17BADCHARS=$(findstring :,$(SVNVERSION))$(findstring S,$(SVNVERSION))
18ifeq ($(BADCHARS),)
19ifneq ($(SVNVERSION),)
20VERSION=Built from revision $(patsubst M,,$(SVNVERSION))
21endif
22endif
23endif
24# ... and now, we condition our build behaviour on whether or not
25# VERSION _is_ defined.
26ifdef VERSION
27VERSIONIDS=vstr
28vstr.but: FORCE
29 echo \\versionid $(VERSION) > vstr.but
30FORCE:;
31else
32VERSIONIDS=vids
33endif
34
78189bb3 35CHAPTERS := $(SITE) blurb intro gs using config pscp psftp plink pubkey
36CHAPTERS += pageant errors faq feedback licence
39a938f7 37CHAPTERS += index $(VERSIONIDS)
e5b0d077 38
39INPUTS = $(patsubst %,%.but,$(CHAPTERS))
40
41# This is temporary. Hack it locally or something.
5b68bbaf 42HALIBUT = $(HOME)/src/halibut/build/halibut
e5b0d077 43
02d88d11 44index.html: $(INPUTS)
45 $(HALIBUT) --text --html --winhelp $(INPUTS)
e3e5784e 46
02d88d11 47MKMAN = $(HALIBUT) --man=$@ mancfg.but $<
e3e5784e 48MANPAGES = putty.1 puttygen.1 plink.1 pscp.1 psftp.1 puttytel.1 pterm.1
49man: $(MANPAGES)
50
51putty.1: man-putt.but mancfg.but; $(MKMAN)
52puttygen.1: man-pg.but mancfg.but; $(MKMAN)
53plink.1: man-pl.but mancfg.but; $(MKMAN)
54pscp.1: man-pscp.but mancfg.but; $(MKMAN)
55psftp.1: man-psft.but mancfg.but; $(MKMAN)
56puttytel.1: man-ptel.but mancfg.but; $(MKMAN)
57pterm.1: man-pter.but mancfg.but; $(MKMAN)
58
e86cf399 59clean:
39a938f7 60 rm -f *.html *.txt *.hlp *.cnt *.1 vstr.but