Makefile.am 2.7 KB

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