LTTNG-RELAYD(8): document the --fd-pool-size option
[lttng-tools.git] / doc / man / Makefile.am
... / ...
CommitLineData
1# Man pages are only built if they are enabled at configure time.
2#
3# They should always be built before creating a distribution tarball.
4
5# function which adds the source directory prefix and adds a given suffix
6manaddsuffix = $(addsuffix $(1),$(addprefix $(srcdir)/,$(2)))
7
8# List only the names without the .*.txt extension here:
9MAN1_NAMES = \
10 lttng \
11 lttng-create \
12 lttng-destroy \
13 lttng-set-session \
14 lttng-save \
15 lttng-load \
16 lttng-start \
17 lttng-stop \
18 lttng-version \
19 lttng-view \
20 lttng-enable-channel \
21 lttng-disable-channel \
22 lttng-add-context \
23 lttng-list \
24 lttng-track \
25 lttng-untrack \
26 lttng-status \
27 lttng-help \
28 lttng-snapshot \
29 lttng-enable-event \
30 lttng-disable-event \
31 lttng-crash \
32 lttng-metadata \
33 lttng-regenerate \
34 lttng-rotate \
35 lttng-enable-rotation \
36 lttng-disable-rotation \
37 lttng-clear
38MAN3_NAMES =
39MAN8_NAMES = lttng-sessiond lttng-relayd
40MAN1_NO_ASCIIDOC_NAMES =
41MAN3_NO_ASCIIDOC_NAMES = lttng-health-check
42MAN8_NO_ASCIIDOC_NAMES =
43
44# AsciiDoc sources and outputs
45MAN1_TXT = $(call manaddsuffix,.1.txt,$(MAN1_NAMES))
46MAN3_TXT = $(call manaddsuffix,.3.txt,$(MAN3_NAMES))
47MAN8_TXT = $(call manaddsuffix,.8.txt,$(MAN8_NAMES))
48MAN_TXT = $(MAN1_TXT) $(MAN3_TXT) $(MAN8_TXT)
49MAN_XML = $(patsubst $(srcdir)/%.txt,%.xml,$(MAN_TXT))
50
51# common AsciiDoc source files
52COMMON_TXT = \
53 $(srcdir)/common-footer.txt \
54 $(srcdir)/common-cmd-footer.txt \
55 $(srcdir)/common-cmd-options-head.txt \
56 $(srcdir)/common-cmd-help-options.txt
57
58# config
59ASCIIDOC_CONF = $(srcdir)/asciidoc.conf
60ASCIIDOC_ATTRS_CONF = $(builddir)/asciidoc-attrs.conf
61XSL_FILE = $(srcdir)/manpage.xsl
62
63# common dependencies
64COMMON_DEPS = $(ASCIIDOC_CONF) $(COMMON_TXT)
65
66# man pages destinations
67MAN1 = $(addsuffix .1,$(MAN1_NAMES))
68MAN3 = $(addsuffix .3,$(MAN3_NAMES))
69MAN8 = $(addsuffix .8,$(MAN8_NAMES))
70MAN1_NO_ASCIIDOC = $(addsuffix .1,$(MAN1_NO_ASCIIDOC_NAMES))
71MAN3_NO_ASCIIDOC = $(addsuffix .3,$(MAN3_NO_ASCIIDOC_NAMES))
72MAN8_NO_ASCIIDOC = $(addsuffix .8,$(MAN8_NO_ASCIIDOC_NAMES))
73MAN = $(MAN1) $(MAN3) $(MAN8)
74
75# initially empty
76CLEANFILES =
77
78if EMBED_HELP
79mantoh_verbose = $(mantoh_verbose_@AM_V@)
80mantoh_verbose_ = $(mantoh_verbose_@AM_DEFAULT_V@)
81mantoh_verbose_0 = @echo " MANTOH " $@;
82
83MAN1_H = $(addsuffix .1.h,$(MAN1_NAMES))
84MAN3_H = $(addsuffix .3.h,$(MAN3_NAMES))
85MAN8_H = $(addsuffix .8.h,$(MAN8_NAMES))
86MAN_H = $(MAN1_H) $(MAN3_H) $(MAN8_H)
87MAN_H_RECIPE = \
88 $(mantoh_verbose_0)\
89 MANWIDTH=80 @MANPROG@ --encoding=UTF-8 --no-hyphenation --no-justification --local-file $< > $@ ; \
90 $(SED) -i 's/\\/\\\\/g' $@ ; \
91 $(SED) -i 's/"/\\"/g' $@ ; \
92 $(SED) -i 's/^\(.*\)$$/"\1\\n"/' $@
93
94%.1.h: %.1
95 $(MAN_H_RECIPE)
96
97%.3.h: %.3
98 $(MAN_H_RECIPE)
99
100%.8.h: %.8
101 $(MAN_H_RECIPE)
102
103all-local: $(MAN_H)
104
105CLEANFILES += $(MAN_H)
106endif # EMBED_HELP
107
108if MAN_PAGES_OPT
109# at this point, we know the user asked to build the man pages
110if HAVE_ASCIIDOC_XMLTO
111
112asciidoc_verbose = $(asciidoc_verbose_@AM_V@)
113asciidoc_verbose_ = $(asciidoc_verbose_@AM_DEFAULT_V@)
114asciidoc_verbose_0 = @echo " ASCIIDOC " $@;
115
116xmlto_verbose = $(xmlto_verbose_@AM_V@)
117xmlto_verbose_ = $(xmlto_verbose_@AM_DEFAULT_V@)
118xmlto_verbose_0 = @echo " XMLTO " $@;
119
120# tools
121ADOC = $(asciidoc_verbose)$(ASCIIDOC) -f $(ASCIIDOC_CONF) -f $(ASCIIDOC_ATTRS_CONF) -d manpage
122ADOC_DOCBOOK = $(ADOC) -b docbook
123XTO = $(xmlto_verbose)$(XMLTO) -m $(XSL_FILE) man
124
125# only add this dependency if we can build the man pages because it's
126# a file generated by the configure script, so it's more recent than
127# the pregenerated man pages in a tarball
128COMMON_DEPS += $(ASCIIDOC_ATTRS_CONF)
129
130# recipes
131%.1.xml: $(srcdir)/%.1.txt $(COMMON_DEPS)
132 $(ADOC_DOCBOOK) -o $@ $<
133
134%.1: %.1.xml $(XSL_FILE)
135 $(XTO) $< 2>/dev/null
136
137%.3.xml: $(srcdir)/%.3.txt $(COMMON_DEPS)
138 $(ADOC_DOCBOOK) -o $@ $<
139
140%.3: %.3.xml $(XSL_FILE)
141 $(XTO) $< 2>/dev/null
142
143%.8.xml: $(srcdir)/%.8.txt $(COMMON_DEPS)
144 $(ADOC_DOCBOOK) -o $@ $<
145
146%.8: %.8.xml $(XSL_FILE)
147 $(XTO) $< 2>/dev/null
148
149# only clean the generated files if we have the tools to generate them again
150CLEANFILES += $(MAN_XML) $(MAN)
151else # HAVE_ASCIIDOC_XMLTO
152# create man page targets used to stop the build if we want to
153# build the man pages, but we don't have the necessary tools to do so
154ERR_MSG = "Error: Cannot build target because asciidoc or xmlto tool is missing."
155ERR_MSG += "Make sure both tools are installed and run the configure script again."
156
157%.1: $(srcdir)/%.1.txt $(COMMON_DEPS)
158 @echo $(ERR_MSG)
159 @false
160
161%.3: $(srcdir)/%.3.txt $(COMMON_DEPS)
162 @echo $(ERR_MSG)
163 @false
164
165%.8: $(srcdir)/%.8.txt $(COMMON_DEPS)
166 @echo $(ERR_MSG)
167 @false
168endif # HAVE_ASCIIDOC_XMLTO
169endif # MAN_PAGES_OPT
170
171# those are always installed since they are directly written in troff
172dist_man1_MANS = $(MAN1_NO_ASCIIDOC)
173dist_man3_MANS = $(MAN3_NO_ASCIIDOC)
174dist_man8_MANS = $(MAN8_NO_ASCIIDOC)
175
176if MAN_PAGES_OPT
177# building man pages: we can install and distribute them
178dist_man1_MANS += $(MAN1)
179dist_man3_MANS += $(MAN3)
180dist_man8_MANS += $(MAN8)
181endif # MAN_PAGES_OPT
182
183if !MAN_PAGES_OPT
184dist-hook:
185 @echo "Error: Please enable the man pages before creating a distribution tarball."
186 @false
187endif # !MAN_PAGES_OPT
188
189# always distribute the source files
190EXTRA_DIST = $(MAN_TXT) $(COMMON_TXT) $(XSL_FILE) \
191 $(ASCIIDOC_CONF) $(ASCIIDOC_ATTRS_CONF).in
192
193# keep generated man pages that can be considered intermediate files
194.PRECIOUS: %.1 %.3 %.8
This page took 0.023197 seconds and 4 git commands to generate.