1 include ..
/..
/..
/scripts
/Makefile.
include
2 include ..
/..
/..
/scripts
/utilities.mak
4 # This Makefile and manpage XSL files were taken from tools/perf/Documentation
5 # and modified for libtraceevent.
8 $(wildcard libtraceevent-
*.txt
) \
12 _MAN_XML
=$(patsubst %.txt
,%.xml
,$(MAN_TXT
))
13 _MAN_HTML
=$(patsubst %.txt
,%.html
,$(MAN_TXT
))
14 _DOC_MAN3
=$(patsubst %.txt
,%.3,$(MAN3_TXT
))
16 MAN_XML
=$(addprefix $(OUTPUT
),$(_MAN_XML
))
17 MAN_HTML
=$(addprefix $(OUTPUT
),$(_MAN_HTML
))
18 DOC_MAN3
=$(addprefix $(OUTPUT
),$(_DOC_MAN3
))
20 # Make the path relative to DESTDIR, not prefix
25 htmldir?
=$(prefix)/share
/doc
/libtraceevent-doc
26 pdfdir?
=$(prefix)/share
/doc
/libtraceevent-doc
27 mandir?
=$(prefix)/share
/man
28 man3dir=$(mandir)/man3
31 ASCIIDOC_EXTRA
= --unsafe
-f asciidoc.conf
32 ASCIIDOC_HTML
= xhtml11
33 MANPAGE_XSL
= manpage-normal.xsl
39 ASCIIDOC
= asciidoctor
40 ASCIIDOC_EXTRA
= -a compat-mode
41 ASCIIDOC_EXTRA
+= -I.
-rasciidoctor-extensions
42 ASCIIDOC_EXTRA
+= -a mansource
="libtraceevent" -a manmanual
="libtraceevent Manual"
43 ASCIIDOC_HTML
= xhtml5
48 _tmp_tool_path
:= $(call get-executable
,$(ASCIIDOC
))
49 ifeq ($(_tmp_tool_path
),)
50 missing_tools
= $(ASCIIDOC
)
53 ifndef USE_ASCIIDOCTOR
54 _tmp_tool_path
:= $(call get-executable
,$(XMLTO
))
55 ifeq ($(_tmp_tool_path
),)
56 missing_tools
+= $(XMLTO
)
62 # -7.1.2, no extra settings are needed.
63 # 8.0-, set ASCIIDOC8.
68 # -1.68.1, set ASCIIDOC_NO_ROFF? (based on changelog from 1.73.0)
69 # 1.69.0, no extra settings are needed?
70 # 1.69.1-1.71.0, set DOCBOOK_SUPPRESS_SP?
71 # 1.71.1, no extra settings are needed?
72 # 1.72.0, set DOCBOOK_XSL_172.
73 # 1.73.0-, set ASCIIDOC_NO_ROFF
77 # If you had been using DOCBOOK_XSL_172 in an attempt to get rid
78 # of 'the ".ft C" problem' in your generated manpages, and you
79 # instead ended up with weird characters around callouts, try
80 # using ASCIIDOC_NO_ROFF instead (it works fine with ASCIIDOC8).
84 ASCIIDOC_EXTRA
+= -a asciidoc7compatible
87 ASCIIDOC_EXTRA
+= -a libtraceevent-asciidoc-no-roff
88 MANPAGE_XSL
= manpage-1.72.xsl
90 ifdef ASCIIDOC_NO_ROFF
91 # docbook-xsl after 1.72 needs the regular XSL, but will not
92 # pass-thru raw roff codes from asciidoc.conf, so turn them off.
93 ASCIIDOC_EXTRA
+= -a libtraceevent-asciidoc-no-roff
96 ifdef MAN_BOLD_LITERAL
97 XMLTO_EXTRA
+= -m manpage-bold-literal.xsl
99 ifdef DOCBOOK_SUPPRESS_SP
100 XMLTO_EXTRA
+= -m manpage-suppress-sp.xsl
103 SHELL_PATH ?
= $(SHELL
)
105 SHELL_PATH_SQ
= $(subst ','\'',$(SHELL_PATH))
108 DESTDIR_SQ = '$(subst ','\'',$(DESTDIR))'
110 export DESTDIR DESTDIR_SQ
113 # Please note that there is a minor bug in asciidoc.
114 # The version after 6.0.3 _will_ include the patch found here:
115 # http://marc.theaimsgroup.com/?l=libtraceevent&m=111558757202243&w=2
117 # Until that version is released you may have to apply the patch
118 # yourself - yes, all 6 characters of it!
120 QUIET_SUBDIR0
= +$(MAKE
) -C
# space to separate -C and subdir
123 ifneq ($(findstring $(MAKEFLAGS
),w
),w
)
124 PRINT_DIR
= --no-print-directory
129 ifneq ($(findstring $(MAKEFLAGS
),s
),s
)
131 QUIET_ASCIIDOC
= @echo
' ASCIIDOC '$@
;
132 QUIET_XMLTO
= @echo
' XMLTO '$@
;
133 QUIET_SUBDIR0
= +@subdir
=
134 QUIET_SUBDIR1
= ;$(NO_SUBDIR
) \
135 echo
' SUBDIR ' $$subdir; \
136 $(MAKE
) $(PRINT_DIR
) -C
$$subdir
148 $(MAN_HTML
) $(DOC_MAN3
): asciidoc.conf
154 $(error
"You need to install $(missing_tools) for man pages")
158 $(call QUIET_INSTALL
, Documentation-man
) \
159 $(INSTALL
) -d
-m
755 $(DESTDIR
)$(man3dir); \
160 $(INSTALL
) -m
644 $(DOC_MAN3
) $(DESTDIR
)$(man3dir);
162 install-man
: check-man-tools man do-install-man
164 uninstall: uninstall-man
167 $(call QUIET_UNINST
, Documentation-man
) \
168 $(Q
)$(RM
) $(addprefix $(DESTDIR
)$(man3dir)/,$(DOC_MAN3
))
172 DO_INSTALL_MAN
= $(warning Please
install $(missing_tools
) to have the man pages installed
)
174 DO_INSTALL_MAN
= do-install-man
178 $(MAN_XML
) $(addsuffix +,$(MAN_XML
)) \
179 $(MAN_HTML
) $(addsuffix +,$(MAN_HTML
)) \
183 $(call QUIET_CLEAN
, Documentation
) $(RM
) $(CLEAN_FILES
)
185 ifdef USE_ASCIIDOCTOR
186 $(OUTPUT
)%.3 : $(OUTPUT
)%.txt
187 $(QUIET_ASCIIDOC
)$(RM
) $@
+ $@
&& \
188 $(ASCIIDOC
) -b manpage
-d manpage \
189 $(ASCIIDOC_EXTRA
) -alibtraceevent_version
=$(EVENT_PARSE_VERSION
) -o
$@
+ $< && \
193 $(OUTPUT
)%.3 : $(OUTPUT
)%.xml
194 $(QUIET_XMLTO
)$(RM
) $@
&& \
195 $(XMLTO
) -o
$(OUTPUT
).
-m
$(MANPAGE_XSL
) $(XMLTO_EXTRA
) man
$<
197 $(OUTPUT
)%.xml
: %.txt
198 $(QUIET_ASCIIDOC
)$(RM
) $@
+ $@
&& \
199 $(ASCIIDOC
) -b docbook
-d manpage \
200 $(ASCIIDOC_EXTRA
) -alibtraceevent_version
=$(EVENT_PARSE_VERSION
) -o
$@
+ $< && \
203 $(MAN_HTML
): $(OUTPUT
)%.html
: %.txt
204 $(QUIET_ASCIIDOC
)$(RM
) $@
+ $@
&& \
205 $(ASCIIDOC
) -b
$(ASCIIDOC_HTML
) -d manpage \
206 $(ASCIIDOC_EXTRA
) -aperf_version
=$(EVENT_PARSE_VERSION
) -o
$@
+ $< && \