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/MERGE_3_10_1.txt \
36 internals/arm_thumb_notes_gdbserver.txt \
37 internals/avx-notes.txt \
38 internals/BIG_APP_NOTES.txt \
39 internals/Darwin-notes.txt \
40 internals/SPEC-notes.txt \
41 internals/directory-structure.txt \
42 internals/howto_BUILD_KDE42.txt \
43 internals/howto_oprofile.txt \
44 internals/m_replacemalloc.txt \
45 internals/m_syswrap.txt \
46 internals/module-structure.txt \
47 internals/multiple-architectures.txt \
49 internals/performance.txt \
50 internals/porting-HOWTO.txt \
51 internals/mpi2entries.txt \
52 internals/porting-to-ARM.txt \
53 internals/qemu-aarch64-linux-HOWTO.txt \
54 internals/qemu-mips64-linux-HOWTO.txt \
55 internals/register-uses.txt \
56 internals/release-HOWTO.txt \
57 internals/segments-seginfos.txt \
58 internals/t-chaining-notes.txt \
59 internals/threads-syscalls-signals.txt \
60 internals/tm-mutexstates.dot \
61 internals/tm-threadstates.dot \
62 internals/tracking-fn-entry-exit.txt \
63 internals/why-no-libc.txt \
64 internals/xml-output.txt \
65 internals/xml-output-protocol4.txt \
70 lib/vg-html-chunk.xsl \
71 lib/vg-html-website.xsl \
72 lib/vg-html-common.xsl \
77 xml/manpages-index.xml \
79 xml/manual-intro.xml \
81 xml/manual-core-adv.xml \
82 xml/manual-writing-tools.xml \
84 xml/quick-start-guide.xml \
86 xml/valgrind-manpage.xml \
91 ##-------------------------------------------------------------------
92 ## Below here is more ordinary make stuff...
93 ##-------------------------------------------------------------------
94 myxmldir = $(top_srcdir)/docs/xml
95 myimgdir = $(top_srcdir)/docs/images
96 mylibdir = $(top_srcdir)/docs/lib
98 myhtmldir = $(top_builddir)/docs/html
99 myprintdir = $(top_builddir)/docs/print
101 websitedir = $(top_builddir)/docs/website
102 valkyriedir = $(top_builddir)/docs/vg-html
103 downloadsdir = $(top_builddir)/docs/downloads
104 vgdir = $(top_builddir)/docs/valgrind
106 XML_CATALOG_FILES = /etc/xml/catalog
108 # file to log print output to
113 LINT_FLAGS = --noblanks --noout --xinclude --postvalid --noent
114 # validate with docbook 4.3 'cos it supports xml:base natively
115 VALID_FLAGS = --dtdvalid http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd
116 XMLLINT_FLAGS = $(LINT_FLAGS) $(VALID_FLAGS)
118 # stylesheet processor
120 XSLTPROC_FLAGS = --nonet --xinclude
123 XSL_HTML_CHUNK_STYLE = $(mylibdir)/vg-html-chunk.xsl
124 XSL_FO_STYLE = $(mylibdir)/vg-fo.xsl
125 XSL_TEXT_STYLE = $(mylibdir)/vg-faq2txt.xsl
126 XSL_WEBSITE_STYLE = $(mylibdir)/vg-html-website.xsl
128 /usr/share/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl \
129 /usr/share/xml/docbook/stylesheet/nwalsh/current/manpages/docbook.xsl \
130 /usr/share/xml/docbook/stylesheet/nwalsh/manpages/docbook.xsl
132 all-docs: FAQ.txt man-pages html-docs print-docs
135 $(XMLLINT) $(XMLLINT_FLAGS) $(myxmldir)/index.xml
137 # The text version of the FAQ.
139 @echo "Generating the text version of the FAQ ..."
140 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) && \
141 $(XSLTPROC) $(XSLTPROC_FLAGS) -o ./FAQ.txt $(XSL_TEXT_STYLE) $(myxmldir)/FAQ.xml
143 # the valgrind manpages
146 for x in $(XSL_MAN_STYLES) ; do \
147 if test -f $$x; then \
148 echo "Using manpage stylesheet: $$x"; \
149 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) && \
150 $(XSLTPROC) $(XSLTPROC_FLAGS) -o ./ $$x $(myxmldir)/manpages-index.xml; \
155 echo "Error: I can't find the XSL_MAN_STYLE file"; \
156 echo "Please check where it lives on your system, and" \
157 "amend the line 'XSL_MAN_STYLES = ' in this Makefile."; \
160 # chunked html, on a chapter-by-chapter basis
162 @echo "Generating html files..."
163 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) && \
164 mkdir -p $(myhtmldir) && \
165 /bin/rm -fr $(myhtmldir)/ && \
166 mkdir -p $(myhtmldir)/ && \
167 mkdir -p $(myhtmldir)/images && \
168 cp $(mylibdir)/vg_basic.css $(myhtmldir)/ && \
169 cp $(myimgdir)/*.png $(myhtmldir)/images && \
170 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(myhtmldir)/ $(XSL_HTML_CHUNK_STYLE) $(myxmldir)/index.xml
174 @echo "Generating PDF file: $(myprintdir)/index.pdf (please be patient)...";
175 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) && \
176 mkdir -p $(myprintdir) && \
177 mkdir -p $(myprintdir)/images && \
178 cp $(myimgdir)/*.png $(myprintdir)/images && \
179 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(myprintdir)/index.fo $(XSL_FO_STYLE) $(myxmldir)/index.xml && \
180 (cd $(myprintdir) && \
181 ( pdfxmltex index.fo && \
182 pdfxmltex index.fo && \
183 pdfxmltex index.fo ) &> $(LOGFILE) < /dev/null && \
184 echo "Generating PS file: $(myprintdir)/index.ps ..." && \
185 pdftops index.pdf && \
186 rm -f *.log *.aux *.fo *.out)
188 # If the docs have been built, install them. But don't worry if they have
189 # not -- developers do 'make install' not from a 'make dist'-ified distro all
192 # Note: this is done at 'make install' time.
193 # Note 2: the ifeq/else/endif have to be indented one space
194 # because otherwise it seems that automake thinks it should
195 # be the one to handle the else/endif parts, not GNU make
199 if test -r html ; then \
200 mkdir -p $(DESTDIR)$(datadir)/doc/valgrind; \
201 cp -r html $(DESTDIR)$(datadir)/doc/valgrind; \
204 if test -r $$f ; then \
205 mkdir -p $(DESTDIR)$(mandir)/man1; \
206 cp $$f $(DESTDIR)$(mandir)/man1; \
209 ifeq ($(BUILD_ALL_DOCS),yes)
211 if test -r index.pdf ; then \
212 mkdir -p $(DESTDIR)$(datadir)/doc/valgrind; \
213 cp index.pdf $(DESTDIR)$(datadir)/doc/valgrind/valgrind_manual.pdf; \
216 if test -r index.ps ; then \
217 mkdir -p $(DESTDIR)$(datadir)/doc/valgrind; \
218 cp index.ps $(DESTDIR)$(datadir)/doc/valgrind/valgrind_manual.ps; \
222 # This is done at 'make dist' time. It builds the html docs, print
223 # docs and man pages and copies them into the docs/ directory in the
225 ifeq ($(BUILD_ALL_DOCS),yes)
226 dist-hook: FAQ.txt html-docs man-pages print-docs
227 cp -r html $(distdir)
228 cp FAQ.txt $(distdir)/..
230 cp print/index.pdf $(distdir)
231 cp print/index.ps $(distdir)
233 dist-hook: FAQ.txt html-docs man-pages
234 cp -r html $(distdir)
235 cp FAQ.txt $(distdir)/..
242 rm -f $(top_builddir)/FAQ.txt $(top_builddir)/docs/*.1
246 # -----------------------------------------------------------------------
247 # Note: the rest of this file is nothing to do with the normal build
248 # tree. The stuff below contains special targets for web-site
251 # chunked html with no html/body tags, css, or top nav, to fit into the website
253 @echo "Generating website html files ..."
254 export XML_CATALOG_FILES=$(XML_CATALOG_FILES)
255 /bin/rm -fr $(websitedir)
256 mkdir -p $(websitedir)
257 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(websitedir)/ $(XSL_WEBSITE_STYLE) $(myxmldir)/index.xml
259 # valkyrie carries around her own copy of the valgrind manual
261 @echo "Generating a set of valgrind docs for valkyrie..."
262 export XML_CATALOG_FILES=$(XML_CATALOG_FILES)
263 /bin/rm -fr $(valkyriedir)
264 mkdir -p $(valkyriedir)
265 mkdir -p $(valkyriedir)/images
266 cp $(mylibdir)/vg_basic.css $(valkyriedir)/
267 cp $(myimgdir)/*.png $(valkyriedir)/images/
268 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(valkyriedir)/ $(XSL_HTML_CHUNK_STYLE) $(myxmldir)/index.xml
270 # html.tar.bz2, .pdf, .ps.bz2 files for downloading from the website
272 export XML_CATALOG_FILES=$(XML_CATALOG_FILES)
273 /bin/rm -fr $(downloadsdir)
274 mkdir -p $(downloadsdir)
276 @echo "Generating valgrind_manual.html.tar.bz2 ..."
277 export XML_CATALOG_FILES=$(XML_CATALOG_FILES)
280 mkdir -p $(vgdir)/html
281 mkdir -p $(vgdir)/html/images
282 cp $(mylibdir)/vg_basic.css $(vgdir)/html/
283 cp $(myimgdir)/*.png $(vgdir)/html/images/
284 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(vgdir)/html/ $(XSL_HTML_CHUNK_STYLE) $(myxmldir)/index.xml
285 (cd $(top_builddir)/docs/ && \
286 (tar cfj $(downloadsdir)/valgrind_manual.html.tar.bz2 ./valgrind/html/ ) )
287 /bin/rm -fr $(vgdir)/html/
289 @echo "Generating valgrind_manual.pdf ..."
290 mkdir -p $(vgdir)/print
291 mkdir -p $(vgdir)/print/images
292 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(vgdir)/print/manual.fo $(XSL_FO_STYLE) $(myxmldir)/index.xml
293 (cd $(vgdir)/print/ && \
294 ( pdfxmltex manual.fo && \
295 pdfxmltex manual.fo && \
296 pdfxmltex manual.fo ) &> $(LOGFILE) < /dev/null )
298 @echo "Generating valgrind_manual.ps.bz2 ..."
299 (cd $(vgdir)/print/ && \
300 ( pdftops manual.pdf ) )
301 mv $(vgdir)/print/manual.pdf $(downloadsdir)/valgrind_manual.pdf
302 mv $(vgdir)/print/manual.ps $(downloadsdir)/valgrind_manual.ps
303 bzip2 $(downloadsdir)/valgrind_manual.ps