Expose monitor timer interval to lttngctl and client
[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_FILES = \
58 manpage.xsl \
59 manpage-callouts.xsl \
60 manpage-bold-literal.xsl \
61 manpage-links.xsl
62XSL_SRC_FILES = $(addprefix $(srcdir)/xsl/,$(XSL_FILES))
63
64# common dependencies
65COMMON_DEPS = $(ASCIIDOC_CONF) $(COMMON_TXT)
66
67# man pages destinations
68MAN1 = $(addsuffix .1,$(MAN1_NAMES))
69MAN3 = $(addsuffix .3,$(MAN3_NAMES))
70MAN8 = $(addsuffix .8,$(MAN8_NAMES))
71MAN1_NO_ASCIIDOC = $(addsuffix .1,$(MAN1_NO_ASCIIDOC_NAMES))
72MAN3_NO_ASCIIDOC = $(addsuffix .3,$(MAN3_NO_ASCIIDOC_NAMES))
73MAN8_NO_ASCIIDOC = $(addsuffix .8,$(MAN8_NO_ASCIIDOC_NAMES))
74MAN = $(MAN1) $(MAN3) $(MAN8)
75
76if MAN_PAGES_OPT
77# at this point, we know the user asked to build the man pages
78if HAVE_ASCIIDOC_XMLTO
79# tools
80ADOC = $(ASCIIDOC) -f $(ASCIIDOC_CONF) -f $(ASCIIDOC_ATTRS_CONF) -d manpage
81ADOC_DOCBOOK = $(ADOC) -b docbook
82XTO = $(XMLTO) -m $(firstword $(XSL_SRC_FILES)) man
83
84# only add this dependency if we can build the man pages because it's
85# a file generated by the configure script, so it's more recent than
86# the pregenerated man pages in a tarball
87COMMON_DEPS += $(ASCIIDOC_ATTRS_CONF)
88
89# recipes
90%.1.xml: $(srcdir)/%.1.txt $(COMMON_DEPS)
91 $(ADOC_DOCBOOK) -o $@ $<
92
93%.1: %.1.xml $(XSL_SRC_FILES)
94 $(XTO) $<
95
96%.3.xml: $(srcdir)/%.3.txt $(COMMON_DEPS)
97 $(ADOC_DOCBOOK) -o $@ $<
98
99%.3: %.3.xml $(XSL_SRC_FILES)
100 $(XTO) $<
101
102%.8.xml: $(srcdir)/%.8.txt $(COMMON_DEPS)
103 $(ADOC_DOCBOOK) -o $@ $<
104
105%.8: %.8.xml $(XSL_SRC_FILES)
106 $(XTO) $<
107
108# only clean the generated files if we have the tools to generate them again
109CLEANFILES = $(MAN_XML) $(MAN)
110else # HAVE_ASCIIDOC_XMLTO
111# create man page targets used to stop the build if we want to
112# build the man pages, but we don't have the necessary tools to do so
113ERR_MSG = "Error: Cannot build target because asciidoc or xmlto tool is missing."
114ERR_MSG += "Make sure both tools are installed and run the configure script again."
115
116%.1: $(srcdir)/%.1.txt $(COMMON_DEPS)
117 @echo $(ERR_MSG)
118 @false
119
120%.3: $(srcdir)/%.3.txt $(COMMON_DEPS)
121 @echo $(ERR_MSG)
122 @false
123
124%.8: $(srcdir)/%.8.txt $(COMMON_DEPS)
125 @echo $(ERR_MSG)
126 @false
127endif # HAVE_ASCIIDOC_XMLTO
128endif # MAN_PAGES_OPT
129
130# those are always installed since they are directly written in troff
131dist_man1_MANS = $(MAN1_NO_ASCIIDOC)
132dist_man3_MANS = $(MAN3_NO_ASCIIDOC)
133dist_man8_MANS = $(MAN8_NO_ASCIIDOC)
134
135if MAN_PAGES_OPT
136# building man pages: we can install and distribute them
137dist_man1_MANS += $(MAN1)
138dist_man3_MANS += $(MAN3)
139dist_man8_MANS += $(MAN8)
140endif # MAN_PAGES_OPT
141
142if !MAN_PAGES_OPT
143dist-hook:
144 @echo "Error: Please enable the man pages before creating a distribution tarball."
145 @false
146endif # !MAN_PAGES_OPT
147
148# always distribute the source files
149EXTRA_DIST = $(MAN_TXT) $(COMMON_TXT) $(XSL_SRC_FILES) \
150 $(ASCIIDOC_CONF) $(ASCIIDOC_ATTRS_CONF).in
This page took 0.02469 seconds and 5 git commands to generate.