Merge branch 'tor-gitlab/mr/711'
[tor.git] / doc / include.am
blob7570978ddbb92c9627c780f73ab436a5f51b202d
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
17 if USE_ASCIIDOC
18 txt_in = $(all_mans:=.1.txt)
20 if BUILD_HTML_DOCS
21 html_in = $(all_mans:=.html.in)
22 doc_DATA = $(all_mans:=.html)
23 else
24 html_in =
25 doc_DATA =
26 endif
28 if BUILD_MANPAGE
29 nodist_man1_MANS = $(all_mans:=.1)
30 man_in = $(all_mans:=.1.in)
31 else
32 nodist_man1_MANS =
33 man_in =
34 endif
36 else
38 html_in =
39 doc_DATA =
40 man_in =
41 txt_in =
42 nodist_man1_MANS =
44 endif
46 EXTRA_DIST+= doc/asciidoc-helper.sh                     \
47              $(html_in) $(man_in) $(txt_in)                     \
48              doc/state-contents.txt                             \
49              doc/torrc_format.txt                               \
50              doc/tor-doxygen.css                                \
51              doc/TUNING                                         \
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/EventsCircuit.md               \
62              doc/HACKING/tracing/README.md
64 docdir = @docdir@
66 asciidoc_product = $(nodist_man1_MANS) $(doc_DATA)
68 # Generate the html documentation from asciidoc, but don't do
69 # machine-specific replacements yet
70 $(html_in) :
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
75 $(man_in) :
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.
92 $(asciidoc_product) :
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 $@; \
96         fi
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)