Makefile.am 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. # We use a two-step process to generate documentation from asciidoc files.
  2. #
  3. # First, we use asciidoc/a2x to process the asciidoc files into .1.in and
  4. # .html.in files (see the asciidoc-helper.sh script). These are the same as
  5. # the regular .1 and .html files, except that they still have some autoconf
  6. # variables set in them.
  7. #
  8. # Second, we use config.status to turn .1.in files into .1 files and
  9. # .html.in files into .html files.
  10. #
  11. # We do the steps in this order so that we can ship the .*.in files as
  12. # part of the source distribution, so that people without asciidoc can
  13. # just use the .1 and .html files.
  14. if USE_ASCIIDOC
  15. asciidoc_files = tor tor-gencert tor-resolve torify
  16. else
  17. asciidoc_files =
  18. endif
  19. html_in = $(asciidoc_files:=.html.in)
  20. man_in = $(asciidoc_files:=.1.in)
  21. EXTRA_DIST = HACKING asciidoc-helper.sh \
  22. $(html_in) $(man_in) $(asciidoc_files:=.1.txt) \
  23. tor-osx-dmg-creation.txt tor-rpm-creation.txt \
  24. tor-win32-mingw-creation.txt
  25. nodist_man_MANS = $(asciidoc_files:=.1)
  26. docdir = @docdir@
  27. doc_DATA = $(asciidoc_files:=.html)
  28. asciidoc_product = $(nodist_man_MANS) $(doc_DATA)
  29. SUBDIRS = spec
  30. DIST_SUBDIRS = spec
  31. # Generate the html documentation from asciidoc, but don't do
  32. # machine-specific replacements yet
  33. $(html_in) :
  34. $(top_srcdir)/doc/asciidoc-helper.sh html @ASCIIDOC@ $(top_srcdir)/doc/$@
  35. tor.html.in : tor.1.txt
  36. torify.html.in : torify.1.txt
  37. tor-gencert.html.in : tor-gencert.1.txt
  38. tor-resolve.html.in : tor-resolve.1.txt
  39. # Generate the manpage from asciidoc, but don't do
  40. # machine-specific replacements yet
  41. $(man_in) :
  42. $(top_srcdir)/doc/asciidoc-helper.sh man @A2X@ $(top_srcdir)/doc/$@
  43. tor.1.in : tor.1.txt
  44. torify.1.in : torify.1.txt
  45. tor-gencert.1.in : tor-gencert.1.txt
  46. tor-resolve.1.in : tor-resolve.1.txt
  47. # use ../config.status to swap all machine-specific magic strings
  48. # in the asciidoc with their replacements.
  49. $(asciidoc_product) :
  50. if test -e $(top_srcdir)/doc/$@.in && ! test -e ./$@.in ; then \
  51. cp $(top_srcdir)/doc/$@.in .; \
  52. fi
  53. ../config.status --file=$@;
  54. tor.1 : tor.1.in
  55. torify.1 : torify.1.in
  56. tor-gencert.1 : tor-gencert.1.in
  57. tor-resolve.1 : tor-resolve.1.in
  58. tor.html : tor.html.in
  59. torify.html : torify.html.in
  60. tor-gencert.html : tor-gencert.html.in
  61. tor-resolve.html : tor-resolve.html.in
  62. CLEANFILES = $(asciidoc_product)
  63. DISTCLEANFILES = $(html_in) $(man_in)