Makefile.am 2.3 KB

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