helgrind/tests/cond_timedwait_invalid: Update expected output because of r12213
[valgrind.git] / docs / Makefile.am
blob96bfa7074d35228b755288a7803f28458e62c8db
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.
10 BUILD_ALL_DOCS=yes
12 ##-------------------------------------------------------------
13 ## END OF HACK
14 ##-------------------------------------------------------------
16 EXTRA_DIST = \
17         README \
18         images/home.png \
19         images/next.png \
20         images/prev.png \
21         images/up.png \
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 \
37         internals/notes.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 \
51         lib/line-wrap.xsl \
52         lib/vg_basic.css \
53         lib/vg-fo.xsl \
54         lib/vg-faq2txt.xsl \
55         lib/vg-html-chunk.xsl \
56         lib/vg-html-website.xsl \
57         lib/vg-html-common.xsl \
58         xml/FAQ.xml \
59         xml/dist-docs.xml \
60         xml/index.xml \
61         xml/licenses.xml \
62         xml/manpages-index.xml \
63         xml/manual.xml \
64         xml/manual-intro.xml \
65         xml/manual-core.xml \
66         xml/manual-core-adv.xml \
67         xml/manual-writing-tools.xml \
68         xml/design-impl.xml \
69         xml/quick-start-guide.xml \
70         xml/tech-docs.xml \
71         xml/valgrind-manpage.xml \
72         xml/vg-entities.xml \
73         xml/xml_help.txt
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
94 LOGFILE = print.log
96 # validation stuff
97 XMLLINT       = xmllint
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
104 XSLTPROC       = xsltproc
105 XSLTPROC_FLAGS = --nonet --xinclude
107 # stylesheets
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
112 XSL_MAN_STYLES = \
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
119 valid:
120         $(XMLLINT) $(XMLLINT_FLAGS) $(myxmldir)/index.xml
122 # The text version of the FAQ.
123 FAQ.txt:
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
129 man-pages:
130         set -e; \
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; \
136                 exit 0; \
137             fi; \
138         done; \
139         echo ""; \
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."; \
143         exit 1;
145 # chunked html, on a chapter-by-chapter basis
146 html-docs:
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
157 # pdf and postscript
158 print-docs:
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
174 # the time.
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
180 # as we intend.
181 install-data-hook:
182         set -e; \
183         if test -r html ; then \
184                 mkdir -p $(DESTDIR)$(datadir)/doc/valgrind; \
185                 cp -r html $(DESTDIR)$(datadir)/doc/valgrind; \
186         fi
187         for f in *.1 ; do \
188                 if test -r $$f ; then \
189                         mkdir -p $(DESTDIR)$(mandir)/man1; \
190                         cp $$f $(DESTDIR)$(mandir)/man1; \
191                 fi \
192         done
193  ifeq ($(BUILD_ALL_DOCS),yes)
194         set -e; \
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; \
198         fi
199         set -e; \
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; \
203         fi
204  endif
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
208 # tarball.
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)/..
213         cp *.1 $(distdir)
214         cp print/index.pdf $(distdir)
215         cp print/index.ps $(distdir)
216  else
217 dist-hook: FAQ.txt html-docs man-pages
218         cp -r html $(distdir)
219         cp FAQ.txt $(distdir)/..
220         cp *.1 $(distdir)
221  endif
223 distclean-local:
224         rm -rf html print
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
232 # artefacts.
234 # chunked html with no html/body tags, css, or top nav, to fit into the website
235 website-docs:
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
243 valkyrie-docs:
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
254 download-docs:
255         export XML_CATALOG_FILES=$(XML_CATALOG_FILES)
256         /bin/rm -fr $(downloadsdir)
257         mkdir -p $(downloadsdir)
258         @echo ""
259         @echo "Generating valgrind_manual.html.tar.bz2 ..."
260         export XML_CATALOG_FILES=$(XML_CATALOG_FILES)
261         /bin/rm -fr $(vgdir)
262         mkdir -p $(vgdir)
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/
271         @echo ""
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 )
280         @echo ""
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
287         /bin/rm -fr $(vgdir)