Merge branch 'maint-0.2.4' into release-0.2.4
[tor.git] / doc / include.am
blob9695292bdf4b4c474cc1e7fc72634567a3cd04ca
1 # We use a two-step process to generate documentation from asciidoc files.
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.
8 # Second, we use config.status to turn .1.in files into .1 files and
9 # .html.in files into .html files.
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.
15 regular_mans = doc/tor doc/tor-gencert doc/tor-resolve doc/torify
16 all_mans = $(regular_mans) doc/tor-fw-helper
18 if USE_ASCIIDOC
19 if USE_FW_HELPER
20 nodist_man1_MANS = $(all_mans:=.1)
21 doc_DATA = $(all_mans:=.html)
22 else
23 nodist_man1_MANS = $(regular_mans:=.1)
24 doc_DATA = $(regular_mans:=.html)
25 endif
26 html_in = $(all_mans:=.html.in)
27 man_in = $(all_mans:=.1.in)
28 txt_in = $(all_mans:=.1.txt)
29 else
30 html_in =
31 man_in =
32 txt_in =
33 nodist_man1_MANS =
34 doc_DATA =
35 endif
37 EXTRA_DIST+= doc/HACKING doc/asciidoc-helper.sh                 \
38              $(html_in) $(man_in) $(txt_in)                     \
39              doc/state-contents.txt
41 docdir = @docdir@
43 asciidoc_product = $(nodist_man1_MANS) $(doc_DATA)
45 # Generate the html documentation from asciidoc, but don't do
46 # machine-specific replacements yet
47 $(html_in) :
48         $(AM_V_GEN)$(top_srcdir)/doc/asciidoc-helper.sh html @ASCIIDOC@ $(top_srcdir)/$@
50 # Generate the manpage from asciidoc, but don't do
51 # machine-specific replacements yet
52 $(man_in) :
53         $(AM_V_GEN)$(top_srcdir)/doc/asciidoc-helper.sh man @A2X@ $(top_srcdir)/$@
55 doc/tor.1.in: doc/tor.1.txt
56 doc/tor-gencert.1.in: doc/tor-gencert.1.txt
57 doc/tor-resolve.1.in: doc/tor-resolve.1.txt
58 doc/torify.1.in: doc/torify.1.txt
59 doc/tor-fw-helper.1.in: doc/tor-fw-helper.1.txt
61 doc/tor.html.in: doc/tor.1.txt
62 doc/tor-gencert.html.in: doc/tor-gencert.1.txt
63 doc/tor-resolve.html.in: doc/tor-resolve.1.txt
64 doc/torify.html.in: doc/torify.1.txt
65 doc/tor-fw-helper.html.in: doc/tor-fw-helper.1.txt
67 # use ../config.status to swap all machine-specific magic strings
68 # in the asciidoc with their replacements.
69 $(asciidoc_product) :
70         $(AM_V_GEN)$(MKDIR_P) $(@D)
71         $(AM_V_at)if test -e $(top_srcdir)/$@.in && ! test -e $@.in ; then \
72                 cp $(top_srcdir)/$@.in $@; \
73         fi
74         $(AM_V_at)./config.status -q --file=$@;
76 doc/tor.html: doc/tor.html.in
77 doc/tor-gencert.html: doc/tor-gencert.html.in
78 doc/tor-resolve.html: doc/tor-resolve.html.in
79 doc/torify.html: doc/torify.html.in
80 doc/tor-fw-helper.html: doc/tor-fw-helper.html.in
82 doc/tor.1: doc/tor.1.in
83 doc/tor-gencert.1: doc/tor-gencert.1.in
84 doc/tor-resolve.1: doc/tor-resolve.1.in
85 doc/torify.1: doc/torify.1.in
86 doc/tor-fw-helper.1: doc/tor-fw-helper.1.in
88 CLEANFILES+= $(asciidoc_product) config.log
89 DISTCLEANFILES+= $(html_in) $(man_in)