include.am 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. base_mans = doc/tor doc/tor-gencert doc/tor-resolve doc/torify
  15. all_mans = $(base_mans)
  16. if USE_FW_HELPER
  17. install_mans = $(all_mans)
  18. else
  19. install_mans = $(base_mans)
  20. endif
  21. if USE_ASCIIDOC
  22. nodist_man1_MANS = $(install_mans:=.1)
  23. doc_DATA = $(install_mans:=.html)
  24. html_in = $(all_mans:=.html.in)
  25. man_in = $(all_mans:=.1.in)
  26. txt_in = $(all_mans:=.1.txt)
  27. else
  28. html_in =
  29. man_in =
  30. txt_in =
  31. nodist_man1_MANS =
  32. doc_DATA =
  33. endif
  34. EXTRA_DIST+= doc/asciidoc-helper.sh \
  35. $(html_in) $(man_in) $(txt_in) \
  36. doc/state-contents.txt \
  37. doc/torrc_format.txt \
  38. doc/TUNING \
  39. doc/HACKING/README.1st.md \
  40. doc/HACKING/CodingStandards.md \
  41. doc/HACKING/GettingStarted.md \
  42. doc/HACKING/HelpfulTools.md \
  43. doc/HACKING/HowToReview.md \
  44. doc/HACKING/ReleasingTor.md \
  45. doc/HACKING/WritingTests.md
  46. docdir = @docdir@
  47. asciidoc_product = $(nodist_man1_MANS) $(doc_DATA)
  48. # Generate the html documentation from asciidoc, but don't do
  49. # machine-specific replacements yet
  50. $(html_in) :
  51. $(AM_V_GEN)$(top_srcdir)/doc/asciidoc-helper.sh html @ASCIIDOC@ $(top_srcdir)/$@
  52. # Generate the manpage from asciidoc, but don't do
  53. # machine-specific replacements yet
  54. $(man_in) :
  55. $(AM_V_GEN)$(top_srcdir)/doc/asciidoc-helper.sh man @A2X@ $(top_srcdir)/$@
  56. doc/tor.1.in: doc/tor.1.txt
  57. doc/torify.1.in: doc/torify.1.txt
  58. doc/tor-gencert.1.in: doc/tor-gencert.1.txt
  59. doc/tor-resolve.1.in: doc/tor-resolve.1.txt
  60. doc/tor.html.in: doc/tor.1.txt
  61. doc/torify.html.in: doc/torify.1.txt
  62. doc/tor-gencert.html.in: doc/tor-gencert.1.txt
  63. doc/tor-resolve.html.in: doc/tor-resolve.1.txt
  64. # use config.status to swap all machine-specific magic strings
  65. # in the asciidoc with their replacements.
  66. $(asciidoc_product) :
  67. $(AM_V_GEN)$(MKDIR_P) $(@D)
  68. $(AM_V_at)if test -e $(top_srcdir)/$@.in && ! test -e $@.in ; then \
  69. cp $(top_srcdir)/$@.in $@; \
  70. fi
  71. $(AM_V_at)$(top_builddir)/config.status -q --file=$@;
  72. doc/tor.html: doc/tor.html.in
  73. doc/tor-gencert.html: doc/tor-gencert.html.in
  74. doc/tor-resolve.html: doc/tor-resolve.html.in
  75. doc/torify.html: doc/torify.html.in
  76. doc/tor.1: doc/tor.1.in
  77. doc/tor-gencert.1: doc/tor-gencert.1.in
  78. doc/tor-resolve.1: doc/tor-resolve.1.in
  79. doc/torify.1: doc/torify.1.in
  80. CLEANFILES+= $(asciidoc_product)
  81. DISTCLEANFILES+= $(html_in) $(man_in)