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