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 all_mans = doc/man/tor doc/man/tor-gencert doc/man/tor-resolve doc/man/torify doc/man/tor-print-ed-signing-cert
18 txt_in = $(all_mans:=.1.txt)
21 html_in = $(all_mans:=.html.in)
22 doc_DATA = $(all_mans:=.html)
29 nodist_man1_MANS = $(all_mans:=.1)
30 man_in = $(all_mans:=.1.in)
46 EXTRA_DIST+= doc/asciidoc-helper.sh \
47 $(html_in) $(man_in) $(txt_in) \
48 doc/state-contents.txt \
49 doc/torrc_format.txt \
52 doc/HACKING/README.1st.md \
53 doc/HACKING/CodingStandards.md \
54 doc/HACKING/Fuzzing.md \
55 doc/HACKING/GettingStarted.md \
56 doc/HACKING/HelpfulTools.md \
57 doc/HACKING/HowToReview.md \
58 doc/HACKING/Module.md \
59 doc/HACKING/ReleasingTor.md \
60 doc/HACKING/WritingTests.md
61 doc/HACKING/tracing/Tracing.md \
62 doc/HACKING/tracing/EventsCircuit.md
66 asciidoc_product = $(nodist_man1_MANS) $(doc_DATA)
68 # Generate the html documentation from asciidoc, but don't do
69 # machine-specific replacements yet
71 $(AM_V_GEN)$(top_srcdir)/doc/asciidoc-helper.sh html @ASCIIDOC@ $(top_srcdir)/$@
73 # Generate the manpage from asciidoc, but don't do
74 # machine-specific replacements yet
76 $(AM_V_GEN)$(top_srcdir)/doc/asciidoc-helper.sh man @A2X@ $(top_srcdir)/$@
78 doc/man/tor.1.in: doc/man/tor.1.txt
79 doc/man/torify.1.in: doc/man/torify.1.txt
80 doc/man/tor-gencert.1.in: doc/man/tor-gencert.1.txt
81 doc/man/tor-resolve.1.in: doc/man/tor-resolve.1.txt
82 doc/man/tor-print-ed-signing-cert.1.in: doc/man/tor-print-ed-signing-cert.1.txt
84 doc/man/tor.html.in: doc/man/tor.1.txt
85 doc/man/torify.html.in: doc/man/torify.1.txt
86 doc/man/tor-gencert.html.in: doc/man/tor-gencert.1.txt
87 doc/man/tor-resolve.html.in: doc/man/tor-resolve.1.txt
88 doc/man/tor-print-ed-signing-cert.html.in: doc/man/tor-print-ed-signing-cert.1.txt
90 # use config.status to swap all machine-specific magic strings
91 # in the asciidoc with their replacements.
93 $(AM_V_GEN)$(MKDIR_P) $(@D)
94 $(AM_V_at)if test -e $(top_srcdir)/$@.in && ! test -e $@.in ; then \
95 cp $(top_srcdir)/$@.in $@; \
97 $(AM_V_at)$(top_builddir)/config.status -q --file=$@;
99 doc/man/tor.html: doc/man/tor.html.in
100 doc/man/tor-gencert.html: doc/man/tor-gencert.html.in
101 doc/man/tor-resolve.html: doc/man/tor-resolve.html.in
102 doc/man/tor-print-ed-signing-cert.html: doc/man/tor-print-ed-signing-cert.html.in
103 doc/man/torify.html: doc/man/torify.html.in
105 doc/man/tor.1: doc/man/tor.1.in
106 doc/man/tor-gencert.1: doc/man/tor-gencert.1.in
107 doc/man/tor-resolve.1: doc/man/tor-resolve.1.in
108 doc/man/tor-print-ed-signing-cert.1: doc/man/tor-print-ed-signing-cert.1.in
109 doc/man/torify.1: doc/man/torify.1.in
111 CLEANFILES+= $(asciidoc_product)
112 DISTCLEANFILES+= $(html_in) $(man_in)