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 # Whether to run xmlto pdf --with-fop
13 # This is de fault, set to empty to use the default fo to pdf
14 # processor that xmlto uses (which might be pdfxmltex, which is
15 # known to be broken).
18 ##-------------------------------------------------------------
20 ##-------------------------------------------------------------
28 images/kcachegrind_xtree.png \
30 internals/3_0_BUGSTATUS.txt \
31 internals/3_1_BUGSTATUS.txt \
32 internals/3_2_BUGSTATUS.txt \
33 internals/3_3_BUGSTATUS.txt \
34 internals/3_4_BUGSTATUS.txt \
35 internals/3_5_BUGSTATUS.txt \
36 internals/3_7_BUGSTATUS.txt \
37 internals/3_8_BUGSTATUS.txt \
38 internals/3_9_BUGSTATUS.txt \
39 internals/3_10_BUGSTATUS.txt \
40 internals/3_11_BUGSTATUS.txt \
41 internals/3_12_BUGSTATUS.txt \
42 internals/3_13_BUGSTATUS.txt \
43 internals/3_14_BUGSTATUS.txt \
44 internals/3_15_BUGSTATUS.txt \
45 internals/MERGE_3_10_1.txt \
46 internals/arm_thumb_notes_gdbserver.txt \
47 internals/avx-notes.txt \
48 internals/BIG_APP_NOTES.txt \
49 internals/Darwin-notes.txt \
50 internals/SPEC-notes.txt \
51 internals/directory-structure.txt \
52 internals/howto_BUILD_KDE42.txt \
53 internals/howto_oprofile.txt \
54 internals/m_replacemalloc.txt \
55 internals/m_syswrap.txt \
56 internals/module-structure.txt \
57 internals/multiple-architectures.txt \
59 internals/performance.txt \
60 internals/porting-HOWTO.txt \
61 internals/mpi2entries.txt \
62 internals/porting-to-ARM.txt \
63 internals/qemu-aarch64-linux-HOWTO.txt \
64 internals/qemu-mips64-linux-HOWTO.txt \
65 internals/register-uses.txt \
66 internals/release-HOWTO.txt \
67 internals/segments-seginfos.txt \
68 internals/t-chaining-notes.txt \
69 internals/threads-syscalls-signals.txt \
70 internals/tm-mutexstates.dot \
71 internals/tm-threadstates.dot \
72 internals/tracking-fn-entry-exit.txt \
73 internals/why-no-libc.txt \
74 internals/xml-output.txt \
75 internals/xml-output-protocol4.txt \
80 lib/vg-html-chunk.xsl \
81 lib/vg-html-website.xsl \
82 lib/vg-html-common.xsl \
87 xml/manpages-index.xml \
89 xml/manual-intro.xml \
91 xml/manual-core-adv.xml \
92 xml/manual-writing-tools.xml \
94 xml/quick-start-guide.xml \
96 xml/valgrind-manpage.xml \
101 ##-------------------------------------------------------------------
102 ## Below here is more ordinary make stuff...
103 ##-------------------------------------------------------------------
104 myxmldir = $(top_srcdir)/docs/xml
105 myimgdir = $(top_srcdir)/docs/images
106 mylibdir = $(top_srcdir)/docs/lib
108 myhtmldir = $(top_builddir)/docs/html
109 myprintdir = $(top_builddir)/docs/print
111 websitedir = $(top_builddir)/docs/website
112 valkyriedir = $(top_builddir)/docs/vg-html
113 downloadsdir = $(top_builddir)/docs/downloads
114 vgdir = $(top_builddir)/docs/valgrind
116 XML_CATALOG_FILES = /etc/xml/catalog
118 # file to log print output to
123 XMLLINT_FLAGS = --noblanks --noout --xinclude --postvalid --noent
125 # stylesheet processor
127 XSLTPROC_FLAGS = --nonet --xinclude
130 XSL_HTML_CHUNK_STYLE = $(mylibdir)/vg-html-chunk.xsl
131 XSL_FO_STYLE = $(mylibdir)/vg-fo.xsl
132 XSL_TEXT_STYLE = $(mylibdir)/vg-faq2txt.xsl
133 XSL_WEBSITE_STYLE = $(mylibdir)/vg-html-website.xsl
135 /usr/share/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl \
136 /usr/share/xml/docbook/stylesheet/nwalsh/current/manpages/docbook.xsl \
137 /usr/share/xml/docbook/stylesheet/nwalsh/manpages/docbook.xsl
139 # Input files for valid-manual and valid-manpages
140 MANUAL_XML_FILES = $(myxmldir)/index.xml \
141 $(myxmldir)/vg-entities.xml \
142 $(myxmldir)/quick-start-guide.xml \
143 $(myxmldir)/manual.xml \
144 $(myxmldir)/manual-intro.xml \
145 $(myxmldir)/manual-core.xml \
146 $(myxmldir)/manual-core-adv.xml \
147 $(top_srcdir)/*/docs/*-manual.xml \
148 $(myxmldir)/quick-start-guide.xml \
149 $(myxmldir)/FAQ.xml \
150 $(myxmldir)/tech-docs.xml \
151 $(myxmldir)/design-impl.xml \
152 $(myxmldir)/manual-writing-tools.xml \
153 $(top_srcdir)/callgrind/docs/cl-format.xml \
154 $(myxmldir)/dist-docs.xml \
155 $(top_srcdir)/AUTHORS \
157 $(top_srcdir)/NEWS.old \
158 $(top_srcdir)/README \
159 $(top_srcdir)/README_MISSING_SYSCALL_OR_IOCTL \
160 $(top_srcdir)/README_DEVELOPERS \
161 $(top_srcdir)/README_PACKAGERS \
162 $(top_srcdir)/README.s390 \
163 $(top_srcdir)/README.android \
164 $(top_srcdir)/README.android_emulator \
165 $(top_srcdir)/README.mips \
166 $(top_srcdir)/README.solaris \
167 $(myxmldir)/licenses.xml \
168 $(top_srcdir)/COPYING \
169 $(top_srcdir)/COPYING.DOCS
171 MANPAGES_XML_FILES = $(myxmldir)/manpages-index.xml \
172 $(myxmldir)/valgrind-manpage.xml \
173 $(myxmldir)/manual-core.xml \
174 $(top_srcdir)/*/docs/*-manual.xml
176 all-docs: FAQ.txt man-pages html-docs print-docs
178 valid-manual: $(MANUAL_XML_FILES)
179 if type $(XMLLINT) 2>/dev/null; then \
180 $(XMLLINT) $(XMLLINT_FLAGS) $(myxmldir)/index.xml && \
184 valid-manpages: $(MANPAGES_XML_FILES)
185 if type $(XMLLINT) 2>/dev/null; then \
186 $(XMLLINT) $(XMLLINT_FLAGS) $(myxmldir)/manpages-index.xml && \
190 check-local: valid-manual valid-manpages
192 # The text version of the FAQ.
194 @echo "Generating the text version of the FAQ ..."
195 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) && \
196 $(XSLTPROC) $(XSLTPROC_FLAGS) -o ./FAQ.txt $(XSL_TEXT_STYLE) $(myxmldir)/FAQ.xml
198 # the valgrind manpages
201 for x in $(XSL_MAN_STYLES) ; do \
202 if test -f $$x; then \
203 echo "Using manpage stylesheet: $$x"; \
204 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) && \
205 $(XSLTPROC) $(XSLTPROC_FLAGS) -o ./ $$x $(myxmldir)/manpages-index.xml; \
210 echo "Error: I can't find the XSL_MAN_STYLE file"; \
211 echo "Please check where it lives on your system, and" \
212 "amend the line 'XSL_MAN_STYLES = ' in this Makefile."; \
215 # chunked html, on a chapter-by-chapter basis
217 @echo "Generating html files..."
218 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) && \
219 mkdir -p $(myhtmldir) && \
220 /bin/rm -fr $(myhtmldir)/ && \
221 mkdir -p $(myhtmldir)/ && \
222 mkdir -p $(myhtmldir)/images && \
223 cp $(mylibdir)/vg_basic.css $(myhtmldir)/ && \
224 cp $(myimgdir)/*.png $(myhtmldir)/images && \
225 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(myhtmldir)/ $(XSL_HTML_CHUNK_STYLE) $(myxmldir)/index.xml
229 @echo "Generating PDF file: $(myprintdir)/index.pdf (please be patient)...";
230 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) && \
231 mkdir -p $(myprintdir) && \
232 mkdir -p $(myprintdir)/images && \
233 cp $(myimgdir)/*.png $(myprintdir)/images && \
234 xmlto -v $(WITH_FOP) --stringparam=keep.relative.image.uris="1" \
236 --searchpath print pdf $(myxmldir)/index.xml &> $(LOGFILE) && \
237 echo "Generating PS file: $(myprintdir)/index.ps ..." && \
238 pdftops index.pdf && \
239 mv index.pdf index.ps $(myprintdir) && \
242 # If the docs have been built, install them. But don't worry if they have
243 # not -- developers do 'make install' not from a 'make dist'-ified distro all
246 # Note: this is done at 'make install' time.
247 # Note 2: the ifeq/else/endif have to be indented one space
248 # because otherwise it seems that automake thinks it should
249 # be the one to handle the else/endif parts, not GNU make
253 if test -r html ; then \
254 mkdir -p $(DESTDIR)$(datadir)/doc/valgrind; \
255 cp -r html $(DESTDIR)$(datadir)/doc/valgrind; \
258 if test -r $$f ; then \
259 mkdir -p $(DESTDIR)$(mandir)/man1; \
260 cp $$f $(DESTDIR)$(mandir)/man1; \
263 ifeq ($(BUILD_ALL_DOCS),yes)
265 if test -r index.pdf ; then \
266 mkdir -p $(DESTDIR)$(datadir)/doc/valgrind; \
267 cp index.pdf $(DESTDIR)$(datadir)/doc/valgrind/valgrind_manual.pdf; \
270 if test -r index.ps ; then \
271 mkdir -p $(DESTDIR)$(datadir)/doc/valgrind; \
272 cp index.ps $(DESTDIR)$(datadir)/doc/valgrind/valgrind_manual.ps; \
276 # This is done at 'make dist' time. It builds the html docs, print
277 # docs and man pages and copies them into the docs/ directory in the
279 ifeq ($(BUILD_ALL_DOCS),yes)
280 dist-hook: FAQ.txt html-docs man-pages print-docs
281 cp -r html $(distdir)
282 cp FAQ.txt $(distdir)/..
284 cp print/index.pdf $(distdir)
285 cp print/index.ps $(distdir)
287 dist-hook: FAQ.txt html-docs man-pages
288 cp -r html $(distdir)
289 cp FAQ.txt $(distdir)/..
296 rm -f $(top_builddir)/FAQ.txt $(top_builddir)/docs/*.1
299 rm -f valid-manual valid-manpages
302 # -----------------------------------------------------------------------
303 # Note: the rest of this file is nothing to do with the normal build
304 # tree. The stuff below contains special targets for web-site
307 # chunked html with no html/body tags, css, or top nav, to fit into the website
309 @echo "Generating website html files ..."
310 export XML_CATALOG_FILES=$(XML_CATALOG_FILES)
311 /bin/rm -fr $(websitedir)
312 mkdir -p $(websitedir)
313 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(websitedir)/ $(XSL_WEBSITE_STYLE) $(myxmldir)/index.xml
315 # valkyrie carries around her own copy of the valgrind manual
317 @echo "Generating a set of valgrind docs for valkyrie..."
318 export XML_CATALOG_FILES=$(XML_CATALOG_FILES)
319 /bin/rm -fr $(valkyriedir)
320 mkdir -p $(valkyriedir)
321 mkdir -p $(valkyriedir)/images
322 cp $(mylibdir)/vg_basic.css $(valkyriedir)/
323 cp $(myimgdir)/*.png $(valkyriedir)/images/
324 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(valkyriedir)/ $(XSL_HTML_CHUNK_STYLE) $(myxmldir)/index.xml
326 # html.tar.bz2, .pdf, .ps.bz2 files for downloading from the website
328 export XML_CATALOG_FILES=$(XML_CATALOG_FILES)
329 /bin/rm -fr $(downloadsdir)
330 mkdir -p $(downloadsdir)
332 @echo "Generating valgrind_manual.html.tar.bz2 ..."
333 export XML_CATALOG_FILES=$(XML_CATALOG_FILES)
336 mkdir -p $(vgdir)/html
337 mkdir -p $(vgdir)/html/images
338 cp $(mylibdir)/vg_basic.css $(vgdir)/html/
339 cp $(myimgdir)/*.png $(vgdir)/html/images/
340 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(vgdir)/html/ $(XSL_HTML_CHUNK_STYLE) $(myxmldir)/index.xml
341 (cd $(top_builddir)/docs/ && \
342 (tar cfj $(downloadsdir)/valgrind_manual.html.tar.bz2 ./valgrind/html/ ) )
343 /bin/rm -fr $(vgdir)/html/
345 @echo "Generating valgrind_manual.pdf ..."
346 mkdir -p $(vgdir)/print
347 mkdir -p $(vgdir)/print/images
348 cp $(myimgdir)/*.png $(vgdir)/print/images/
349 xmlto -v $(WITH_FOP) --stringparam=keep.relative.image.uris="1" \
351 --searchpath print pdf $(myxmldir)/index.xml &> $(LOGFILE)
352 mv index.pdf $(vgdir)/print/manual.pdf
354 @echo "Generating valgrind_manual.ps.bz2 ..."
355 (cd $(vgdir)/print/ && \
356 ( pdftops manual.pdf ) )
357 mv $(vgdir)/print/manual.pdf $(downloadsdir)/valgrind_manual.pdf
358 mv $(vgdir)/print/manual.ps $(downloadsdir)/valgrind_manual.ps
359 bzip2 $(downloadsdir)/valgrind_manual.ps
360 /bin/rm -fr $(vgdir) $(LOGFILE)