Makefile.am 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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
  33. docdir = @docdir@
  34. asciidoc_product = $(nodist_man_MANS) $(doc_DATA)
  35. SUBDIRS = spec
  36. DIST_SUBDIRS = spec
  37. # Generate the html documentation from asciidoc, but don't do
  38. # machine-specific replacements yet
  39. $(html_in) :
  40. $(top_srcdir)/doc/asciidoc-helper.sh html @ASCIIDOC@ $(top_srcdir)/doc/$@
  41. tor.html.in : tor.1.txt
  42. torify.html.in : torify.1.txt
  43. tor-gencert.html.in : tor-gencert.1.txt
  44. tor-resolve.html.in : tor-resolve.1.txt
  45. # Generate the manpage from asciidoc, but don't do
  46. # machine-specific replacements yet
  47. $(man_in) :
  48. $(top_srcdir)/doc/asciidoc-helper.sh man @A2X@ $(top_srcdir)/doc/$@
  49. tor.1.in : tor.1.txt
  50. torify.1.in : torify.1.txt
  51. tor-gencert.1.in : tor-gencert.1.txt
  52. tor-resolve.1.in : tor-resolve.1.txt
  53. # use ../config.status to swap all machine-specific magic strings
  54. # in the asciidoc with their replacements.
  55. $(asciidoc_product) :
  56. if test -e $(top_srcdir)/doc/$@.in && ! test -e ./$@.in ; then \
  57. cp $(top_srcdir)/doc/$@.in .; \
  58. fi
  59. ../config.status --file=$@;
  60. tor.1 : tor.1.in
  61. torify.1 : torify.1.in
  62. tor-gencert.1 : tor-gencert.1.in
  63. tor-resolve.1 : tor-resolve.1.in
  64. tor.html : tor.html.in
  65. torify.html : torify.html.in
  66. tor-gencert.html : tor-gencert.html.in
  67. tor-resolve.html : tor-resolve.html.in
  68. CLEANFILES = $(asciidoc_product) config.log
  69. DISTCLEANFILES = $(html_in) $(man_in)