2 ##-------------------------------------------------------------
3 ## HACK: stuff to avoid making the print docs if installing the
4 ## tools to do so is impractical / too difficult
5 ##-------------------------------------------------------------
7 # Comment out the next line to skip building print docs. The default
8 # is not to skip building print docs. Note, after changing it
9 # you need to re-run autogen.sh and configure to make it take effect.
12 ##-------------------------------------------------------------
14 ##-------------------------------------------------------------
22 images/kcachegrind_xtree.png \
24 internals/3_0_BUGSTATUS.txt \
25 internals/3_1_BUGSTATUS.txt \
26 internals/3_2_BUGSTATUS.txt \
27 internals/3_3_BUGSTATUS.txt \
28 internals/3_4_BUGSTATUS.txt \
29 internals/3_5_BUGSTATUS.txt \
30 internals/3_7_BUGSTATUS.txt \
31 internals/3_8_BUGSTATUS.txt \
32 internals/3_9_BUGSTATUS.txt \
33 internals/3_10_BUGSTATUS.txt \
34 internals/3_11_BUGSTATUS.txt \
35 internals/3_12_BUGSTATUS.txt \
36 internals/3_13_BUGSTATUS.txt \
37 internals/3_14_BUGSTATUS.txt \
38 internals/MERGE_3_10_1.txt \
39 internals/arm_thumb_notes_gdbserver.txt \
40 internals/avx-notes.txt \
41 internals/BIG_APP_NOTES.txt \
42 internals/Darwin-notes.txt \
43 internals/SPEC-notes.txt \
44 internals/directory-structure.txt \
45 internals/howto_BUILD_KDE42.txt \
46 internals/howto_oprofile.txt \
47 internals/m_replacemalloc.txt \
48 internals/m_syswrap.txt \
49 internals/module-structure.txt \
50 internals/multiple-architectures.txt \
52 internals/performance.txt \
53 internals/porting-HOWTO.txt \
54 internals/mpi2entries.txt \
55 internals/porting-to-ARM.txt \
56 internals/qemu-aarch64-linux-HOWTO.txt \
57 internals/qemu-mips64-linux-HOWTO.txt \
58 internals/register-uses.txt \
59 internals/release-HOWTO.txt \
60 internals/segments-seginfos.txt \
61 internals/t-chaining-notes.txt \
62 internals/threads-syscalls-signals.txt \
63 internals/tm-mutexstates.dot \
64 internals/tm-threadstates.dot \
65 internals/tracking-fn-entry-exit.txt \
66 internals/why-no-libc.txt \
67 internals/xml-output.txt \
68 internals/xml-output-protocol4.txt \
73 lib/vg-html-chunk.xsl \
74 lib/vg-html-website.xsl \
75 lib/vg-html-common.xsl \
80 xml/manpages-index.xml \
82 xml/manual-intro.xml \
84 xml/manual-core-adv.xml \
85 xml/manual-writing-tools.xml \
87 xml/quick-start-guide.xml \
89 xml/valgrind-manpage.xml \
94 ##-------------------------------------------------------------------
95 ## Below here is more ordinary make stuff...
96 ##-------------------------------------------------------------------
97 myxmldir = $(top_srcdir)/docs/xml
98 myimgdir = $(top_srcdir)/docs/images
99 mylibdir = $(top_srcdir)/docs/lib
101 myhtmldir = $(top_builddir)/docs/html
102 myprintdir = $(top_builddir)/docs/print
104 websitedir = $(top_builddir)/docs/website
105 valkyriedir = $(top_builddir)/docs/vg-html
106 downloadsdir = $(top_builddir)/docs/downloads
107 vgdir = $(top_builddir)/docs/valgrind
109 XML_CATALOG_FILES = /etc/xml/catalog
111 # file to log print output to
116 LINT_FLAGS = --noblanks --noout --xinclude --postvalid --noent
117 # validate with docbook 4.3 'cos it supports xml:base natively
118 VALID_FLAGS = --dtdvalid http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd
119 XMLLINT_FLAGS = $(LINT_FLAGS) $(VALID_FLAGS)
121 # stylesheet processor
123 XSLTPROC_FLAGS = --nonet --xinclude
126 XSL_HTML_CHUNK_STYLE = $(mylibdir)/vg-html-chunk.xsl
127 XSL_FO_STYLE = $(mylibdir)/vg-fo.xsl
128 XSL_TEXT_STYLE = $(mylibdir)/vg-faq2txt.xsl
129 XSL_WEBSITE_STYLE = $(mylibdir)/vg-html-website.xsl
131 /usr/share/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl \
132 /usr/share/xml/docbook/stylesheet/nwalsh/current/manpages/docbook.xsl \
133 /usr/share/xml/docbook/stylesheet/nwalsh/manpages/docbook.xsl
135 all-docs: FAQ.txt man-pages html-docs print-docs
138 $(XMLLINT) $(XMLLINT_FLAGS) $(myxmldir)/index.xml
140 # The text version of the FAQ.
142 @echo "Generating the text version of the FAQ ..."
143 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) && \
144 $(XSLTPROC) $(XSLTPROC_FLAGS) -o ./FAQ.txt $(XSL_TEXT_STYLE) $(myxmldir)/FAQ.xml
146 # the valgrind manpages
149 for x in $(XSL_MAN_STYLES) ; do \
150 if test -f $$x; then \
151 echo "Using manpage stylesheet: $$x"; \
152 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) && \
153 $(XSLTPROC) $(XSLTPROC_FLAGS) -o ./ $$x $(myxmldir)/manpages-index.xml; \
158 echo "Error: I can't find the XSL_MAN_STYLE file"; \
159 echo "Please check where it lives on your system, and" \
160 "amend the line 'XSL_MAN_STYLES = ' in this Makefile."; \
163 # chunked html, on a chapter-by-chapter basis
165 @echo "Generating html files..."
166 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) && \
167 mkdir -p $(myhtmldir) && \
168 /bin/rm -fr $(myhtmldir)/ && \
169 mkdir -p $(myhtmldir)/ && \
170 mkdir -p $(myhtmldir)/images && \
171 cp $(mylibdir)/vg_basic.css $(myhtmldir)/ && \
172 cp $(myimgdir)/*.png $(myhtmldir)/images && \
173 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(myhtmldir)/ $(XSL_HTML_CHUNK_STYLE) $(myxmldir)/index.xml
177 @echo "Generating PDF file: $(myprintdir)/index.pdf (please be patient)...";
178 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) && \
179 mkdir -p $(myprintdir) && \
180 mkdir -p $(myprintdir)/images && \
181 cp $(myimgdir)/*.png $(myprintdir)/images && \
182 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(myprintdir)/index.fo $(XSL_FO_STYLE) $(myxmldir)/index.xml && \
183 (cd $(myprintdir) && \
184 ( pdfxmltex index.fo && \
185 pdfxmltex index.fo && \
186 pdfxmltex index.fo ) &> $(LOGFILE) < /dev/null && \
187 echo "Generating PS file: $(myprintdir)/index.ps ..." && \
188 pdftops index.pdf && \
189 rm -f *.log *.aux *.fo *.out)
191 # If the docs have been built, install them. But don't worry if they have
192 # not -- developers do 'make install' not from a 'make dist'-ified distro all
195 # Note: this is done at 'make install' time.
196 # Note 2: the ifeq/else/endif have to be indented one space
197 # because otherwise it seems that automake thinks it should
198 # be the one to handle the else/endif parts, not GNU make
202 if test -r html ; then \
203 mkdir -p $(DESTDIR)$(datadir)/doc/valgrind; \
204 cp -r html $(DESTDIR)$(datadir)/doc/valgrind; \
207 if test -r $$f ; then \
208 mkdir -p $(DESTDIR)$(mandir)/man1; \
209 cp $$f $(DESTDIR)$(mandir)/man1; \
212 ifeq ($(BUILD_ALL_DOCS),yes)
214 if test -r index.pdf ; then \
215 mkdir -p $(DESTDIR)$(datadir)/doc/valgrind; \
216 cp index.pdf $(DESTDIR)$(datadir)/doc/valgrind/valgrind_manual.pdf; \
219 if test -r index.ps ; then \
220 mkdir -p $(DESTDIR)$(datadir)/doc/valgrind; \
221 cp index.ps $(DESTDIR)$(datadir)/doc/valgrind/valgrind_manual.ps; \
225 # This is done at 'make dist' time. It builds the html docs, print
226 # docs and man pages and copies them into the docs/ directory in the
228 ifeq ($(BUILD_ALL_DOCS),yes)
229 dist-hook: FAQ.txt html-docs man-pages print-docs
230 cp -r html $(distdir)
231 cp FAQ.txt $(distdir)/..
233 cp print/index.pdf $(distdir)
234 cp print/index.ps $(distdir)
236 dist-hook: FAQ.txt html-docs man-pages
237 cp -r html $(distdir)
238 cp FAQ.txt $(distdir)/..
245 rm -f $(top_builddir)/FAQ.txt $(top_builddir)/docs/*.1
249 # -----------------------------------------------------------------------
250 # Note: the rest of this file is nothing to do with the normal build
251 # tree. The stuff below contains special targets for web-site
254 # chunked html with no html/body tags, css, or top nav, to fit into the website
256 @echo "Generating website html files ..."
257 export XML_CATALOG_FILES=$(XML_CATALOG_FILES)
258 /bin/rm -fr $(websitedir)
259 mkdir -p $(websitedir)
260 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(websitedir)/ $(XSL_WEBSITE_STYLE) $(myxmldir)/index.xml
262 # valkyrie carries around her own copy of the valgrind manual
264 @echo "Generating a set of valgrind docs for valkyrie..."
265 export XML_CATALOG_FILES=$(XML_CATALOG_FILES)
266 /bin/rm -fr $(valkyriedir)
267 mkdir -p $(valkyriedir)
268 mkdir -p $(valkyriedir)/images
269 cp $(mylibdir)/vg_basic.css $(valkyriedir)/
270 cp $(myimgdir)/*.png $(valkyriedir)/images/
271 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(valkyriedir)/ $(XSL_HTML_CHUNK_STYLE) $(myxmldir)/index.xml
273 # html.tar.bz2, .pdf, .ps.bz2 files for downloading from the website
275 export XML_CATALOG_FILES=$(XML_CATALOG_FILES)
276 /bin/rm -fr $(downloadsdir)
277 mkdir -p $(downloadsdir)
279 @echo "Generating valgrind_manual.html.tar.bz2 ..."
280 export XML_CATALOG_FILES=$(XML_CATALOG_FILES)
283 mkdir -p $(vgdir)/html
284 mkdir -p $(vgdir)/html/images
285 cp $(mylibdir)/vg_basic.css $(vgdir)/html/
286 cp $(myimgdir)/*.png $(vgdir)/html/images/
287 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(vgdir)/html/ $(XSL_HTML_CHUNK_STYLE) $(myxmldir)/index.xml
288 (cd $(top_builddir)/docs/ && \
289 (tar cfj $(downloadsdir)/valgrind_manual.html.tar.bz2 ./valgrind/html/ ) )
290 /bin/rm -fr $(vgdir)/html/
292 @echo "Generating valgrind_manual.pdf ..."
293 mkdir -p $(vgdir)/print
294 mkdir -p $(vgdir)/print/images
295 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(vgdir)/print/manual.fo $(XSL_FO_STYLE) $(myxmldir)/index.xml
296 (cd $(vgdir)/print/ && \
297 ( pdfxmltex manual.fo && \
298 pdfxmltex manual.fo && \
299 pdfxmltex manual.fo ) &> $(LOGFILE) < /dev/null )
301 @echo "Generating valgrind_manual.ps.bz2 ..."
302 (cd $(vgdir)/print/ && \
303 ( pdftops manual.pdf ) )
304 mv $(vgdir)/print/manual.pdf $(downloadsdir)/valgrind_manual.pdf
305 mv $(vgdir)/print/manual.ps $(downloadsdir)/valgrind_manual.ps
306 bzip2 $(downloadsdir)/valgrind_manual.ps