drd/tests/tsan_thread_wrappers_pthread.h: Fix MyThread::ThreadBody()
[valgrind.git] / docs / Makefile.am
blobe848b781d3bb23f31f7b225caee95483238aa018
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         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 \
49         internals/notes.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 \
67         lib/line-wrap.xsl \
68         lib/vg_basic.css \
69         lib/vg-fo.xsl \
70         lib/vg-faq2txt.xsl \
71         lib/vg-html-chunk.xsl \
72         lib/vg-html-website.xsl \
73         lib/vg-html-common.xsl \
74         xml/FAQ.xml \
75         xml/dist-docs.xml \
76         xml/index.xml \
77         xml/licenses.xml \
78         xml/manpages-index.xml \
79         xml/manual.xml \
80         xml/manual-intro.xml \
81         xml/manual-core.xml \
82         xml/manual-core-adv.xml \
83         xml/manual-writing-tools.xml \
84         xml/design-impl.xml \
85         xml/quick-start-guide.xml \
86         xml/tech-docs.xml \
87         xml/valgrind-manpage.xml \
88         xml/vg-entities.xml \
89         xml/xml_help.txt
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
110 LOGFILE = print.log
112 # validation stuff
113 XMLLINT       = xmllint
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
120 XSLTPROC       = xsltproc
121 XSLTPROC_FLAGS = --nonet --xinclude
123 # stylesheets
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
128 XSL_MAN_STYLES = \
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
135 valid:
136         $(XMLLINT) $(XMLLINT_FLAGS) $(myxmldir)/index.xml
138 # The text version of the FAQ.
139 FAQ.txt:
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
145 man-pages:
146         set -e; \
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; \
152                 exit 0; \
153             fi; \
154         done; \
155         echo ""; \
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."; \
159         exit 1;
161 # chunked html, on a chapter-by-chapter basis
162 html-docs:
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
173 # pdf and postscript
174 print-docs:
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
191 # the time.
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
197 # as we intend.
198 install-data-hook:
199         set -e; \
200         if test -r html ; then \
201                 mkdir -p $(DESTDIR)$(datadir)/doc/valgrind; \
202                 cp -r html $(DESTDIR)$(datadir)/doc/valgrind; \
203         fi
204         for f in *.1 ; do \
205                 if test -r $$f ; then \
206                         mkdir -p $(DESTDIR)$(mandir)/man1; \
207                         cp $$f $(DESTDIR)$(mandir)/man1; \
208                 fi \
209         done
210  ifeq ($(BUILD_ALL_DOCS),yes)
211         set -e; \
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; \
215         fi
216         set -e; \
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; \
220         fi
221  endif
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
225 # tarball.
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)/..
230         cp *.1 $(distdir)
231         cp print/index.pdf $(distdir)
232         cp print/index.ps $(distdir)
233  else
234 dist-hook: FAQ.txt html-docs man-pages
235         cp -r html $(distdir)
236         cp FAQ.txt $(distdir)/..
237         cp *.1 $(distdir)
238  endif
240 distclean-local:
241         rm -rf html print
242         rm -f FAQ.txt
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
250 # artefacts.
252 # chunked html with no html/body tags, css, or top nav, to fit into the website
253 website-docs:
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
261 valkyrie-docs:
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
272 download-docs:
273         export XML_CATALOG_FILES=$(XML_CATALOG_FILES)
274         /bin/rm -fr $(downloadsdir)
275         mkdir -p $(downloadsdir)
276         @echo ""
277         @echo "Generating valgrind_manual.html.tar.bz2 ..."
278         export XML_CATALOG_FILES=$(XML_CATALOG_FILES)
279         /bin/rm -fr $(vgdir)
280         mkdir -p $(vgdir)
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/
289         @echo ""
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 )
298         @echo ""
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
305         /bin/rm -fr $(vgdir)