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 if VGCONF_OS_IS_FREEBSD
117 XML_CATALOG_FILES = /usr/local/share/xml/catalog
119 XML_CATALOG_FILES = /etc/xml/catalog
122 # file to log print output to
127 XMLLINT_FLAGS = --noblanks --noout --xinclude --postvalid --noent
129 # stylesheet processor
131 XSLTPROC_FLAGS = --nonet --xinclude
134 XSL_HTML_CHUNK_STYLE = $(mylibdir)/vg-html-chunk.xsl
135 XSL_FO_STYLE = $(mylibdir)/vg-fo.xsl
136 XSL_TEXT_STYLE = $(mylibdir)/vg-faq2txt.xsl
137 XSL_WEBSITE_STYLE = $(mylibdir)/vg-html-website.xsl
139 /usr/local/share/xsl/docbook/manpages/docbook.xsl \
140 /usr/share/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl \
141 /usr/share/xml/docbook/stylesheet/nwalsh/current/manpages/docbook.xsl \
142 /usr/share/xml/docbook/stylesheet/nwalsh/manpages/docbook.xsl
144 # Input files for valid-manual and valid-manpages
145 MANUAL_XML_FILES = $(myxmldir)/index.xml \
146 $(myxmldir)/vg-entities.xml \
147 $(myxmldir)/quick-start-guide.xml \
148 $(myxmldir)/manual.xml \
149 $(myxmldir)/manual-intro.xml \
150 $(myxmldir)/manual-core.xml \
151 $(myxmldir)/manual-core-adv.xml \
152 $(top_srcdir)/*/docs/*-manual.xml \
153 $(myxmldir)/quick-start-guide.xml \
154 $(myxmldir)/FAQ.xml \
155 $(myxmldir)/tech-docs.xml \
156 $(myxmldir)/design-impl.xml \
157 $(myxmldir)/manual-writing-tools.xml \
158 $(top_srcdir)/callgrind/docs/cl-format.xml \
159 $(myxmldir)/dist-docs.xml \
160 $(top_srcdir)/AUTHORS \
162 $(top_srcdir)/NEWS.old \
163 $(top_srcdir)/README \
164 $(top_srcdir)/README_MISSING_SYSCALL_OR_IOCTL \
165 $(top_srcdir)/README_DEVELOPERS \
166 $(top_srcdir)/README_PACKAGERS \
167 $(top_srcdir)/README.s390 \
168 $(top_srcdir)/README.android \
169 $(top_srcdir)/README.android_emulator \
170 $(top_srcdir)/README.mips \
171 $(top_srcdir)/README.solaris \
172 $(myxmldir)/licenses.xml \
173 $(top_srcdir)/COPYING \
174 $(top_srcdir)/COPYING.DOCS
176 MANPAGES_XML_FILES = $(myxmldir)/manpages-index.xml \
177 $(myxmldir)/valgrind-manpage.xml \
178 $(myxmldir)/manual-core.xml \
179 $(top_srcdir)/*/docs/*-manual.xml
181 all-docs: FAQ.txt man-pages html-docs print-docs
183 valid-manual: $(MANUAL_XML_FILES)
184 if type $(XMLLINT) 2>/dev/null; then \
185 $(XMLLINT) $(XMLLINT_FLAGS) $(myxmldir)/index.xml && \
189 valid-manpages: $(MANPAGES_XML_FILES)
190 if type $(XMLLINT) 2>/dev/null; then \
191 $(XMLLINT) $(XMLLINT_FLAGS) $(myxmldir)/manpages-index.xml && \
195 check-local: valid-manual valid-manpages
197 # The text version of the FAQ.
199 @echo "Generating the text version of the FAQ ..."
200 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) && \
201 $(XSLTPROC) $(XSLTPROC_FLAGS) -o ./FAQ.txt $(XSL_TEXT_STYLE) $(myxmldir)/FAQ.xml
203 # the valgrind manpages
206 for x in $(XSL_MAN_STYLES) ; do \
207 if test -f $$x; then \
208 echo "Using manpage stylesheet: $$x"; \
209 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) && \
210 $(XSLTPROC) $(XSLTPROC_FLAGS) -o ./ $$x $(myxmldir)/manpages-index.xml; \
215 echo "Error: I can't find the XSL_MAN_STYLE file"; \
216 echo "Please check where it lives on your system, and" \
217 "amend the line 'XSL_MAN_STYLES = ' in this Makefile."; \
220 # chunked html, on a chapter-by-chapter basis
222 @echo "Generating html files..."
223 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) && \
224 mkdir -p $(myhtmldir) && \
225 /bin/rm -fr $(myhtmldir)/ && \
226 mkdir -p $(myhtmldir)/ && \
227 mkdir -p $(myhtmldir)/images && \
228 cp $(mylibdir)/vg_basic.css $(myhtmldir)/ && \
229 cp $(myimgdir)/*.png $(myhtmldir)/images && \
230 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(myhtmldir)/ $(XSL_HTML_CHUNK_STYLE) $(myxmldir)/index.xml
234 @echo "Generating PDF file: $(myprintdir)/index.pdf (please be patient)...";
235 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) && \
236 mkdir -p $(myprintdir) && \
237 mkdir -p $(myprintdir)/images && \
238 cp $(myimgdir)/*.png $(myprintdir)/images && \
239 xmlto -v $(WITH_FOP) --stringparam=keep.relative.image.uris="1" \
241 --searchpath print pdf $(myxmldir)/index.xml &> $(LOGFILE) && \
242 echo "Generating PS file: $(myprintdir)/index.ps ..." && \
243 pdftops index.pdf && \
244 mv index.pdf index.ps $(myprintdir) && \
247 # If the docs have been built, install them. But don't worry if they have
248 # not -- developers do 'make install' not from a 'make dist'-ified distro all
251 # Note: this is done at 'make install' time.
252 # Note 2: the ifeq/else/endif have to be indented one space
253 # because otherwise it seems that automake thinks it should
254 # be the one to handle the else/endif parts, not GNU make
258 if test -r html ; then \
259 mkdir -p $(DESTDIR)$(datadir)/doc/valgrind; \
260 cp -r html $(DESTDIR)$(datadir)/doc/valgrind; \
263 if test -r $$f ; then \
264 mkdir -p $(DESTDIR)$(mandir)/man1; \
265 cp $$f $(DESTDIR)$(mandir)/man1; \
268 ifeq ($(BUILD_ALL_DOCS),yes)
270 if test -r index.pdf ; then \
271 mkdir -p $(DESTDIR)$(datadir)/doc/valgrind; \
272 cp index.pdf $(DESTDIR)$(datadir)/doc/valgrind/valgrind_manual.pdf; \
275 if test -r index.ps ; then \
276 mkdir -p $(DESTDIR)$(datadir)/doc/valgrind; \
277 cp index.ps $(DESTDIR)$(datadir)/doc/valgrind/valgrind_manual.ps; \
281 # This is done at 'make dist' time. It builds the html docs, print
282 # docs and man pages and copies them into the docs/ directory in the
284 ifeq ($(BUILD_ALL_DOCS),yes)
285 dist-hook: FAQ.txt html-docs man-pages print-docs
286 cp -r html $(distdir)
287 cp FAQ.txt $(distdir)/..
289 cp print/index.pdf $(distdir)
290 cp print/index.ps $(distdir)
292 dist-hook: FAQ.txt html-docs man-pages
293 cp -r html $(distdir)
294 cp FAQ.txt $(distdir)/..
301 rm -f $(top_builddir)/FAQ.txt $(top_builddir)/docs/*.1
304 rm -f valid-manual valid-manpages
307 # -----------------------------------------------------------------------
308 # Note: the rest of this file is nothing to do with the normal build
309 # tree. The stuff below contains special targets for web-site
312 # chunked html with no html/body tags, css, or top nav, to fit into the website
314 @echo "Generating website html files ..."
315 export XML_CATALOG_FILES=$(XML_CATALOG_FILES)
316 /bin/rm -fr $(websitedir)
317 mkdir -p $(websitedir)
318 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(websitedir)/ $(XSL_WEBSITE_STYLE) $(myxmldir)/index.xml
320 # valkyrie carries around her own copy of the valgrind manual
322 @echo "Generating a set of valgrind docs for valkyrie..."
323 export XML_CATALOG_FILES=$(XML_CATALOG_FILES)
324 /bin/rm -fr $(valkyriedir)
325 mkdir -p $(valkyriedir)
326 mkdir -p $(valkyriedir)/images
327 cp $(mylibdir)/vg_basic.css $(valkyriedir)/
328 cp $(myimgdir)/*.png $(valkyriedir)/images/
329 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(valkyriedir)/ $(XSL_HTML_CHUNK_STYLE) $(myxmldir)/index.xml
331 # html.tar.bz2, .pdf, .ps.bz2 files for downloading from the website
333 export XML_CATALOG_FILES=$(XML_CATALOG_FILES)
334 /bin/rm -fr $(downloadsdir)
335 mkdir -p $(downloadsdir)
337 @echo "Generating valgrind_manual.html.tar.bz2 ..."
338 export XML_CATALOG_FILES=$(XML_CATALOG_FILES)
341 mkdir -p $(vgdir)/html
342 mkdir -p $(vgdir)/html/images
343 cp $(mylibdir)/vg_basic.css $(vgdir)/html/
344 cp $(myimgdir)/*.png $(vgdir)/html/images/
345 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(vgdir)/html/ $(XSL_HTML_CHUNK_STYLE) $(myxmldir)/index.xml
346 (cd $(top_builddir)/docs/ && \
347 (tar cfj $(downloadsdir)/valgrind_manual.html.tar.bz2 ./valgrind/html/ ) )
348 /bin/rm -fr $(vgdir)/html/
350 @echo "Generating valgrind_manual.pdf ..."
351 mkdir -p $(vgdir)/print
352 mkdir -p $(vgdir)/print/images
353 cp $(myimgdir)/*.png $(vgdir)/print/images/
354 xmlto -v $(WITH_FOP) --stringparam=keep.relative.image.uris="1" \
356 --searchpath print pdf $(myxmldir)/index.xml &> $(LOGFILE)
357 mv index.pdf $(vgdir)/print/manual.pdf
359 @echo "Generating valgrind_manual.ps.bz2 ..."
360 (cd $(vgdir)/print/ && \
361 ( pdftops manual.pdf ) )
362 mv $(vgdir)/print/manual.pdf $(downloadsdir)/valgrind_manual.pdf
363 mv $(vgdir)/print/manual.ps $(downloadsdir)/valgrind_manual.ps
364 bzip2 $(downloadsdir)/valgrind_manual.ps
365 /bin/rm -fr $(vgdir) $(LOGFILE)