include.am 2.9 KB

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