Makefile 2.3 KB

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