lttng: Add list-triggers command
[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
SM
40 lttng-add-trigger \
41 lttng-list-triggers
a942557f 42
ceb84f55 43MAN3_NAMES =
f5595c32 44MAN8_NAMES = lttng-sessiond lttng-relayd
aec4668a 45MAN1_NO_ASCIIDOC_NAMES =
23225252 46MAN3_NO_ASCIIDOC_NAMES = lttng-health-check
f5595c32 47MAN8_NO_ASCIIDOC_NAMES =
ceb84f55 48
ceb84f55
PP
49# AsciiDoc sources and outputs
50MAN1_TXT = $(call manaddsuffix,.1.txt,$(MAN1_NAMES))
51MAN3_TXT = $(call manaddsuffix,.3.txt,$(MAN3_NAMES))
52MAN8_TXT = $(call manaddsuffix,.8.txt,$(MAN8_NAMES))
53MAN_TXT = $(MAN1_TXT) $(MAN3_TXT) $(MAN8_TXT)
54MAN_XML = $(patsubst $(srcdir)/%.txt,%.xml,$(MAN_TXT))
55
56# common AsciiDoc source files
57COMMON_TXT = \
58 $(srcdir)/common-footer.txt \
83f27f71 59 $(srcdir)/common-cmd-footer.txt \
ba50d967
PP
60 $(srcdir)/common-cmd-options-head.txt \
61 $(srcdir)/common-cmd-help-options.txt
ceb84f55
PP
62
63# config
767ab8b2 64ASCIIDOC_CONF = $(srcdir)/asciidoc.conf
c4ee4984 65ASCIIDOC_ATTRS_CONF = $(builddir)/asciidoc-attrs.conf
360c4f63 66XSL_FILE = $(srcdir)/manpage.xsl
ceb84f55
PP
67
68# common dependencies
fd3e1238 69COMMON_DEPS = $(ASCIIDOC_CONF) $(COMMON_TXT)
ceb84f55 70
a3eae3c9
PP
71# man pages destinations
72MAN1 = $(addsuffix .1,$(MAN1_NAMES))
73MAN3 = $(addsuffix .3,$(MAN3_NAMES))
74MAN8 = $(addsuffix .8,$(MAN8_NAMES))
75MAN1_NO_ASCIIDOC = $(addsuffix .1,$(MAN1_NO_ASCIIDOC_NAMES))
76MAN3_NO_ASCIIDOC = $(addsuffix .3,$(MAN3_NO_ASCIIDOC_NAMES))
77MAN8_NO_ASCIIDOC = $(addsuffix .8,$(MAN8_NO_ASCIIDOC_NAMES))
78MAN = $(MAN1) $(MAN3) $(MAN8)
79
4fc83d94
PP
80# initially empty
81CLEANFILES =
82
83if EMBED_HELP
98477e49
MJ
84mantoh_verbose = $(mantoh_verbose_@AM_V@)
85mantoh_verbose_ = $(mantoh_verbose_@AM_DEFAULT_V@)
86mantoh_verbose_0 = @echo " MANTOH " $@;
87
4fc83d94
PP
88MAN1_H = $(addsuffix .1.h,$(MAN1_NAMES))
89MAN3_H = $(addsuffix .3.h,$(MAN3_NAMES))
90MAN8_H = $(addsuffix .8.h,$(MAN8_NAMES))
91MAN_H = $(MAN1_H) $(MAN3_H) $(MAN8_H)
92MAN_H_RECIPE = \
98477e49 93 $(mantoh_verbose_0)\
4fc83d94
PP
94 MANWIDTH=80 @MANPROG@ --encoding=UTF-8 --no-hyphenation --no-justification --local-file $< > $@ ; \
95 $(SED) -i 's/\\/\\\\/g' $@ ; \
96 $(SED) -i 's/"/\\"/g' $@ ; \
97 $(SED) -i 's/^\(.*\)$$/"\1\\n"/' $@
98
99%.1.h: %.1
100 $(MAN_H_RECIPE)
101
102%.3.h: %.3
103 $(MAN_H_RECIPE)
104
105%.8.h: %.8
106 $(MAN_H_RECIPE)
107
108all-local: $(MAN_H)
109
110CLEANFILES += $(MAN_H)
111endif # EMBED_HELP
112
a3eae3c9
PP
113if MAN_PAGES_OPT
114# at this point, we know the user asked to build the man pages
115if HAVE_ASCIIDOC_XMLTO
98477e49
MJ
116
117asciidoc_verbose = $(asciidoc_verbose_@AM_V@)
118asciidoc_verbose_ = $(asciidoc_verbose_@AM_DEFAULT_V@)
119asciidoc_verbose_0 = @echo " ASCIIDOC " $@;
120
121xmlto_verbose = $(xmlto_verbose_@AM_V@)
122xmlto_verbose_ = $(xmlto_verbose_@AM_DEFAULT_V@)
123xmlto_verbose_0 = @echo " XMLTO " $@;
124
ceb84f55 125# tools
98477e49 126ADOC = $(asciidoc_verbose)$(ASCIIDOC) -f $(ASCIIDOC_CONF) -f $(ASCIIDOC_ATTRS_CONF) -d manpage
ceb84f55 127ADOC_DOCBOOK = $(ADOC) -b docbook
360c4f63 128XTO = $(xmlto_verbose)$(XMLTO) -m $(XSL_FILE) man
ceb84f55 129
fd3e1238
PP
130# only add this dependency if we can build the man pages because it's
131# a file generated by the configure script, so it's more recent than
132# the pregenerated man pages in a tarball
133COMMON_DEPS += $(ASCIIDOC_ATTRS_CONF)
134
ceb84f55
PP
135# recipes
136%.1.xml: $(srcdir)/%.1.txt $(COMMON_DEPS)
137 $(ADOC_DOCBOOK) -o $@ $<
138
360c4f63 139%.1: %.1.xml $(XSL_FILE)
98477e49 140 $(XTO) $< 2>/dev/null
ceb84f55
PP
141
142%.3.xml: $(srcdir)/%.3.txt $(COMMON_DEPS)
143 $(ADOC_DOCBOOK) -o $@ $<
144
360c4f63 145%.3: %.3.xml $(XSL_FILE)
98477e49 146 $(XTO) $< 2>/dev/null
ceb84f55
PP
147
148%.8.xml: $(srcdir)/%.8.txt $(COMMON_DEPS)
149 $(ADOC_DOCBOOK) -o $@ $<
150
360c4f63 151%.8: %.8.xml $(XSL_FILE)
98477e49 152 $(XTO) $< 2>/dev/null
ceb84f55 153
a3eae3c9 154# only clean the generated files if we have the tools to generate them again
4fc83d94 155CLEANFILES += $(MAN_XML) $(MAN)
a3eae3c9
PP
156else # HAVE_ASCIIDOC_XMLTO
157# create man page targets used to stop the build if we want to
158# build the man pages, but we don't have the necessary tools to do so
159ERR_MSG = "Error: Cannot build target because asciidoc or xmlto tool is missing."
160ERR_MSG += "Make sure both tools are installed and run the configure script again."
161
162%.1: $(srcdir)/%.1.txt $(COMMON_DEPS)
163 @echo $(ERR_MSG)
164 @false
165
166%.3: $(srcdir)/%.3.txt $(COMMON_DEPS)
167 @echo $(ERR_MSG)
168 @false
169
170%.8: $(srcdir)/%.8.txt $(COMMON_DEPS)
171 @echo $(ERR_MSG)
ceb84f55 172 @false
a3eae3c9
PP
173endif # HAVE_ASCIIDOC_XMLTO
174endif # MAN_PAGES_OPT
175
176# those are always installed since they are directly written in troff
177dist_man1_MANS = $(MAN1_NO_ASCIIDOC)
178dist_man3_MANS = $(MAN3_NO_ASCIIDOC)
179dist_man8_MANS = $(MAN8_NO_ASCIIDOC)
180
181if MAN_PAGES_OPT
182# building man pages: we can install and distribute them
ceb84f55
PP
183dist_man1_MANS += $(MAN1)
184dist_man3_MANS += $(MAN3)
185dist_man8_MANS += $(MAN8)
a3eae3c9
PP
186endif # MAN_PAGES_OPT
187
2f1c0906
PP
188if !MAN_PAGES_OPT
189dist-hook:
190 @echo "Error: Please enable the man pages before creating a distribution tarball."
191 @false
192endif # !MAN_PAGES_OPT
193
a3eae3c9 194# always distribute the source files
360c4f63 195EXTRA_DIST = $(MAN_TXT) $(COMMON_TXT) $(XSL_FILE) \
c4ee4984 196 $(ASCIIDOC_CONF) $(ASCIIDOC_ATTRS_CONF).in
4fc83d94
PP
197
198# keep generated man pages that can be considered intermediate files
199.PRECIOUS: %.1 %.3 %.8
This page took 0.039568 seconds and 4 git commands to generate.