doc/man: create lttng-disable-event(1) and update/fix content
[lttng-tools.git] / doc / man / Makefile.am
CommitLineData
ceb84f55
PP
1# Man pages are only built if the --enable-build-man-pages option was passed
2# to the configure script.
3#
4# They should always be built before creating a distribution tarball.
5
6# function which adds the source directory prefix and adds a given suffix
7manaddsuffix = $(addsuffix $(1),$(addprefix $(srcdir)/,$(2)))
8
9# List only the names without the .*.txt extension here:
10MAN1_NAMES = \
ba50d967 11 lttng \
7bf169bd 12 lttng-create \
9d4408b8 13 lttng-destroy \
b3903b3a 14 lttng-set-session \
44f5039e 15 lttng-save \
30ec772c 16 lttng-load \
fb58d659 17 lttng-start \
e85eccc8 18 lttng-stop \
79e094df 19 lttng-version \
b4867b3b 20 lttng-view \
4bf0a332 21 lttng-enable-channel \
2e4886b8 22 lttng-disable-channel \
882108c6 23 lttng-add-context \
89dbeff8 24 lttng-list \
65226554 25 lttng-calibrate \
882443a6 26 lttng-track \
18d6fa61 27 lttng-untrack \
afaad15a 28 lttng-status \
12397c59 29 lttng-help \
e9b06e2b 30 lttng-snapshot \
290294e8
PP
31 lttng-enable-event \
32 lttng-disable-event
ceb84f55
PP
33MAN3_NAMES =
34MAN8_NAMES =
35MAN1_NO_ASCIIDOC_NAMES = lttng-crash
36MAN3_NO_ASCIIDOC_NAMES =
37MAN8_NO_ASCIIDOC_NAMES = lttng-relayd lttng-sessiond
38
39# man pages destinations
40MAN1 = $(call manaddsuffix,.1,$(MAN1_NAMES))
41MAN3 = $(call manaddsuffix,.3,$(MAN3_NAMES))
42MAN8 = $(call manaddsuffix,.8,$(MAN8_NAMES))
43MAN1_NO_ASCIIDOC = $(call manaddsuffix,.1,$(MAN1_NO_ASCIIDOC_NAMES))
44MAN3_NO_ASCIIDOC = $(call manaddsuffix,.3,$(MAN3_NO_ASCIIDOC_NAMES))
45MAN8_NO_ASCIIDOC = $(call manaddsuffix,.8,$(MAN8_NO_ASCIIDOC_NAMES))
46MAN = $(MAN1) $(MAN3) $(MAN8)
47
48# those are always installed since they are written in troff
49dist_man1_MANS = $(MAN1_NO_ASCIIDOC)
50dist_man3_MANS = $(MAN3_NO_ASCIIDOC)
51dist_man8_MANS = $(MAN8_NO_ASCIIDOC)
52
53# only build man pages if it was enabled
54if BUILD_MAN_PAGES
55# dist + install
56dist_man1_MANS += $(MAN1)
57dist_man3_MANS += $(MAN3)
58dist_man8_MANS += $(MAN8)
59
60# AsciiDoc sources and outputs
61MAN1_TXT = $(call manaddsuffix,.1.txt,$(MAN1_NAMES))
62MAN3_TXT = $(call manaddsuffix,.3.txt,$(MAN3_NAMES))
63MAN8_TXT = $(call manaddsuffix,.8.txt,$(MAN8_NAMES))
64MAN_TXT = $(MAN1_TXT) $(MAN3_TXT) $(MAN8_TXT)
65MAN_XML = $(patsubst $(srcdir)/%.txt,%.xml,$(MAN_TXT))
66
67# common AsciiDoc source files
68COMMON_TXT = \
69 $(srcdir)/common-footer.txt \
83f27f71 70 $(srcdir)/common-cmd-footer.txt \
ba50d967
PP
71 $(srcdir)/common-cmd-options-head.txt \
72 $(srcdir)/common-cmd-help-options.txt
ceb84f55
PP
73
74# config
75ASCIIDOC_CONF = $(srcdir)/asciidoc.conf
76XSL_FILES = \
77 manpage.xsl \
78 manpage-base.xsl \
79 manpage-bold-literal.xsl \
80 manpage-ulinks.xsl
81XSL_SRC_FILES = $(addprefix $(srcdir)/xsl/,$(XSL_FILES))
82
83# common dependencies
84COMMON_DEPS = $(ASCIIDOC_CONF) $(COMMON_TXT)
85
86# tools
87ADOC = $(ASCIIDOC) -f $(ASCIIDOC_CONF) -d manpage \
88 -a lttng_version=$(PACKAGE_VERSION)
89ADOC_DOCBOOK = $(ADOC) -b docbook
90XTO = $(XMLTO) -m $(firstword $(XSL_SRC_FILES)) man
91
92# recipes
93%.1.xml: $(srcdir)/%.1.txt $(COMMON_DEPS)
94 $(ADOC_DOCBOOK) -o $@ $<
95
96%.1: %.1.xml $(XSL_SRC_FILES)
97 $(XTO) $<
98
99%.3.xml: $(srcdir)/%.3.txt $(COMMON_DEPS)
100 $(ADOC_DOCBOOK) -o $@ $<
101
102%.3: %.3.xml $(XSL_SRC_FILES)
103 $(XTO) $<
104
105%.8.xml: $(srcdir)/%.8.txt $(COMMON_DEPS)
106 $(ADOC_DOCBOOK) -o $@ $<
107
108%.8: %.8.xml $(XSL_SRC_FILES)
109 $(XTO) $<
110
111clean-local:
112 rm -rf $(MAN_XML)
113 rm -rf $(MAN)
114else
115if IN_GIT_REPO
116# we are in the Git repo: the man pages should be built for distribution
117dist-hook:
118 @echo
119 @echo 'Error: Please build the man pages before creating a tarball.'
120 @echo
121 @false
122else
123# we are in the tarball, hence the man pages are already built
124dist_man1_MANS += $(MAN1)
125dist_man3_MANS += $(MAN3)
126dist_man8_MANS += $(MAN8)
127endif # IN_GIT_REPO
128endif # BUILD_MAN_PAGES
This page took 0.040348 seconds and 4 git commands to generate.