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
))
29 htmldir?
=$(prefix)/share
/doc
/perf-doc
30 pdfdir?
=$(prefix)/share
/doc
/perf-doc
31 mandir?
=$(prefix)/share
/man
32 man1dir=$(mandir)/man1
33 man5dir=$(mandir)/man5
34 man7dir=$(mandir)/man7
38 ASCIIDOC_EXTRA
= --unsafe
39 MANPAGE_XSL
= manpage-normal.xsl
44 HTML_REF
= origin/html
46 infodir?
=$(prefix)/share
/info
48 INSTALL_INFO
=install-info
49 DOCBOOK2X_TEXI
=docbook2x-texi
52 PERL_PATH
= /usr
/bin
/perl
55 -include ..
/config.mak.autogen
56 -include ..
/config.mak
60 # -7.1.2, no extra settings are needed.
61 # 8.0-, set ASCIIDOC8.
66 # -1.68.1, set ASCIIDOC_NO_ROFF? (based on changelog from 1.73.0)
67 # 1.69.0, no extra settings are needed?
68 # 1.69.1-1.71.0, set DOCBOOK_SUPPRESS_SP?
69 # 1.71.1, no extra settings are needed?
70 # 1.72.0, set DOCBOOK_XSL_172.
71 # 1.73.0-, set ASCIIDOC_NO_ROFF
75 # If you had been using DOCBOOK_XSL_172 in an attempt to get rid
76 # of 'the ".ft C" problem' in your generated manpages, and you
77 # instead ended up with weird characters around callouts, try
78 # using ASCIIDOC_NO_ROFF instead (it works fine with ASCIIDOC8).
82 ASCIIDOC_EXTRA
+= -a asciidoc7compatible
85 ASCIIDOC_EXTRA
+= -a perf-asciidoc-no-roff
86 MANPAGE_XSL
= manpage-1.72.xsl
88 ifdef ASCIIDOC_NO_ROFF
89 # docbook-xsl after 1.72 needs the regular XSL, but will not
90 # pass-thru raw roff codes from asciidoc.conf, so turn them off.
91 ASCIIDOC_EXTRA
+= -a perf-asciidoc-no-roff
94 ifdef MAN_BOLD_LITERAL
95 XMLTO_EXTRA
+= -m manpage-bold-literal.xsl
97 ifdef DOCBOOK_SUPPRESS_SP
98 XMLTO_EXTRA
+= -m manpage-suppress-sp.xsl
101 SHELL_PATH ?
= $(SHELL
)
103 SHELL_PATH_SQ
= $(subst ','\'',$(SHELL_PATH))
106 # Please note that there is a minor bug in asciidoc.
107 # The version after 6.0.3 _will_ include the patch found here:
108 # http://marc.theaimsgroup.com/?l=perf&m=111558757202243&w=2
110 # Until that version is released you may have to apply the patch
111 # yourself - yes, all 6 characters of it!
114 QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir
117 ifneq ($(findstring $(MAKEFLAGS),w),w)
118 PRINT_DIR = --no-print-directory
123 ifneq ($(findstring $(MAKEFLAGS),s),s)
125 QUIET_ASCIIDOC = @echo ' ' ASCIIDOC $@;
126 QUIET_XMLTO = @echo ' ' XMLTO $@;
127 QUIET_DB2TEXI = @echo ' ' DB2TEXI $@;
128 QUIET_MAKEINFO = @echo ' ' MAKEINFO $@;
129 QUIET_DBLATEX = @echo ' ' DBLATEX $@;
130 QUIET_XSLTPROC = @echo ' ' XSLTPROC $@;
131 QUIET_GEN = @echo ' ' GEN $@;
132 QUIET_STDERR = 2> /dev/null
133 QUIET_SUBDIR0 = +@subdir=
134 QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
135 $(MAKE) $(PRINT_DIR) -C $$subdir
144 $(DOC_HTML) $(DOC_MAN1) $(DOC_MAN5) $(DOC_MAN7): asciidoc.conf
151 info: perf.info perfman.info
158 $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
159 # $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir)
160 # $(INSTALL) -d -m 755 $(DESTDIR)$(man7dir)
161 $(INSTALL) -m 644 $(DOC_MAN1) $(DESTDIR)$(man1dir)
162 # $(INSTALL) -m 644 $(DOC_MAN5) $(DESTDIR)$(man5dir)
163 # $(INSTALL) -m 644 $(DOC_MAN7) $(DESTDIR)$(man7dir)
166 $(INSTALL) -d -m 755 $(DESTDIR)$(infodir)
167 $(INSTALL) -m 644 perf.info perfman.info $(DESTDIR)$(infodir)
168 if test -r $(DESTDIR)$(infodir)/dir; then \
169 $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) perf.info ;\
170 $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) perfman.info ;\
172 echo "No directory found in $(DESTDIR)$(infodir)" >&2 ; \
176 $(INSTALL) -d -m 755 $(DESTDIR)$(pdfdir)
177 $(INSTALL) -m 644 user-manual.pdf $(DESTDIR)$(pdfdir)
180 '$(SHELL_PATH_SQ
)' ./install-webdoc.sh $(DESTDIR)$(htmldir)
182 ../PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE
183 $(QUIET_SUBDIR0)../ $(QUIET_SUBDIR1) PERF-VERSION-FILE
185 -include ../PERF-VERSION-FILE
188 # Determine "include::" file references in asciidoc files.
190 doc.dep : $(wildcard *.txt) build-docdep.perl
191 $(QUIET_GEN)$(RM) $@+ $@ && \
192 $(PERL_PATH) ./build-docdep.perl >$@+ $(QUIET_STDERR) && \
197 cmds_txt = cmds-ancillaryinterrogators.txt \
198 cmds-ancillarymanipulators.txt \
199 cmds-mainporcelain.txt \
200 cmds-plumbinginterrogators.txt \
201 cmds-plumbingmanipulators.txt \
202 cmds-synchingrepositories.txt \
203 cmds-synchelpers.txt \
204 cmds-purehelpers.txt \
205 cmds-foreignscminterface.txt
207 $(cmds_txt): cmd-list.made
209 cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT)
210 $(QUIET_GEN)$(RM) $@ && \
211 $(PERL_PATH) ./cmd-list.perl ../command-list.txt $(QUIET_STDERR) && \
215 $(RM) *.xml *.xml+ *.html *.html+ *.1 *.5 *.7
216 $(RM) *.texi *.texi+ *.texi++ perf.info perfman.info
217 $(RM) howto-index.txt howto/*.html doc.dep
218 $(RM) technical/api-*.html technical/api-index.txt
219 $(RM) $(cmds_txt) *.made
221 $(MAN_HTML): %.html : %.txt
222 $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
223 $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \
224 $(ASCIIDOC_EXTRA) -aperf_version=$(PERF_VERSION) -o $@+ $< && \
228 $(QUIET_XMLTO)$(RM) $@ && \
229 xmlto -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
232 $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
233 $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
234 $(ASCIIDOC_EXTRA) -aperf_version=$(PERF_VERSION) -o $@+ $< && \
238 XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css
240 user-manual.html: user-manual.xml
241 $(QUIET_XSLTPROC)xsltproc $(XSLTOPTS) -o $@ $(XSLT) $<
243 perf.info: user-manual.texi
244 $(QUIET_MAKEINFO)$(MAKEINFO) --no-split -o $@ user-manual.texi
246 user-manual.texi: user-manual.xml
247 $(QUIET_DB2TEXI)$(RM) $@+ $@ && \
248 $(DOCBOOK2X_TEXI) user-manual.xml --encoding=UTF-8 --to-stdout >$@++ && \
249 $(PERL_PATH) fix-texi.perl <$@++ >$@+ && \
253 user-manual.pdf: user-manual.xml
254 $(QUIET_DBLATEX)$(RM) $@+ $@ && \
255 $(DBLATEX) -o $@+ -p /etc/asciidoc/dblatex/asciidoc-dblatex.xsl -s /etc/asciidoc/dblatex/asciidoc-dblatex.sty $< && \
258 perfman.texi: $(MAN_XML) cat-texi.perl
259 $(QUIET_DB2TEXI)$(RM) $@+ $@ && \
260 ($(foreach xml,$(MAN_XML),$(DOCBOOK2X_TEXI) --encoding=UTF-8 \
261 --to-stdout $(xml) &&) true) > $@++ && \
262 $(PERL_PATH) cat-texi.perl $@ <$@++ >$@+ && \
266 perfman.info: perfman.texi
267 $(QUIET_MAKEINFO)$(MAKEINFO) --no-split --no-validate $*.texi
269 $(patsubst %.txt,%.texi,$(MAN_TXT)): %.texi : %.xml
270 $(QUIET_DB2TEXI)$(RM) $@+ $@ && \
271 $(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@+ && \
274 howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
275 $(QUIET_GEN)$(RM) $@+ $@ && \
276 '$(SHELL_PATH_SQ
)' ./howto-index.sh $(wildcard howto/*.txt) >$@+ && \
279 $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
280 $(QUIET_ASCIIDOC)$(ASCIIDOC) -b xhtml11 $*.txt
282 WEBDOC_DEST = /pub/software/tools/perf/docs
284 $(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
285 $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
286 sed -e '1,/^
$$/d
' $< | $(ASCIIDOC) -b xhtml11 - >$@+ && \
289 install-webdoc : html
290 '$(SHELL_PATH_SQ
)' ./install-webdoc.sh $(WEBDOC_DEST)
292 quick-install: quick-install-man
295 '$(SHELL_PATH_SQ
)' ./install-doc-quick.sh $(DOC_REF) $(DESTDIR)$(mandir)
298 '$(SHELL_PATH_SQ
)' ./install-doc-quick.sh $(HTML_REF) $(DESTDIR)$(htmldir)
300 .PHONY: .FORCE-PERF-VERSION-FILE