include.am 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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 = doc/tor doc/tor-gencert doc/tor-resolve doc/torify
  15. all_mans = $(regular_mans) doc/tor-fw-helper
  16. if USE_ASCIIDOC
  17. if USE_FW_HELPER
  18. nodist_man1_MANS = $(all_mans:=.1)
  19. doc_DATA = $(all_mans:=.html)
  20. else
  21. nodist_man1_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_man1_MANS =
  32. doc_DATA =
  33. endif
  34. EXTRA_DIST+= doc/HACKING doc/asciidoc-helper.sh \
  35. $(html_in) $(man_in) $(txt_in) \
  36. doc/tor-rpm-creation.txt \
  37. doc/tor-win32-mingw-creation.txt doc/spec/README \
  38. doc/state-contents.txt
  39. docdir = @docdir@
  40. asciidoc_product = $(nodist_man1_MANS) $(doc_DATA)
  41. # Generate the html documentation from asciidoc, but don't do
  42. # machine-specific replacements yet
  43. $(html_in) : $(txt_in)
  44. $(AM_V_GEN)$(top_srcdir)/doc/asciidoc-helper.sh html @ASCIIDOC@ $(top_srcdir)/$@
  45. # Generate the manpage from asciidoc, but don't do
  46. # machine-specific replacements yet
  47. $(man_in) : $(txt_in)
  48. $(AM_V_GEN)$(top_srcdir)/doc/asciidoc-helper.sh man @A2X@ $(top_srcdir)/$@
  49. # use ../config.status to swap all machine-specific magic strings
  50. # in the asciidoc with their replacements.
  51. $(asciidoc_product) : $(txt_in) $(man_in)
  52. $(AM_V_GEN)$(MKDIR_P) $(@D)
  53. $(AM_V_at)if test -e $(top_srcdir)/$@.in && ! test -e $@.in ; then \
  54. cp $(top_srcdir)/$@.in $@; \
  55. fi
  56. $(AM_V_at)./config.status -q --file=$@;
  57. $(doc_DATA) : $(html_in)
  58. CLEANFILES+= $(asciidoc_product) config.log
  59. DISTCLEANFILES+= $(html_in) $(man_in)