Makefile.am 2.3 KB

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