Makefile.am 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. if USE_FW_HELPER
  16. asciidoc_files = tor tor-gencert tor-resolve torify tor-fw-helper
  17. else
  18. asciidoc_files = tor tor-gencert tor-resolve torify
  19. endif
  20. html_in = $(asciidoc_files:=.html.in)
  21. man_in = $(asciidoc_files:=.1.in)
  22. txt_in = $(asciidoc_files:=.1.txt)
  23. nodist_man_MANS = $(asciidoc_files:=.1)
  24. doc_DATA = $(asciidoc_files:=.html)
  25. else
  26. asciidoc_files =
  27. html_in =
  28. man_in =
  29. txt_in =
  30. nodist_man_MANS =
  31. doc_DATA =
  32. endif
  33. EXTRA_DIST = HACKING asciidoc-helper.sh \
  34. $(html_in) $(man_in) $(txt_in) \
  35. tor-rpm-creation.txt \
  36. tor-win32-mingw-creation.txt
  37. docdir = @docdir@
  38. asciidoc_product = $(nodist_man_MANS) $(doc_DATA)
  39. SUBDIRS = spec
  40. DIST_SUBDIRS = spec
  41. # Generate the html documentation from asciidoc, but don't do
  42. # machine-specific replacements yet
  43. $(html_in) :
  44. $(top_srcdir)/doc/asciidoc-helper.sh html @ASCIIDOC@ $(top_srcdir)/doc/$@
  45. tor.html.in : tor.1.txt
  46. torify.html.in : torify.1.txt
  47. tor-gencert.html.in : tor-gencert.1.txt
  48. tor-resolve.html.in : tor-resolve.1.txt
  49. tor-fw-helper.html.in : tor-fw-helper.1.txt
  50. # Generate the manpage from asciidoc, but don't do
  51. # machine-specific replacements yet
  52. $(man_in) :
  53. $(top_srcdir)/doc/asciidoc-helper.sh man @A2X@ $(top_srcdir)/doc/$@
  54. tor.1.in : tor.1.txt
  55. torify.1.in : torify.1.txt
  56. tor-gencert.1.in : tor-gencert.1.txt
  57. tor-resolve.1.in : tor-resolve.1.txt
  58. tor-fw-helper.1.in : tor-fw-helper.1.txt
  59. # use ../config.status to swap all machine-specific magic strings
  60. # in the asciidoc with their replacements.
  61. $(asciidoc_product) :
  62. if test -e $(top_srcdir)/doc/$@.in && ! test -e ./$@.in ; then \
  63. cp $(top_srcdir)/doc/$@.in .; \
  64. fi
  65. ../config.status --file=$@;
  66. tor.1 : tor.1.in
  67. torify.1 : torify.1.in
  68. tor-gencert.1 : tor-gencert.1.in
  69. tor-resolve.1 : tor-resolve.1.in
  70. tor-fw-helper.1 : tor-fw-helper.1.in
  71. tor.html : tor.html.in
  72. torify.html : torify.html.in
  73. tor-gencert.html : tor-gencert.html.in
  74. tor-resolve.html : tor-resolve.html.in
  75. tor-fw-helper.html : tor-fw-helper.html.in
  76. CLEANFILES = $(asciidoc_product) config.log
  77. DISTCLEANFILES = $(html_in) $(man_in)