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 internals/3_0_BUGSTATUS.txt \
23 internals/3_1_BUGSTATUS.txt \
24 internals/3_2_BUGSTATUS.txt \
25 internals/3_3_BUGSTATUS.txt \
26 internals/3_4_BUGSTATUS.txt \
27 internals/3_5_BUGSTATUS.txt \
28 internals/arm_thumb_notes_gdbserver.txt \
29 internals/BIG_APP_NOTES.txt \
30 internals/Darwin-notes.txt \
31 internals/directory-structure.txt \
32 internals/howto_BUILD_KDE42.txt \
33 internals/howto_oprofile.txt \
34 internals/m_replacemalloc.txt \
35 internals/m_syswrap.txt \
36 internals/module-structure.txt \
38 internals/porting-HOWTO.txt \
39 internals/mpi2entries.txt \
40 internals/porting-to-ARM.txt \
41 internals/register-uses.txt \
42 internals/release-HOWTO.txt \
43 internals/segments-seginfos.txt \
44 internals/threads-syscalls-signals.txt \
45 internals/tm-mutexstates.dot \
46 internals/tm-threadstates.dot \
47 internals/tracking-fn-entry-exit.txt \
48 internals/why-no-libc.txt \
49 internals/xml-output.txt \
50 internals/xml-output-protocol4.txt \
55 lib/vg-html-chunk.xsl \
56 lib/vg-html-website.xsl \
57 lib/vg-html-common.xsl \
62 xml/manpages-index.xml \
64 xml/manual-intro.xml \
66 xml/manual-core-adv.xml \
67 xml/manual-writing-tools.xml \
69 xml/quick-start-guide.xml \
71 xml/valgrind-manpage.xml \
76 ##-------------------------------------------------------------------
77 ## Below here is more ordinary make stuff...
78 ##-------------------------------------------------------------------
79 myxmldir = $(top_srcdir)/docs/xml
80 myimgdir = $(top_srcdir)/docs/images
81 mylibdir = $(top_srcdir)/docs/lib
83 myhtmldir = $(top_builddir)/docs/html
84 myprintdir = $(top_builddir)/docs/print
86 websitedir = $(top_builddir)/docs/website
87 valkyriedir = $(top_builddir)/docs/vg-html
88 downloadsdir = $(top_builddir)/docs/downloads
89 vgdir = $(top_builddir)/docs/valgrind
91 XML_CATALOG_FILES = /etc/xml/catalog
93 # file to log print output to
98 LINT_FLAGS = --noblanks --noout --xinclude --postvalid --noent
99 # validate with docbook 4.3 'cos it supports xml:base natively
100 VALID_FLAGS = --dtdvalid http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd
101 XMLLINT_FLAGS = $(LINT_FLAGS) $(VALID_FLAGS)
103 # stylesheet processor
105 XSLTPROC_FLAGS = --nonet --xinclude
108 XSL_HTML_CHUNK_STYLE = $(mylibdir)/vg-html-chunk.xsl
109 XSL_FO_STYLE = $(mylibdir)/vg-fo.xsl
110 XSL_TEXT_STYLE = $(mylibdir)/vg-faq2txt.xsl
111 XSL_WEBSITE_STYLE = $(mylibdir)/vg-html-website.xsl
113 /usr/share/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl \
114 /usr/share/xml/docbook/stylesheet/nwalsh/current/manpages/docbook.xsl \
115 /usr/share/xml/docbook/stylesheet/nwalsh/manpages/docbook.xsl
117 all-docs: FAQ.txt man-pages html-docs print-docs
120 $(XMLLINT) $(XMLLINT_FLAGS) $(myxmldir)/index.xml
122 # The text version of the FAQ.
124 @echo "Generating the text version of the FAQ ..."
125 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) && \
126 $(XSLTPROC) $(XSLTPROC_FLAGS) -o ./FAQ.txt $(XSL_TEXT_STYLE) $(myxmldir)/FAQ.xml
128 # the valgrind manpages
131 for x in $(XSL_MAN_STYLES) ; do \
132 if test -f $$x; then \
133 echo "Using manpage stylesheet: $$x"; \
134 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) && \
135 $(XSLTPROC) $(XSLTPROC_FLAGS) -o ./ $$x $(myxmldir)/manpages-index.xml; \
140 echo "Error: I can't find the XSL_MAN_STYLE file"; \
141 echo "Please check where it lives on your system, and" \
142 "amend the line 'XSL_MAN_STYLES = ' in this Makefile."; \
145 # chunked html, on a chapter-by-chapter basis
147 @echo "Generating html files..."
148 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) && \
149 mkdir -p $(myhtmldir) && \
150 /bin/rm -fr $(myhtmldir)/ && \
151 mkdir -p $(myhtmldir)/ && \
152 mkdir -p $(myhtmldir)/images && \
153 cp $(mylibdir)/vg_basic.css $(myhtmldir)/ && \
154 cp $(myimgdir)/*.png $(myhtmldir)/images && \
155 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(myhtmldir)/ $(XSL_HTML_CHUNK_STYLE) $(myxmldir)/index.xml
159 @echo "Generating PDF file: $(myprintdir)/index.pdf (please be patient)...";
160 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) && \
161 mkdir -p $(myprintdir) && \
162 mkdir -p $(myprintdir)/images && \
163 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(myprintdir)/index.fo $(XSL_FO_STYLE) $(myxmldir)/index.xml && \
164 (cd $(myprintdir) && \
165 ( pdfxmltex index.fo && \
166 pdfxmltex index.fo && \
167 pdfxmltex index.fo ) &> $(LOGFILE) < /dev/null && \
168 echo "Generating PS file: $(myprintdir)/index.ps ..." && \
169 pdftops index.pdf && \
170 rm -f *.log *.aux *.fo *.out)
172 # If the docs have been built, install them. But don't worry if they have
173 # not -- developers do 'make install' not from a 'make dist'-ified distro all
176 # Note: this is done at 'make install' time.
177 # Note 2: the ifeq/else/endif have to be indented one space
178 # because otherwise it seems that automake thinks it should
179 # be the one to handle the else/endif parts, not GNU make
183 if test -r html ; then \
184 mkdir -p $(DESTDIR)$(datadir)/doc/valgrind; \
185 cp -r html $(DESTDIR)$(datadir)/doc/valgrind; \
188 if test -r $$f ; then \
189 mkdir -p $(DESTDIR)$(mandir)/man1; \
190 cp $$f $(DESTDIR)$(mandir)/man1; \
193 ifeq ($(BUILD_ALL_DOCS),yes)
195 if test -r index.pdf ; then \
196 mkdir -p $(DESTDIR)$(datadir)/doc/valgrind; \
197 cp index.pdf $(DESTDIR)$(datadir)/doc/valgrind/valgrind_manual.pdf; \
200 if test -r index.ps ; then \
201 mkdir -p $(DESTDIR)$(datadir)/doc/valgrind; \
202 cp index.ps $(DESTDIR)$(datadir)/doc/valgrind/valgrind_manual.ps; \
206 # This is done at 'make dist' time. It builds the html docs, print
207 # docs and man pages and copies them into the docs/ directory in the
209 ifeq ($(BUILD_ALL_DOCS),yes)
210 dist-hook: FAQ.txt html-docs man-pages print-docs
211 cp -r html $(distdir)
212 cp FAQ.txt $(distdir)/..
214 cp print/index.pdf $(distdir)
215 cp print/index.ps $(distdir)
217 dist-hook: FAQ.txt html-docs man-pages
218 cp -r html $(distdir)
219 cp FAQ.txt $(distdir)/..
225 rm -f $(top_builddir)/FAQ.txt $(top_builddir)/docs/*.1
229 # -----------------------------------------------------------------------
230 # Note: the rest of this file is nothing to do with the normal build
231 # tree. The stuff below contains special targets for web-site
234 # chunked html with no html/body tags, css, or top nav, to fit into the website
236 @echo "Generating website html files ..."
237 export XML_CATALOG_FILES=$(XML_CATALOG_FILES)
238 /bin/rm -fr $(websitedir)
239 mkdir -p $(websitedir)
240 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(websitedir)/ $(XSL_WEBSITE_STYLE) $(myxmldir)/index.xml
242 # valkyrie carries around her own copy of the valgrind manual
244 @echo "Generating a set of valgrind docs for valkyrie..."
245 export XML_CATALOG_FILES=$(XML_CATALOG_FILES)
246 /bin/rm -fr $(valkyriedir)
247 mkdir -p $(valkyriedir)
248 mkdir -p $(valkyriedir)/images
249 cp $(mylibdir)/vg_basic.css $(valkyriedir)/
250 cp $(myimgdir)/*.png $(valkyriedir)/images/
251 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(valkyriedir)/ $(XSL_HTML_CHUNK_STYLE) $(myxmldir)/index.xml
253 # html.tar.bz2, .pdf, .ps.bz2 files for downloading from the website
255 export XML_CATALOG_FILES=$(XML_CATALOG_FILES)
256 /bin/rm -fr $(downloadsdir)
257 mkdir -p $(downloadsdir)
259 @echo "Generating valgrind_manual.html.tar.bz2 ..."
260 export XML_CATALOG_FILES=$(XML_CATALOG_FILES)
263 mkdir -p $(vgdir)/html
264 mkdir -p $(vgdir)/html/images
265 cp $(mylibdir)/vg_basic.css $(vgdir)/html/
266 cp $(myimgdir)/*.png $(vgdir)/html/images/
267 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(vgdir)/html/ $(XSL_HTML_CHUNK_STYLE) $(myxmldir)/index.xml
268 (cd $(top_builddir)/docs/ && \
269 (tar cfj $(downloadsdir)/valgrind_manual.html.tar.bz2 ./valgrind/html/ ) )
270 /bin/rm -fr $(vgdir)/html/
272 @echo "Generating valgrind_manual.pdf ..."
273 mkdir -p $(vgdir)/print
274 mkdir -p $(vgdir)/print/images
275 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(vgdir)/print/manual.fo $(XSL_FO_STYLE) $(myxmldir)/index.xml
276 (cd $(vgdir)/print/ && \
277 ( pdfxmltex manual.fo && \
278 pdfxmltex manual.fo && \
279 pdfxmltex manual.fo ) &> $(LOGFILE) < /dev/null )
281 @echo "Generating valgrind_manual.ps.bz2 ..."
282 (cd $(vgdir)/print/ && \
283 ( pdftops manual.pdf ) )
284 mv $(vgdir)/print/manual.pdf $(downloadsdir)/valgrind_manual.pdf
285 mv $(vgdir)/print/manual.ps $(downloadsdir)/valgrind_manual.ps
286 bzip2 $(downloadsdir)/valgrind_manual.ps