1 include ..
/..
/scripts
/Makefile.
include
2 include ..
/config
/utilities.mak
5 $(filter-out $(addsuffix .txt
, $(ARTICLES
) $(SP_ARTICLES
)), \
6 $(wildcard perf-
*.txt
)) \
11 MAN_TXT
= $(MAN1_TXT
) $(MAN5_TXT
) $(MAN7_TXT
)
12 _MAN_XML
=$(patsubst %.txt
,%.xml
,$(MAN_TXT
))
13 _MAN_HTML
=$(patsubst %.txt
,%.html
,$(MAN_TXT
))
15 MAN_XML
=$(addprefix $(OUTPUT
),$(_MAN_XML
))
16 MAN_HTML
=$(addprefix $(OUTPUT
),$(_MAN_HTML
))
19 # with their own formatting rules.
21 API_DOCS
= $(patsubst %.txt
,%,$(filter-out technical
/api-index-skel.txt technical
/api-index.txt
, $(wildcard technical
/api-
*.txt
)))
22 SP_ARTICLES
+= $(API_DOCS
)
23 SP_ARTICLES
+= technical
/api-index
25 _DOC_HTML
= $(_MAN_HTML
)
26 _DOC_HTML
+=$(patsubst %,%.html
,$(ARTICLES
) $(SP_ARTICLES
))
27 DOC_HTML
=$(addprefix $(OUTPUT
),$(_DOC_HTML
))
29 _DOC_MAN1
=$(patsubst %.txt
,%.1,$(MAN1_TXT
))
30 _DOC_MAN5
=$(patsubst %.txt
,%.5,$(MAN5_TXT
))
31 _DOC_MAN7
=$(patsubst %.txt
,%.7,$(MAN7_TXT
))
33 DOC_MAN1
=$(addprefix $(OUTPUT
),$(_DOC_MAN1
))
34 DOC_MAN5
=$(addprefix $(OUTPUT
),$(_DOC_MAN5
))
35 DOC_MAN7
=$(addprefix $(OUTPUT
),$(_DOC_MAN7
))
37 # Make the path relative to DESTDIR, not prefix
42 htmldir?
=$(prefix)/share
/doc
/perf-doc
43 pdfdir?
=$(prefix)/share
/doc
/perf-doc
44 mandir?
=$(prefix)/share
/man
45 man1dir=$(mandir)/man1
46 man5dir=$(mandir)/man5
47 man7dir=$(mandir)/man7
50 ASCIIDOC_EXTRA
= --unsafe
51 MANPAGE_XSL
= manpage-normal.xsl
56 HTML_REF
= origin/html
58 infodir?
=$(prefix)/share
/info
60 INSTALL_INFO
=install-info
61 DOCBOOK2X_TEXI
=docbook2x-texi
65 PERL_PATH
= /usr
/bin
/perl
68 -include ..
/config.mak.autogen
69 -include ..
/config.mak
71 _tmp_tool_path
:= $(call get-executable
,$(ASCIIDOC
))
72 ifeq ($(_tmp_tool_path
),)
73 missing_tools
= $(ASCIIDOC
)
76 _tmp_tool_path
:= $(call get-executable
,$(XMLTO
))
77 ifeq ($(_tmp_tool_path
),)
78 missing_tools
+= $(XMLTO
)
83 # -7.1.2, no extra settings are needed.
84 # 8.0-, set ASCIIDOC8.
89 # -1.68.1, set ASCIIDOC_NO_ROFF? (based on changelog from 1.73.0)
90 # 1.69.0, no extra settings are needed?
91 # 1.69.1-1.71.0, set DOCBOOK_SUPPRESS_SP?
92 # 1.71.1, no extra settings are needed?
93 # 1.72.0, set DOCBOOK_XSL_172.
94 # 1.73.0-, set ASCIIDOC_NO_ROFF
98 # If you had been using DOCBOOK_XSL_172 in an attempt to get rid
99 # of 'the ".ft C" problem' in your generated manpages, and you
100 # instead ended up with weird characters around callouts, try
101 # using ASCIIDOC_NO_ROFF instead (it works fine with ASCIIDOC8).
105 ASCIIDOC_EXTRA
+= -a asciidoc7compatible
107 ifdef DOCBOOK_XSL_172
108 ASCIIDOC_EXTRA
+= -a perf-asciidoc-no-roff
109 MANPAGE_XSL
= manpage-1.72.xsl
111 ifdef ASCIIDOC_NO_ROFF
112 # docbook-xsl after 1.72 needs the regular XSL, but will not
113 # pass-thru raw roff codes from asciidoc.conf, so turn them off.
114 ASCIIDOC_EXTRA
+= -a perf-asciidoc-no-roff
117 ifdef MAN_BOLD_LITERAL
118 XMLTO_EXTRA
+= -m manpage-bold-literal.xsl
120 ifdef DOCBOOK_SUPPRESS_SP
121 XMLTO_EXTRA
+= -m manpage-suppress-sp.xsl
124 SHELL_PATH ?
= $(SHELL
)
126 SHELL_PATH_SQ
= $(subst ','\'',$(SHELL_PATH))
129 # Please note that there is a minor bug in asciidoc.
130 # The version after 6.0.3 _will_ include the patch found here:
131 # http://marc.theaimsgroup.com/?l=perf&m=111558757202243&w=2
133 # Until that version is released you may have to apply the patch
134 # yourself - yes, all 6 characters of it!
137 QUIET_SUBDIR0 = +$(MAKE) -C # space to separate -C and subdir
140 ifneq ($(findstring $(MAKEFLAGS),w),w)
141 PRINT_DIR = --no-print-directory
146 ifneq ($(findstring $(MAKEFLAGS),s),s)
148 QUIET_ASCIIDOC = @echo ' ' ASCIIDOC $@;
149 QUIET_XMLTO = @echo ' ' XMLTO $@;
150 QUIET_DB2TEXI = @echo ' ' DB2TEXI $@;
151 QUIET_MAKEINFO = @echo ' ' MAKEINFO $@;
152 QUIET_DBLATEX = @echo ' ' DBLATEX $@;
153 QUIET_XSLTPROC = @echo ' ' XSLTPROC $@;
154 QUIET_GEN = @echo ' ' GEN $@;
155 QUIET_STDERR = 2> /dev/null
156 QUIET_SUBDIR0 = +@subdir=
157 QUIET_SUBDIR1 = ;$(NO_SUBDIR) echo ' ' SUBDIR $$subdir; \
158 $(MAKE) $(PRINT_DIR) -C $$subdir
167 $(DOC_HTML) $(DOC_MAN1) $(DOC_MAN5) $(DOC_MAN7): asciidoc.conf
174 info: $(OUTPUT)perf.info $(OUTPUT)perfman.info
176 pdf: $(OUTPUT)user-manual.pdf
182 $(error "You need to install $(missing_tools) for man pages")
186 $(INSTALL) -d -m 755 $(DESTDIR)$(man1dir)
187 # $(INSTALL) -d -m 755 $(DESTDIR)$(man5dir)
188 # $(INSTALL) -d -m 755 $(DESTDIR)$(man7dir)
189 $(INSTALL) -m 644 $(DOC_MAN1) $(DESTDIR)$(man1dir)
190 # $(INSTALL) -m 644 $(DOC_MAN5) $(DESTDIR)$(man5dir)
191 # $(INSTALL) -m 644 $(DOC_MAN7) $(DESTDIR)$(man7dir)
193 install-man: check-man-tools man
197 $(warning Please install $(missing_tools) to have the man pages installed)
199 $(MAKE) do-install-man
203 $(INSTALL) -d -m 755 $(DESTDIR)$(infodir)
204 $(INSTALL) -m 644 $(OUTPUT)perf.info $(OUTPUT)perfman.info $(DESTDIR)$(infodir)
205 if test -r $(DESTDIR)$(infodir)/dir; then \
206 $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) perf.info ;\
207 $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) perfman.info ;\
209 echo "No directory found in $(DESTDIR)$(infodir)" >&2 ; \
213 $(INSTALL) -d -m 755 $(DESTDIR)$(pdfdir)
214 $(INSTALL) -m 644 $(OUTPUT)user-manual.pdf $(DESTDIR)$(pdfdir)
217 # '$(SHELL_PATH_SQ
)' ./install-webdoc.sh $(DESTDIR)$(htmldir)
219 ifneq ($(MAKECMDGOALS),clean)
220 ifneq ($(MAKECMDGOALS),tags)
221 $(OUTPUT)PERF-VERSION-FILE: .FORCE-PERF-VERSION-FILE
222 $(QUIET_SUBDIR0)../ $(QUIET_SUBDIR1) $(OUTPUT)PERF-VERSION-FILE
224 -include $(OUTPUT)PERF-VERSION-FILE
229 # Determine "include::" file references in asciidoc files.
231 $(OUTPUT)doc.dep : $(wildcard *.txt) build-docdep.perl
232 $(QUIET_GEN)$(RM) $@+ $@ && \
233 $(PERL_PATH) ./build-docdep.perl >$@+ $(QUIET_STDERR) && \
236 -include $(OUPTUT)doc.dep
238 _cmds_txt = cmds-ancillaryinterrogators.txt \
239 cmds-ancillarymanipulators.txt \
240 cmds-mainporcelain.txt \
241 cmds-plumbinginterrogators.txt \
242 cmds-plumbingmanipulators.txt \
243 cmds-synchingrepositories.txt \
244 cmds-synchelpers.txt \
245 cmds-purehelpers.txt \
246 cmds-foreignscminterface.txt
247 cmds_txt=$(addprefix $(OUTPUT),$(_cmds_txt))
249 $(cmds_txt): $(OUTPUT)cmd-list.made
251 $(OUTPUT)cmd-list.made: cmd-list.perl ../command-list.txt $(MAN1_TXT)
252 $(QUIET_GEN)$(RM) $@ && \
253 $(PERL_PATH) ./cmd-list.perl ../command-list.txt $(QUIET_STDERR) && \
257 $(RM) $(MAN_XML) $(addsuffix +,$(MAN_XML))
258 $(RM) $(MAN_HTML) $(addsuffix +,$(MAN_HTML))
259 $(RM) $(DOC_HTML) $(DOC_MAN1) $(DOC_MAN5) $(DOC_MAN7)
260 $(RM) $(OUTPUT)*.texi $(OUTPUT)*.texi+ $(OUTPUT)*.texi++
261 $(RM) $(OUTPUT)perf.info $(OUTPUT)perfman.info
262 $(RM) $(OUTPUT)howto-index.txt $(OUTPUT)howto/*.html $(OUTPUT)doc.dep
263 $(RM) $(OUTPUT)technical/api-*.html $(OUTPUT)technical/api-index.txt
264 $(RM) $(cmds_txt) $(OUTPUT)*.made
266 $(MAN_HTML): $(OUTPUT)%.html : %.txt
267 $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
268 $(ASCIIDOC) -b xhtml11 -d manpage -f asciidoc.conf \
269 $(ASCIIDOC_EXTRA) -aperf_version=$(PERF_VERSION) -o $@+ $< && \
272 $(OUTPUT)%.1 $(OUTPUT)%.5 $(OUTPUT)%.7 : $(OUTPUT)%.xml
273 $(QUIET_XMLTO)$(RM) $@ && \
274 $(XMLTO) -o $(OUTPUT). -m $(MANPAGE_XSL) $(XMLTO_EXTRA) man $<
276 $(OUTPUT)%.xml : %.txt
277 $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
278 $(ASCIIDOC) -b docbook -d manpage -f asciidoc.conf \
279 $(ASCIIDOC_EXTRA) -aperf_version=$(PERF_VERSION) -o $@+ $< && \
283 XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css
285 $(OUTPUT)user-manual.html: $(OUTPUT)user-manual.xml
286 $(QUIET_XSLTPROC)xsltproc $(XSLTOPTS) -o $@ $(XSLT) $<
288 $(OUTPUT)perf.info: $(OUTPUT)user-manual.texi
289 $(QUIET_MAKEINFO)$(MAKEINFO) --no-split -o $@ $(OUTPUT)user-manual.texi
291 $(OUTPUT)user-manual.texi: $(OUTPUT)user-manual.xml
292 $(QUIET_DB2TEXI)$(RM) $@+ $@ && \
293 $(DOCBOOK2X_TEXI) $(OUTPUT)user-manual.xml --encoding=UTF-8 --to-stdout >$@++ && \
294 $(PERL_PATH) fix-texi.perl <$@++ >$@+ && \
298 $(OUTPUT)user-manual.pdf: $(OUTPUT)user-manual.xml
299 $(QUIET_DBLATEX)$(RM) $@+ $@ && \
300 $(DBLATEX) -o $@+ -p /etc/asciidoc/dblatex/asciidoc-dblatex.xsl -s /etc/asciidoc/dblatex/asciidoc-dblatex.sty $< && \
303 $(OUTPUT)perfman.texi: $(MAN_XML) cat-texi.perl
304 $(QUIET_DB2TEXI)$(RM) $@+ $@ && \
305 ($(foreach xml,$(MAN_XML),$(DOCBOOK2X_TEXI) --encoding=UTF-8 \
306 --to-stdout $(xml) &&) true) > $@++ && \
307 $(PERL_PATH) cat-texi.perl $@ <$@++ >$@+ && \
311 $(OUTPUT)perfman.info: $(OUTPUT)perfman.texi
312 $(QUIET_MAKEINFO)$(MAKEINFO) --no-split --no-validate $*.texi
314 $(patsubst %.txt,%.texi,$(MAN_TXT)): %.texi : %.xml
315 $(QUIET_DB2TEXI)$(RM) $@+ $@ && \
316 $(DOCBOOK2X_TEXI) --to-stdout $*.xml >$@+ && \
319 howto-index.txt: howto-index.sh $(wildcard howto/*.txt)
320 $(QUIET_GEN)$(RM) $@+ $@ && \
321 '$(SHELL_PATH_SQ
)' ./howto-index.sh $(wildcard howto/*.txt) >$@+ && \
324 $(patsubst %,%.html,$(ARTICLES)) : %.html : %.txt
325 $(QUIET_ASCIIDOC)$(ASCIIDOC) -b xhtml11 $*.txt
327 WEBDOC_DEST = /pub/software/tools/perf/docs
329 $(patsubst %.txt,%.html,$(wildcard howto/*.txt)): %.html : %.txt
330 $(QUIET_ASCIIDOC)$(RM) $@+ $@ && \
331 sed -e '1,/^
$$/d
' $< | $(ASCIIDOC) -b xhtml11 - >$@+ && \
335 #install-webdoc : html
336 # '$(SHELL_PATH_SQ
)' ./install-webdoc.sh $(WEBDOC_DEST)
338 # quick-install: quick-install-man
341 # '$(SHELL_PATH_SQ
)' ./install-doc-quick.sh $(DOC_REF) $(DESTDIR)$(mandir)
344 # '$(SHELL_PATH_SQ
)' ./install-doc-quick.sh $(HTML_REF) $(DESTDIR)$(htmldir)
346 .PHONY: .FORCE-PERF-VERSION-FILE