Update manual pages for 2.0.0-rc1
[babeltrace.git] / doc / man / Makefile.am
CommitLineData
0659f3af
PP
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 = \
a8be4294
MJ
10 babeltrace2 \
11 babeltrace2-convert \
12 babeltrace2-help \
13 babeltrace2-list-plugins \
a8be4294
MJ
14 babeltrace2-query \
15 babeltrace2-run
16MAN7_NAMES = babeltrace2-filter.utils.muxer \
17 babeltrace2-filter.utils.trimmer \
18 babeltrace2-intro \
19 babeltrace2-plugin-ctf \
20 babeltrace2-plugin-text \
21 babeltrace2-plugin-utils \
22 babeltrace2-sink.ctf.fs \
23 babeltrace2-sink.text.pretty \
e70712b3 24 babeltrace2-sink.text.details \
a8be4294
MJ
25 babeltrace2-sink.utils.counter \
26 babeltrace2-sink.utils.dummy \
27 babeltrace2-source.ctf.fs \
28 babeltrace2-source.ctf.lttng-live \
e70712b3
PP
29 babeltrace2-source.text.dmesg \
30 babeltrace2-query-babeltrace.support-info \
31 babeltrace2-query-babeltrace.trace-infos
dbce3403
PP
32MAN1_NO_ASCIIDOC_NAMES =
33MAN7_NO_ASCIIDOC_NAMES =
0659f3af
PP
34
35if ENABLE_DEBUG_INFO
dbce3403 36MAN7_NAMES += \
a8be4294
MJ
37 babeltrace2-plugin-lttng-utils \
38 babeltrace2-filter.lttng-utils.debug-info
0659f3af
PP
39endif
40
41# AsciiDoc sources and outputs
42MAN1_TXT = $(call manaddsuffix,.1.txt,$(MAN1_NAMES))
43MAN7_TXT = $(call manaddsuffix,.7.txt,$(MAN7_NAMES))
44MAN_TXT = $(MAN1_TXT) $(MAN7_TXT)
45MAN_XML = $(patsubst $(srcdir)/%.txt,%.xml,$(MAN_TXT))
46
47# common AsciiDoc source files
48COMMON_TXT = \
49 $(srcdir)/common-cli-env.txt \
50 $(srcdir)/common-cli-files.txt \
51 $(srcdir)/common-cmd-footer.txt \
52 $(srcdir)/common-cmd-info-options.txt \
53 $(srcdir)/common-cmd-params-format.txt \
e70712b3 54 $(srcdir)/common-common-env.txt \
0659f3af
PP
55 $(srcdir)/common-footer.txt \
56 $(srcdir)/common-gen-options.txt \
57 $(srcdir)/common-lib-env.txt \
e70712b3
PP
58 $(srcdir)/common-see-babeltrace2-intro.txt \
59 $(srcdir)/common-convert-examples.txt \
60 $(srcdir)/common-log-levels.txt \
61 $(srcdir)/common-trimmer-time-format.txt
0659f3af
PP
62
63# config
64ASCIIDOC_CONF = $(srcdir)/bt-asciidoc.conf
65ASCIIDOC_ATTRS_CONF = $(builddir)/asciidoc-attrs.conf
66XSL_SRC_FILE = $(srcdir)/manpage.xsl
67
68# common dependencies
69COMMON_DEPS = $(ASCIIDOC_CONF) $(COMMON_TXT)
70
71# man pages destinations
72MAN1 = $(addsuffix .1,$(MAN1_NAMES))
73MAN7 = $(addsuffix .7,$(MAN7_NAMES))
74MAN1_NO_ASCIIDOC = $(addsuffix .1,$(MAN1_NO_ASCIIDOC_NAMES))
75MAN7_NO_ASCIIDOC = $(addsuffix .7,$(MAN7_NO_ASCIIDOC_NAMES))
76MAN = $(MAN1) $(MAN7)
77
78if ENABLE_MAN_PAGES
79# at this point, we know the user asked to build the man pages
80if HAVE_ASCIIDOC_XMLTO
81asciidoc_verbose = $(asciidoc_verbose_@AM_V@)
82asciidoc_verbose_ = $(asciidoc_verbose_@AM_DEFAULT_V@)
83asciidoc_verbose_0 = @echo " ASCIIDOC " $@;
84xmlto_verbose = $(xmlto_verbose_@AM_V@)
85xmlto_verbose_ = $(xmlto_verbose_@AM_DEFAULT_V@)
86xmlto_verbose_0 = @echo " XMLTO " $@;
87
88# tools
89ADOC = $(asciidoc_verbose)$(ASCIIDOC) -f $(ASCIIDOC_CONF) -f $(ASCIIDOC_ATTRS_CONF) -d manpage
90ADOC_DOCBOOK = $(ADOC) -b docbook
91XTO = $(xmlto_verbose)$(XMLTO) -m $(XSL_SRC_FILE) man
92
93# only add this dependency if we can build the man pages because it's
94# a file generated by the configure script, so it's more recent than
95# the pregenerated man pages in a tarball
96COMMON_DEPS += $(ASCIIDOC_ATTRS_CONF)
97
98# recipes
99%.1.xml: $(srcdir)/%.1.txt $(COMMON_DEPS)
100 $(ADOC_DOCBOOK) -o $@ $<
101
102%.1: %.1.xml $(XSL_SRC_FILE)
103 $(XTO) $< 2>/dev/null
104
105%.7.xml: $(srcdir)/%.7.txt $(COMMON_DEPS)
106 $(ADOC_DOCBOOK) -o $@ $<
107
108%.7: %.7.xml $(XSL_SRC_FILE)
109 $(XTO) $< 2>/dev/null
110
111# only clean the generated files if we have the tools to generate them again
112CLEANFILES = $(MAN_XML) $(MAN)
113else # HAVE_ASCIIDOC_XMLTO
114# create man page targets used to stop the build if we want to
115# build the man pages, but we don't have the necessary tools to do so
116ERR_MSG = "Error: Cannot build target because asciidoc or xmlto tool is missing."
117ERR_MSG += "Make sure both tools are installed and run the configure script again."
118
119%.1: $(srcdir)/%.1.txt $(COMMON_DEPS)
120 @echo $(ERR_MSG)
121 @false
122
123%.7: $(srcdir)/%.7.txt $(COMMON_DEPS)
124 @echo $(ERR_MSG)
125 @false
126endif # HAVE_ASCIIDOC_XMLTO
127endif # ENABLE_MAN_PAGES
128
129# those are always installed since they are directly written in troff
130dist_man1_MANS = $(MAN1_NO_ASCIIDOC)
131dist_man7_MANS = $(MAN7_NO_ASCIIDOC)
132
133if ENABLE_MAN_PAGES
134# building man pages: we can install and distribute them
135dist_man1_MANS += $(MAN1)
136dist_man7_MANS += $(MAN7)
137endif # ENABLE_MAN_PAGES
138
139if !ENABLE_MAN_PAGES
140dist-hook:
141 @echo "Error: Please enable the man pages before creating a distribution tarball."
142 @false
143endif # !ENABLE_MAN_PAGES
144
145# always distribute the source files
146EXTRA_DIST = README.adoc $(MAN_TXT) $(COMMON_TXT) $(XSL_SRC_FILE) \
147 $(ASCIIDOC_CONF) $(ASCIIDOC_ATTRS_CONF).in
This page took 0.041248 seconds and 4 git commands to generate.