cli: remove babeltrace2-log
[babeltrace.git] / doc / man / Makefile.am
CommitLineData
838dd456
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 = \
c1f82f3b
MJ
10 babeltrace2 \
11 babeltrace2-convert \
12 babeltrace2-help \
13 babeltrace2-list-plugins \
c1f82f3b
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 \
24 babeltrace2-sink.utils.counter \
25 babeltrace2-sink.utils.dummy \
26 babeltrace2-source.ctf.fs \
27 babeltrace2-source.ctf.lttng-live \
28 babeltrace2-source.text.dmesg
d7be1ed0
PP
29MAN1_NO_ASCIIDOC_NAMES =
30MAN7_NO_ASCIIDOC_NAMES =
838dd456
PP
31
32if ENABLE_DEBUG_INFO
d7be1ed0 33MAN7_NAMES += \
c1f82f3b
MJ
34 babeltrace2-plugin-lttng-utils \
35 babeltrace2-filter.lttng-utils.debug-info
838dd456
PP
36endif
37
38# AsciiDoc sources and outputs
39MAN1_TXT = $(call manaddsuffix,.1.txt,$(MAN1_NAMES))
40MAN7_TXT = $(call manaddsuffix,.7.txt,$(MAN7_NAMES))
41MAN_TXT = $(MAN1_TXT) $(MAN7_TXT)
42MAN_XML = $(patsubst $(srcdir)/%.txt,%.xml,$(MAN_TXT))
43
44# common AsciiDoc source files
45COMMON_TXT = \
46 $(srcdir)/common-cli-env.txt \
47 $(srcdir)/common-cli-files.txt \
48 $(srcdir)/common-cmd-footer.txt \
49 $(srcdir)/common-cmd-info-options.txt \
50 $(srcdir)/common-cmd-params-format.txt \
51 $(srcdir)/common-cmd-plugin-path.txt \
52 $(srcdir)/common-common-compat-env.txt \
53 $(srcdir)/common-ctf-plugin-env.txt \
54 $(srcdir)/common-footer.txt \
55 $(srcdir)/common-gen-options.txt \
56 $(srcdir)/common-lib-env.txt \
57 $(srcdir)/common-plugin-path-options.txt \
58 $(srcdir)/common-ppp-env.txt
59
60# config
61ASCIIDOC_CONF = $(srcdir)/bt-asciidoc.conf
62ASCIIDOC_ATTRS_CONF = $(builddir)/asciidoc-attrs.conf
63XSL_SRC_FILE = $(srcdir)/manpage.xsl
64
65# common dependencies
66COMMON_DEPS = $(ASCIIDOC_CONF) $(COMMON_TXT)
67
68# man pages destinations
69MAN1 = $(addsuffix .1,$(MAN1_NAMES))
70MAN7 = $(addsuffix .7,$(MAN7_NAMES))
71MAN1_NO_ASCIIDOC = $(addsuffix .1,$(MAN1_NO_ASCIIDOC_NAMES))
72MAN7_NO_ASCIIDOC = $(addsuffix .7,$(MAN7_NO_ASCIIDOC_NAMES))
73MAN = $(MAN1) $(MAN7)
74
75if ENABLE_MAN_PAGES
76# at this point, we know the user asked to build the man pages
77if HAVE_ASCIIDOC_XMLTO
78asciidoc_verbose = $(asciidoc_verbose_@AM_V@)
79asciidoc_verbose_ = $(asciidoc_verbose_@AM_DEFAULT_V@)
80asciidoc_verbose_0 = @echo " ASCIIDOC " $@;
81xmlto_verbose = $(xmlto_verbose_@AM_V@)
82xmlto_verbose_ = $(xmlto_verbose_@AM_DEFAULT_V@)
83xmlto_verbose_0 = @echo " XMLTO " $@;
84
85# tools
86ADOC = $(asciidoc_verbose)$(ASCIIDOC) -f $(ASCIIDOC_CONF) -f $(ASCIIDOC_ATTRS_CONF) -d manpage
87ADOC_DOCBOOK = $(ADOC) -b docbook
88XTO = $(xmlto_verbose)$(XMLTO) -m $(XSL_SRC_FILE) man
89
90# only add this dependency if we can build the man pages because it's
91# a file generated by the configure script, so it's more recent than
92# the pregenerated man pages in a tarball
93COMMON_DEPS += $(ASCIIDOC_ATTRS_CONF)
94
95# recipes
96%.1.xml: $(srcdir)/%.1.txt $(COMMON_DEPS)
97 $(ADOC_DOCBOOK) -o $@ $<
98
99%.1: %.1.xml $(XSL_SRC_FILE)
100 $(XTO) $< 2>/dev/null
101
102%.7.xml: $(srcdir)/%.7.txt $(COMMON_DEPS)
103 $(ADOC_DOCBOOK) -o $@ $<
104
105%.7: %.7.xml $(XSL_SRC_FILE)
106 $(XTO) $< 2>/dev/null
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%.7: $(srcdir)/%.7.txt $(COMMON_DEPS)
121 @echo $(ERR_MSG)
122 @false
123endif # HAVE_ASCIIDOC_XMLTO
124endif # ENABLE_MAN_PAGES
125
126# those are always installed since they are directly written in troff
127dist_man1_MANS = $(MAN1_NO_ASCIIDOC)
128dist_man7_MANS = $(MAN7_NO_ASCIIDOC)
129
130if ENABLE_MAN_PAGES
131# building man pages: we can install and distribute them
132dist_man1_MANS += $(MAN1)
133dist_man7_MANS += $(MAN7)
134endif # ENABLE_MAN_PAGES
135
136if !ENABLE_MAN_PAGES
137dist-hook:
138 @echo "Error: Please enable the man pages before creating a distribution tarball."
139 @false
140endif # !ENABLE_MAN_PAGES
141
142# always distribute the source files
143EXTRA_DIST = README.adoc $(MAN_TXT) $(COMMON_TXT) $(XSL_SRC_FILE) \
144 $(ASCIIDOC_CONF) $(ASCIIDOC_ATTRS_CONF).in
This page took 0.03709 seconds and 4 git commands to generate.