2 $(filter-out $(addsuffix .txt
, $(ARTICLES
) $(SP_ARTICLES
)), \
3 $(wildcard perf-
*.txt
)) \
8 MAN_TXT
= $(MAN1_TXT
) $(MAN5_TXT
) $(MAN7_TXT
)
9 MAN_XML
=$(patsubst %.txt
,%.xml
,$(MAN_TXT
))
10 MAN_HTML
=$(patsubst %.txt
,%.html
,$(MAN_TXT
))
15 # with their own formatting rules.
17 API_DOCS
= $(patsubst %.txt
,%,$(filter-out technical
/api-index-skel.txt technical
/api-index.txt
, $(wildcard technical
/api-
*.txt
)))
18 SP_ARTICLES
+= $(API_DOCS
)
19 SP_ARTICLES
+= technical
/api-index
21 DOC_HTML
+= $(patsubst %,%.html
,$(ARTICLES
) $(SP_ARTICLES
))
23 DOC_MAN1
=$(patsubst %.txt
,%.1,$(MAN1_TXT
))
24 DOC_MAN5
=$(patsubst %.txt
,%.5,$(MAN5_TXT
))
25 DOC_MAN7
=$(patsubst %.txt
,%.7,$(MAN7_TXT
))
27 # Make the path relative to DESTDIR, not prefix
32 htmldir?
=$(prefix)/share
/doc
/perf-doc
33 pdfdir?
=$(prefix)/share
/doc
/perf-doc
34 mandir?
=$(prefix)/share
/man
35 man1dir=$(mandir)/man1
36 man5dir=$(mandir)/man5
37 man7dir=$(mandir)/man7
40 ASCIIDOC_EXTRA
= --unsafe
41 MANPAGE_XSL
= manpage-normal.xsl
46 HTML_REF
= origin/html
48 infodir?
=$(prefix)/share
/info
50 INSTALL_INFO
=install-info
51 DOCBOOK2X_TEXI
=docbook2x-texi
54 PERL_PATH
= /usr
/bin
/perl
57 -include ..
/config.mak.autogen
58 -include ..
/config.mak
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 perf-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 perf-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 # Please note that there is a minor bug in asciidoc.
109 # The version after 6.0.3 _will_ include the patch found here:
110 # http://marc.theaimsgroup.com/?l=perf&m=111558757202243&w=2
112 # Until that version is released you may have to apply the patch
113 # yourself - yes, all 6 characters of it!
116 QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir
119 ifneq ($(findstring $(MAKEFLAGS),w),w)
120 PRINT_DIR = --no-print-directory
125 ifneq ($(findstring $(MAKEFLAGS),s),s)
127 QUIET_ASCIIDOC = @echo ' ' ASCIIDOC $@;
128 QUIET_XMLTO = @echo ' ' XMLTO $@;
129 QUIET_DB2TEXI = @echo ' ' DB2TEXI $@;
130 QUIET_MAKEINFO = @echo ' ' MAKEINFO $@;
131 QUIET_DBLATEX = @echo ' ' DBLATEX $@;
132 QUIET_XSLTPROC = @echo ' ' XSLTPROC $@;
133 QUIET_GEN = @echo ' ' GEN $@;
134 QUIET_STDERR = 2> /dev/null
135 QUIET_SUBDIR0 = +@subdir=
136 QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
137 $(MAKE) $(PRINT_DIR) -C $$subdir
146 $(DOC_HTML) $(DOC_MAN1) $(DOC_MAN5) $(DOC_MAN7): asciidoc.conf
153 info: perf.info perfman.info
160 $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
161 # $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir)
162 # $(INSTALL) -d -m 755 $(DESTDIR)$(man7dir)
163 $(INSTALL) -m 644 $(DOC_MAN1) $(DESTDIR)$(man1dir)
164 # $(INSTALL) -m 644 $(DOC_MAN5) $(DESTDIR)$(man5dir)
165 # $(INSTALL) -m 644 $(DOC_MAN7) $(DESTDIR)$(man7dir)
168 $(INSTALL) -d -m 755 $(DESTDIR)$(infodir)
169 $(INSTALL) -m 644 perf.info perfman.info $(DESTDIR)$(infodir)
170 if test -r $(DESTDIR)$(infodir)/dir; then \
171 $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) perf.info ;\
172 $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) perfman.info ;\
174 echo "No directory found in $(DESTDIR)$(infodir)" >&2 ; \
178 $(INSTALL) -d -m 755 $(DESTDIR)$(pdfdir)
179 $(INSTALL) -m 644 user-manual.pdf $(DESTDIR)$(pdfdir)
182 # '$(SHELL_PATH_SQ
)' ./install-webdoc.sh $(DESTDIR)$(htmldir)
184 ../PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE
185 $(QUIET_SUBDIR0)../ $(QUIET_SUBDIR1) PERF-VERSION-FILE
187 -include ../PERF-VERSION-FILE
190 # Determine "include::" file references in asciidoc files.
192 doc.dep : $(wildcard *.txt) build-docdep.perl
193 $(QUIET_GEN)$(RM) $@+ $@ && \
194 $(PERL_PATH) ./build-docdep.perl >$@+ $(QUIET_STDERR) && \
199 cmds_txt = cmds-ancillaryinterrogators.txt \
200 cmds-ancillarymanipulators.txt \
201 cmds-mainporcelain.txt \
202 cmds-plumbinginterrogators.txt \
203 cmds-plumbingmanipulators.txt \
204 cmds-synchingrepositories.txt \
205 cmds-synchelpers.txt \
206 cmds-purehelpers.txt \
207 cmds-foreignscminterface.txt
209 $(cmds_txt): cmd-list.made
211 cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT)
212 $(QUIET_GEN)$(RM) $@ && \
213 $(PERL_PATH) ./cmd-list.perl ../command-list.txt $(QUIET_STDERR) && \
217 $(RM) *.xml *.xml+ *.html *.html+ *.1 *.5 *.7
218 $(RM) *.texi *.texi+ *.texi++ perf.info perfman.info
219 $(RM) howto-index.txt howto/*.html doc.dep
220 $(RM) technical/api-*.html technical/api-index.txt
221 $(RM) $(cmds_txt) *.made
223 $(MAN_HTML): %.html : %.txt
224 $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
225 $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \
226 $(ASCIIDOC_EXTRA) -aperf_version=$(PERF_VERSION) -o $@+ $< && \
230 $(QUIET_XMLTO)$(RM) $@ && \
231 xmlto -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
234 $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
235 $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
236 $(ASCIIDOC_EXTRA) -aperf_version=$(PERF_VERSION) -o $@+ $< && \
240 XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css
242 user-manual.html: user-manual.xml
243 $(QUIET_XSLTPROC)xsltproc $(XSLTOPTS) -o $@ $(XSLT) $<
245 perf.info: user-manual.texi
246 $(QUIET_MAKEINFO)$(MAKEINFO) --no-split -o $@ user-manual.texi
248 user-manual.texi: user-manual.xml
249 $(QUIET_DB2TEXI)$(RM) $@+ $@ && \
250 $(DOCBOOK2X_TEXI) user-manual.xml --encoding=UTF-8 --to-stdout >$@++ && \
251 $(PERL_PATH) fix-texi.perl <$@++ >$@+ && \
255 user-manual.pdf: user-manual.xml
256 $(QUIET_DBLATEX)$(RM) $@+ $@ && \
257 $(DBLATEX) -o $@+ -p /etc/asciidoc/dblatex/asciidoc-dblatex.xsl -s /etc/asciidoc/dblatex/asciidoc-dblatex.sty $< && \
260 perfman.texi: $(MAN_XML) cat-texi.perl
261 $(QUIET_DB2TEXI)$(RM) $@+ $@ && \
262 ($(foreach xml,$(MAN_XML),$(DOCBOOK2X_TEXI) --encoding=UTF-8 \
263 --to-stdout $(xml) &&) true) > $@++ && \
264 $(PERL_PATH) cat-texi.perl $@ <$@++ >$@+ && \
268 perfman.info: perfman.texi
269 $(QUIET_MAKEINFO)$(MAKEINFO) --no-split --no-validate $*.texi
271 $(patsubst %.txt,%.texi,$(MAN_TXT)): %.texi : %.xml
272 $(QUIET_DB2TEXI)$(RM) $@+ $@ && \
273 $(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@+ && \
276 howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
277 $(QUIET_GEN)$(RM) $@+ $@ && \
278 '$(SHELL_PATH_SQ
)' ./howto-index.sh $(wildcard howto/*.txt) >$@+ && \
281 $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
282 $(QUIET_ASCIIDOC)$(ASCIIDOC) -b xhtml11 $*.txt
284 WEBDOC_DEST = /pub/software/tools/perf/docs
286 $(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
287 $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
288 sed -e '1,/^
$$/d
' $< | $(ASCIIDOC) -b xhtml11 - >$@+ && \
292 #install-webdoc : html
293 # '$(SHELL_PATH_SQ
)' ./install-webdoc.sh $(WEBDOC_DEST)
295 # quick-install: quick-install-man
298 # '$(SHELL_PATH_SQ
)' ./install-doc-quick.sh $(DOC_REF) $(DESTDIR)$(mandir)
301 # '$(SHELL_PATH_SQ
)' ./install-doc-quick.sh $(HTML_REF) $(DESTDIR)$(htmldir)
303 .PHONY: .FORCE-PERF-VERSION-FILE