Makefile 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 pubkeyfmt licence udp
  37. CHAPTERS += pgpkeys sshnames
  38. CHAPTERS += index $(VERSIONIDS)
  39. INPUTS = $(patsubst %,%.but,$(CHAPTERS))
  40. # This is temporary. Hack it locally or something.
  41. HALIBUT = halibut
  42. index.html: $(INPUTS)
  43. $(HALIBUT) --text --html --chm $(INPUTS)
  44. # During formal builds it's useful to be able to build this one alone.
  45. putty.chm: $(INPUTS)
  46. $(HALIBUT) --chm $(INPUTS)
  47. # We don't ship this any more.
  48. putty.hlp: $(INPUTS)
  49. $(HALIBUT) --winhelp $(INPUTS)
  50. putty.info: $(INPUTS)
  51. $(HALIBUT) --info $(INPUTS)
  52. MKMAN = $(HALIBUT) --man=$@ mancfg.but $<
  53. MANPAGES = putty.1 puttygen.1 plink.1 pscp.1 psftp.1 puttytel.1 pterm.1 \
  54. pageant.1 psocks.1 psusan.1
  55. man: $(MANPAGES)
  56. putty.1: man-putty.but mancfg.but; $(MKMAN)
  57. puttygen.1: man-puttygen.but mancfg.but; $(MKMAN)
  58. plink.1: man-plink.but mancfg.but; $(MKMAN)
  59. pscp.1: man-pscp.but mancfg.but; $(MKMAN)
  60. psftp.1: man-psftp.but mancfg.but; $(MKMAN)
  61. puttytel.1: man-puttytel.but mancfg.but; $(MKMAN)
  62. pterm.1: man-pterm.but mancfg.but; $(MKMAN)
  63. pageant.1: man-pageant.but mancfg.but; $(MKMAN)
  64. psocks.1: man-psocks.but mancfg.but; $(MKMAN)
  65. psusan.1: man-psusan.but mancfg.but; $(MKMAN)
  66. mostlyclean:
  67. rm -f *.html *.txt *.hlp *.cnt *.1 *.info vstr.but *.hh[pck]
  68. clean: mostlyclean
  69. rm -f *.chm