include.am 3.4 KB

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