Merge branch 'maint-0.2.1' into maint-0.2.2
[tor.git] / doc / Makefile.am
blobbc3d8df475ccf4973dd3962890bb5744f09a9735
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 if USE_ASCIIDOC
16 asciidoc_files = tor tor-gencert tor-resolve torify
17 html_in = $(asciidoc_files:=.html.in)
18 man_in = $(asciidoc_files:=.1.in)
19 txt_in = $(asciidoc_files:=.1.txt)
20 nodist_man_MANS = $(asciidoc_files:=.1)
21 doc_DATA = $(asciidoc_files:=.html)
22 else
23 asciidoc_files =
24 html_in =
25 man_in =
26 txt_in =
27 nodist_man_MANS =
28 doc_DATA =
29 endif
31 EXTRA_DIST = HACKING asciidoc-helper.sh                      \
32              $(html_in) $(man_in) $(txt_in)                  \
33              tor-rpm-creation.txt                            \
34              tor-win32-mingw-creation.txt spec/README
36 docdir = @docdir@
38 asciidoc_product = $(nodist_man_MANS) $(doc_DATA)
40 # Generate the html documentation from asciidoc, but don't do
41 # machine-specific replacements yet
42 $(html_in) :
43         $(top_srcdir)/doc/asciidoc-helper.sh html @ASCIIDOC@ $(top_srcdir)/doc/$@
45 tor.html.in : tor.1.txt
46 torify.html.in : torify.1.txt
47 tor-gencert.html.in : tor-gencert.1.txt
48 tor-resolve.html.in : tor-resolve.1.txt
50 # Generate the manpage from asciidoc, but don't do
51 # machine-specific replacements yet
52 $(man_in) :
53         $(top_srcdir)/doc/asciidoc-helper.sh man @A2X@ $(top_srcdir)/doc/$@
55 tor.1.in : tor.1.txt
56 torify.1.in : torify.1.txt
57 tor-gencert.1.in : tor-gencert.1.txt
58 tor-resolve.1.in : tor-resolve.1.txt
60 # use ../config.status to swap all machine-specific magic strings
61 # in the asciidoc with their replacements.
62 $(asciidoc_product) :
63         if test -e $(top_srcdir)/doc/$@.in && ! test -e ./$@.in ; then \
64                 cp $(top_srcdir)/doc/$@.in .; \
65         fi
66         ../config.status --file=$@;
68 tor.1 : tor.1.in
69 torify.1 : torify.1.in
70 tor-gencert.1 : tor-gencert.1.in
71 tor-resolve.1 : tor-resolve.1.in
72 tor.html : tor.html.in
73 torify.html : torify.html.in
74 tor-gencert.html : tor-gencert.html.in
75 tor-resolve.html : tor-resolve.html.in
77 CLEANFILES = $(asciidoc_product) config.log
78 DISTCLEANFILES = $(html_in) $(man_in)