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