doc/man: create lttng-calibrate(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
PP
24 lttng-list \
25 lttng-calibrate
ceb84f55
PP
26MAN3_NAMES =
27MAN8_NAMES =
28MAN1_NO_ASCIIDOC_NAMES = lttng-crash
29MAN3_NO_ASCIIDOC_NAMES =
30MAN8_NO_ASCIIDOC_NAMES = lttng-relayd lttng-sessiond
31
32# man pages destinations
33MAN1 = $(call manaddsuffix,.1,$(MAN1_NAMES))
34MAN3 = $(call manaddsuffix,.3,$(MAN3_NAMES))
35MAN8 = $(call manaddsuffix,.8,$(MAN8_NAMES))
36MAN1_NO_ASCIIDOC = $(call manaddsuffix,.1,$(MAN1_NO_ASCIIDOC_NAMES))
37MAN3_NO_ASCIIDOC = $(call manaddsuffix,.3,$(MAN3_NO_ASCIIDOC_NAMES))
38MAN8_NO_ASCIIDOC = $(call manaddsuffix,.8,$(MAN8_NO_ASCIIDOC_NAMES))
39MAN = $(MAN1) $(MAN3) $(MAN8)
40
41# those are always installed since they are written in troff
42dist_man1_MANS = $(MAN1_NO_ASCIIDOC)
43dist_man3_MANS = $(MAN3_NO_ASCIIDOC)
44dist_man8_MANS = $(MAN8_NO_ASCIIDOC)
45
46# only build man pages if it was enabled
47if BUILD_MAN_PAGES
48# dist + install
49dist_man1_MANS += $(MAN1)
50dist_man3_MANS += $(MAN3)
51dist_man8_MANS += $(MAN8)
52
53# AsciiDoc sources and outputs
54MAN1_TXT = $(call manaddsuffix,.1.txt,$(MAN1_NAMES))
55MAN3_TXT = $(call manaddsuffix,.3.txt,$(MAN3_NAMES))
56MAN8_TXT = $(call manaddsuffix,.8.txt,$(MAN8_NAMES))
57MAN_TXT = $(MAN1_TXT) $(MAN3_TXT) $(MAN8_TXT)
58MAN_XML = $(patsubst $(srcdir)/%.txt,%.xml,$(MAN_TXT))
59
60# common AsciiDoc source files
61COMMON_TXT = \
62 $(srcdir)/common-footer.txt \
83f27f71 63 $(srcdir)/common-cmd-footer.txt \
ba50d967
PP
64 $(srcdir)/common-cmd-options-head.txt \
65 $(srcdir)/common-cmd-help-options.txt
ceb84f55
PP
66
67# config
68ASCIIDOC_CONF = $(srcdir)/asciidoc.conf
69XSL_FILES = \
70 manpage.xsl \
71 manpage-base.xsl \
72 manpage-bold-literal.xsl \
73 manpage-ulinks.xsl
74XSL_SRC_FILES = $(addprefix $(srcdir)/xsl/,$(XSL_FILES))
75
76# common dependencies
77COMMON_DEPS = $(ASCIIDOC_CONF) $(COMMON_TXT)
78
79# tools
80ADOC = $(ASCIIDOC) -f $(ASCIIDOC_CONF) -d manpage \
81 -a lttng_version=$(PACKAGE_VERSION)
82ADOC_DOCBOOK = $(ADOC) -b docbook
83XTO = $(XMLTO) -m $(firstword $(XSL_SRC_FILES)) man
84
85# recipes
86%.1.xml: $(srcdir)/%.1.txt $(COMMON_DEPS)
87 $(ADOC_DOCBOOK) -o $@ $<
88
89%.1: %.1.xml $(XSL_SRC_FILES)
90 $(XTO) $<
91
92%.3.xml: $(srcdir)/%.3.txt $(COMMON_DEPS)
93 $(ADOC_DOCBOOK) -o $@ $<
94
95%.3: %.3.xml $(XSL_SRC_FILES)
96 $(XTO) $<
97
98%.8.xml: $(srcdir)/%.8.txt $(COMMON_DEPS)
99 $(ADOC_DOCBOOK) -o $@ $<
100
101%.8: %.8.xml $(XSL_SRC_FILES)
102 $(XTO) $<
103
104clean-local:
105 rm -rf $(MAN_XML)
106 rm -rf $(MAN)
107else
108if IN_GIT_REPO
109# we are in the Git repo: the man pages should be built for distribution
110dist-hook:
111 @echo
112 @echo 'Error: Please build the man pages before creating a tarball.'
113 @echo
114 @false
115else
116# we are in the tarball, hence the man pages are already built
117dist_man1_MANS += $(MAN1)
118dist_man3_MANS += $(MAN3)
119dist_man8_MANS += $(MAN8)
120endif # IN_GIT_REPO
121endif # BUILD_MAN_PAGES
This page took 0.027112 seconds and 4 git commands to generate.