Merge branch 'maint-0.3.5' into maint-0.4.3
[tor.git] / doc / include.am
blob8651f845eb0fedd8f8be71a358d615287069b9d4
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/tor doc/tor-gencert doc/tor-resolve doc/torify doc/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/CodingStandardsRust.md                 \
55              doc/HACKING/CodeStructure.md                       \
56              doc/HACKING/Fuzzing.md                             \
57              doc/HACKING/GettingStarted.md                      \
58              doc/HACKING/GettingStartedRust.md                  \
59              doc/HACKING/HelpfulTools.md                        \
60              doc/HACKING/HowToReview.md                         \
61              doc/HACKING/Module.md                              \
62              doc/HACKING/ReleasingTor.md                        \
63              doc/HACKING/Tracing.md                             \
64              doc/HACKING/WritingTests.md
66 docdir = @docdir@
68 asciidoc_product = $(nodist_man1_MANS) $(doc_DATA)
70 # Generate the html documentation from asciidoc, but don't do
71 # machine-specific replacements yet
72 $(html_in) :
73         $(AM_V_GEN)$(top_srcdir)/doc/asciidoc-helper.sh html @ASCIIDOC@ $(top_srcdir)/$@
75 # Generate the manpage from asciidoc, but don't do
76 # machine-specific replacements yet
77 $(man_in) :
78         $(AM_V_GEN)$(top_srcdir)/doc/asciidoc-helper.sh man @A2X@ $(top_srcdir)/$@
80 doc/tor.1.in: doc/tor.1.txt
81 doc/torify.1.in: doc/torify.1.txt
82 doc/tor-gencert.1.in: doc/tor-gencert.1.txt
83 doc/tor-resolve.1.in: doc/tor-resolve.1.txt
84 doc/tor-print-ed-signing-cert.1.in: doc/tor-print-ed-signing-cert.1.txt
86 doc/tor.html.in: doc/tor.1.txt
87 doc/torify.html.in: doc/torify.1.txt
88 doc/tor-gencert.html.in: doc/tor-gencert.1.txt
89 doc/tor-resolve.html.in: doc/tor-resolve.1.txt
90 doc/tor-print-ed-signing-cert.html.in: doc/tor-print-ed-signing-cert.1.txt
92 # use config.status to swap all machine-specific magic strings
93 # in the asciidoc with their replacements.
94 $(asciidoc_product) :
95         $(AM_V_GEN)$(MKDIR_P) $(@D)
96         $(AM_V_at)if test -e $(top_srcdir)/$@.in && ! test -e $@.in ; then \
97                 cp $(top_srcdir)/$@.in $@; \
98         fi
99         $(AM_V_at)$(top_builddir)/config.status -q --file=$@;
101 doc/tor.html: doc/tor.html.in
102 doc/tor-gencert.html: doc/tor-gencert.html.in
103 doc/tor-resolve.html: doc/tor-resolve.html.in
104 doc/tor-print-ed-signing-cert.html: doc/tor-print-ed-signing-cert.html.in
105 doc/torify.html: doc/torify.html.in
107 doc/tor.1: doc/tor.1.in
108 doc/tor-gencert.1: doc/tor-gencert.1.in
109 doc/tor-resolve.1: doc/tor-resolve.1.in
110 doc/tor-print-ed-signing-cert.1: doc/tor-print-ed-signing-cert.1.in
111 doc/torify.1: doc/torify.1.in
113 CLEANFILES+= $(asciidoc_product)
114 DISTCLEANFILES+= $(html_in) $(man_in)