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 \
23 internals/3_0_BUGSTATUS.txt \
24 internals/3_1_BUGSTATUS.txt \
25 internals/3_2_BUGSTATUS.txt \
26 internals/3_3_BUGSTATUS.txt \
27 internals/3_4_BUGSTATUS.txt \
28 internals/3_5_BUGSTATUS.txt \
29 internals/3_7_BUGSTATUS.txt \
30 internals/3_8_BUGSTATUS.txt \
31 internals/3_9_BUGSTATUS.txt \
32 internals/3_10_BUGSTATUS.txt \
33 internals/3_11_BUGSTATUS.txt \
34 internals/3_12_BUGSTATUS.txt \
35 internals/3_13_BUGSTATUS.txt \
36 internals/MERGE_3_10_1.txt \
37 internals/arm_thumb_notes_gdbserver.txt \
38 internals/avx-notes.txt \
39 internals/BIG_APP_NOTES.txt \
40 internals/Darwin-notes.txt \
41 internals/SPEC-notes.txt \
42 internals/directory-structure.txt \
43 internals/howto_BUILD_KDE42.txt \
44 internals/howto_oprofile.txt \
45 internals/m_replacemalloc.txt \
46 internals/m_syswrap.txt \
47 internals/module-structure.txt \
48 internals/multiple-architectures.txt \
50 internals/performance.txt \
51 internals/porting-HOWTO.txt \
52 internals/mpi2entries.txt \
53 internals/porting-to-ARM.txt \
54 internals/qemu-aarch64-linux-HOWTO.txt \
55 internals/qemu-mips64-linux-HOWTO.txt \
56 internals/register-uses.txt \
57 internals/release-HOWTO.txt \
58 internals/segments-seginfos.txt \
59 internals/t-chaining-notes.txt \
60 internals/threads-syscalls-signals.txt \
61 internals/tm-mutexstates.dot \
62 internals/tm-threadstates.dot \
63 internals/tracking-fn-entry-exit.txt \
64 internals/why-no-libc.txt \
65 internals/xml-output.txt \
66 internals/xml-output-protocol4.txt \
71 lib/vg-html-chunk.xsl \
72 lib/vg-html-website.xsl \
73 lib/vg-html-common.xsl \
78 xml/manpages-index.xml \
80 xml/manual-intro.xml \
82 xml/manual-core-adv.xml \
83 xml/manual-writing-tools.xml \
85 xml/quick-start-guide.xml \
87 xml/valgrind-manpage.xml \
92 ##-------------------------------------------------------------------
93 ## Below here is more ordinary make stuff...
94 ##-------------------------------------------------------------------
95 myxmldir = $(top_srcdir)/docs/xml
96 myimgdir = $(top_srcdir)/docs/images
97 mylibdir = $(top_srcdir)/docs/lib
99 myhtmldir = $(top_builddir)/docs/html
100 myprintdir = $(top_builddir)/docs/print
102 websitedir = $(top_builddir)/docs/website
103 valkyriedir = $(top_builddir)/docs/vg-html
104 downloadsdir = $(top_builddir)/docs/downloads
105 vgdir = $(top_builddir)/docs/valgrind
107 XML_CATALOG_FILES = /etc/xml/catalog
109 # file to log print output to
114 LINT_FLAGS = --noblanks --noout --xinclude --postvalid --noent
115 # validate with docbook 4.3 'cos it supports xml:base natively
116 VALID_FLAGS = --dtdvalid http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd
117 XMLLINT_FLAGS = $(LINT_FLAGS) $(VALID_FLAGS)
119 # stylesheet processor
121 XSLTPROC_FLAGS = --nonet --xinclude
124 XSL_HTML_CHUNK_STYLE = $(mylibdir)/vg-html-chunk.xsl
125 XSL_FO_STYLE = $(mylibdir)/vg-fo.xsl
126 XSL_TEXT_STYLE = $(mylibdir)/vg-faq2txt.xsl
127 XSL_WEBSITE_STYLE = $(mylibdir)/vg-html-website.xsl
129 /usr/share/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl \
130 /usr/share/xml/docbook/stylesheet/nwalsh/current/manpages/docbook.xsl \
131 /usr/share/xml/docbook/stylesheet/nwalsh/manpages/docbook.xsl
133 all-docs: FAQ.txt man-pages html-docs print-docs
136 $(XMLLINT) $(XMLLINT_FLAGS) $(myxmldir)/index.xml
138 # The text version of the FAQ.
140 @echo "Generating the text version of the FAQ ..."
141 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) && \
142 $(XSLTPROC) $(XSLTPROC_FLAGS) -o ./FAQ.txt $(XSL_TEXT_STYLE) $(myxmldir)/FAQ.xml
144 # the valgrind manpages
147 for x in $(XSL_MAN_STYLES) ; do \
148 if test -f $$x; then \
149 echo "Using manpage stylesheet: $$x"; \
150 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) && \
151 $(XSLTPROC) $(XSLTPROC_FLAGS) -o ./ $$x $(myxmldir)/manpages-index.xml; \
156 echo "Error: I can't find the XSL_MAN_STYLE file"; \
157 echo "Please check where it lives on your system, and" \
158 "amend the line 'XSL_MAN_STYLES = ' in this Makefile."; \
161 # chunked html, on a chapter-by-chapter basis
163 @echo "Generating html files..."
164 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) && \
165 mkdir -p $(myhtmldir) && \
166 /bin/rm -fr $(myhtmldir)/ && \
167 mkdir -p $(myhtmldir)/ && \
168 mkdir -p $(myhtmldir)/images && \
169 cp $(mylibdir)/vg_basic.css $(myhtmldir)/ && \
170 cp $(myimgdir)/*.png $(myhtmldir)/images && \
171 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(myhtmldir)/ $(XSL_HTML_CHUNK_STYLE) $(myxmldir)/index.xml
175 @echo "Generating PDF file: $(myprintdir)/index.pdf (please be patient)...";
176 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) && \
177 mkdir -p $(myprintdir) && \
178 mkdir -p $(myprintdir)/images && \
179 cp $(myimgdir)/*.png $(myprintdir)/images && \
180 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(myprintdir)/index.fo $(XSL_FO_STYLE) $(myxmldir)/index.xml && \
181 (cd $(myprintdir) && \
182 ( pdfxmltex index.fo && \
183 pdfxmltex index.fo && \
184 pdfxmltex index.fo ) &> $(LOGFILE) < /dev/null && \
185 echo "Generating PS file: $(myprintdir)/index.ps ..." && \
186 pdftops index.pdf && \
187 rm -f *.log *.aux *.fo *.out)
189 # If the docs have been built, install them. But don't worry if they have
190 # not -- developers do 'make install' not from a 'make dist'-ified distro all
193 # Note: this is done at 'make install' time.
194 # Note 2: the ifeq/else/endif have to be indented one space
195 # because otherwise it seems that automake thinks it should
196 # be the one to handle the else/endif parts, not GNU make
200 if test -r html ; then \
201 mkdir -p $(DESTDIR)$(datadir)/doc/valgrind; \
202 cp -r html $(DESTDIR)$(datadir)/doc/valgrind; \
205 if test -r $$f ; then \
206 mkdir -p $(DESTDIR)$(mandir)/man1; \
207 cp $$f $(DESTDIR)$(mandir)/man1; \
210 ifeq ($(BUILD_ALL_DOCS),yes)
212 if test -r index.pdf ; then \
213 mkdir -p $(DESTDIR)$(datadir)/doc/valgrind; \
214 cp index.pdf $(DESTDIR)$(datadir)/doc/valgrind/valgrind_manual.pdf; \
217 if test -r index.ps ; then \
218 mkdir -p $(DESTDIR)$(datadir)/doc/valgrind; \
219 cp index.ps $(DESTDIR)$(datadir)/doc/valgrind/valgrind_manual.ps; \
223 # This is done at 'make dist' time. It builds the html docs, print
224 # docs and man pages and copies them into the docs/ directory in the
226 ifeq ($(BUILD_ALL_DOCS),yes)
227 dist-hook: FAQ.txt html-docs man-pages print-docs
228 cp -r html $(distdir)
229 cp FAQ.txt $(distdir)/..
231 cp print/index.pdf $(distdir)
232 cp print/index.ps $(distdir)
234 dist-hook: FAQ.txt html-docs man-pages
235 cp -r html $(distdir)
236 cp FAQ.txt $(distdir)/..
243 rm -f $(top_builddir)/FAQ.txt $(top_builddir)/docs/*.1
247 # -----------------------------------------------------------------------
248 # Note: the rest of this file is nothing to do with the normal build
249 # tree. The stuff below contains special targets for web-site
252 # chunked html with no html/body tags, css, or top nav, to fit into the website
254 @echo "Generating website html files ..."
255 export XML_CATALOG_FILES=$(XML_CATALOG_FILES)
256 /bin/rm -fr $(websitedir)
257 mkdir -p $(websitedir)
258 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(websitedir)/ $(XSL_WEBSITE_STYLE) $(myxmldir)/index.xml
260 # valkyrie carries around her own copy of the valgrind manual
262 @echo "Generating a set of valgrind docs for valkyrie..."
263 export XML_CATALOG_FILES=$(XML_CATALOG_FILES)
264 /bin/rm -fr $(valkyriedir)
265 mkdir -p $(valkyriedir)
266 mkdir -p $(valkyriedir)/images
267 cp $(mylibdir)/vg_basic.css $(valkyriedir)/
268 cp $(myimgdir)/*.png $(valkyriedir)/images/
269 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(valkyriedir)/ $(XSL_HTML_CHUNK_STYLE) $(myxmldir)/index.xml
271 # html.tar.bz2, .pdf, .ps.bz2 files for downloading from the website
273 export XML_CATALOG_FILES=$(XML_CATALOG_FILES)
274 /bin/rm -fr $(downloadsdir)
275 mkdir -p $(downloadsdir)
277 @echo "Generating valgrind_manual.html.tar.bz2 ..."
278 export XML_CATALOG_FILES=$(XML_CATALOG_FILES)
281 mkdir -p $(vgdir)/html
282 mkdir -p $(vgdir)/html/images
283 cp $(mylibdir)/vg_basic.css $(vgdir)/html/
284 cp $(myimgdir)/*.png $(vgdir)/html/images/
285 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(vgdir)/html/ $(XSL_HTML_CHUNK_STYLE) $(myxmldir)/index.xml
286 (cd $(top_builddir)/docs/ && \
287 (tar cfj $(downloadsdir)/valgrind_manual.html.tar.bz2 ./valgrind/html/ ) )
288 /bin/rm -fr $(vgdir)/html/
290 @echo "Generating valgrind_manual.pdf ..."
291 mkdir -p $(vgdir)/print
292 mkdir -p $(vgdir)/print/images
293 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(vgdir)/print/manual.fo $(XSL_FO_STYLE) $(myxmldir)/index.xml
294 (cd $(vgdir)/print/ && \
295 ( pdfxmltex manual.fo && \
296 pdfxmltex manual.fo && \
297 pdfxmltex manual.fo ) &> $(LOGFILE) < /dev/null )
299 @echo "Generating valgrind_manual.ps.bz2 ..."
300 (cd $(vgdir)/print/ && \
301 ( pdftops manual.pdf ) )
302 mv $(vgdir)/print/manual.pdf $(downloadsdir)/valgrind_manual.pdf
303 mv $(vgdir)/print/manual.ps $(downloadsdir)/valgrind_manual.ps
304 bzip2 $(downloadsdir)/valgrind_manual.ps