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