Makefile.am 2.4 KB

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