Makefile 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  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 $(INPUTS)
  43. # During formal builds it's useful to be able to build this one alone.
  44. putty.hlp: $(INPUTS)
  45. $(HALIBUT) --winhelp $(INPUTS)
  46. putty.info: $(INPUTS)
  47. $(HALIBUT) --info $(INPUTS)
  48. chm: putty.hhp
  49. putty.hhp: $(INPUTS) chm.but
  50. $(HALIBUT) --html $(INPUTS) chm.but
  51. MKMAN = $(HALIBUT) --man=$@ mancfg.but $<
  52. MANPAGES = putty.1 puttygen.1 plink.1 pscp.1 psftp.1 puttytel.1 pterm.1 \
  53. pageant.1
  54. man: $(MANPAGES)
  55. putty.1: man-putt.but mancfg.but; $(MKMAN)
  56. puttygen.1: man-pg.but mancfg.but; $(MKMAN)
  57. plink.1: man-pl.but mancfg.but; $(MKMAN)
  58. pscp.1: man-pscp.but mancfg.but; $(MKMAN)
  59. psftp.1: man-psft.but mancfg.but; $(MKMAN)
  60. puttytel.1: man-ptel.but mancfg.but; $(MKMAN)
  61. pterm.1: man-pter.but mancfg.but; $(MKMAN)
  62. pageant.1: man-pag.but mancfg.but; $(MKMAN)
  63. mostlyclean:
  64. rm -f *.html *.txt *.hlp *.cnt *.1 *.info vstr.but *.hh[pck]
  65. clean: mostlyclean
  66. rm -f *.chm