1 2##------------------------------------------------------------- 3## HACK: stuff to avoid making the print docs if installing the 4## tools to do so is impractical / too difficult 5##------------------------------------------------------------- 6 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. 10BUILD_ALL_DOCS=yes 11 12##------------------------------------------------------------- 13## END OF HACK 14##------------------------------------------------------------- 15 16EXTRA_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/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 \ 48 internals/notes.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 \ 66 lib/line-wrap.xsl \ 67 lib/vg_basic.css \ 68 lib/vg-fo.xsl \ 69 lib/vg-faq2txt.xsl \ 70 lib/vg-html-chunk.xsl \ 71 lib/vg-html-website.xsl \ 72 lib/vg-html-common.xsl \ 73 xml/FAQ.xml \ 74 xml/dist-docs.xml \ 75 xml/index.xml \ 76 xml/licenses.xml \ 77 xml/manpages-index.xml \ 78 xml/manual.xml \ 79 xml/manual-intro.xml \ 80 xml/manual-core.xml \ 81 xml/manual-core-adv.xml \ 82 xml/manual-writing-tools.xml \ 83 xml/design-impl.xml \ 84 xml/quick-start-guide.xml \ 85 xml/tech-docs.xml \ 86 xml/valgrind-manpage.xml \ 87 xml/vg-entities.xml \ 88 xml/xml_help.txt 89 90 91##------------------------------------------------------------------- 92## Below here is more ordinary make stuff... 93##------------------------------------------------------------------- 94myxmldir = $(top_srcdir)/docs/xml 95myimgdir = $(top_srcdir)/docs/images 96mylibdir = $(top_srcdir)/docs/lib 97 98myhtmldir = $(top_builddir)/docs/html 99myprintdir = $(top_builddir)/docs/print 100 101websitedir = $(top_builddir)/docs/website 102valkyriedir = $(top_builddir)/docs/vg-html 103downloadsdir = $(top_builddir)/docs/downloads 104vgdir = $(top_builddir)/docs/valgrind 105 106XML_CATALOG_FILES = /etc/xml/catalog 107 108# file to log print output to 109LOGFILE = print.log 110 111# validation stuff 112XMLLINT = xmllint 113LINT_FLAGS = --noblanks --noout --xinclude --postvalid --noent 114# validate with docbook 4.3 'cos it supports xml:base natively 115VALID_FLAGS = --dtdvalid http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd 116XMLLINT_FLAGS = $(LINT_FLAGS) $(VALID_FLAGS) 117 118# stylesheet processor 119XSLTPROC = xsltproc 120XSLTPROC_FLAGS = --nonet --xinclude 121 122# stylesheets 123XSL_HTML_CHUNK_STYLE = $(mylibdir)/vg-html-chunk.xsl 124XSL_FO_STYLE = $(mylibdir)/vg-fo.xsl 125XSL_TEXT_STYLE = $(mylibdir)/vg-faq2txt.xsl 126XSL_WEBSITE_STYLE = $(mylibdir)/vg-html-website.xsl 127XSL_MAN_STYLES = \ 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 131 132all-docs: FAQ.txt man-pages html-docs print-docs 133 134valid: 135 $(XMLLINT) $(XMLLINT_FLAGS) $(myxmldir)/index.xml 136 137# The text version of the FAQ. 138FAQ.txt: 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 142 143# the valgrind manpages 144man-pages: 145 set -e; \ 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; \ 151 exit 0; \ 152 fi; \ 153 done; \ 154 echo ""; \ 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."; \ 158 exit 1; 159 160# chunked html, on a chapter-by-chapter basis 161html-docs: 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 171 172# pdf and postscript 173print-docs: 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) 187 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 190# the time. 191# 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 196# as we intend. 197install-data-hook: 198 set -e; \ 199 if test -r html ; then \ 200 mkdir -p $(DESTDIR)$(datadir)/doc/valgrind; \ 201 cp -r html $(DESTDIR)$(datadir)/doc/valgrind; \ 202 fi 203 for f in *.1 ; do \ 204 if test -r $$f ; then \ 205 mkdir -p $(DESTDIR)$(mandir)/man1; \ 206 cp $$f $(DESTDIR)$(mandir)/man1; \ 207 fi \ 208 done 209 ifeq ($(BUILD_ALL_DOCS),yes) 210 set -e; \ 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; \ 214 fi 215 set -e; \ 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; \ 219 fi 220 endif 221 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 224# tarball. 225 ifeq ($(BUILD_ALL_DOCS),yes) 226dist-hook: FAQ.txt html-docs man-pages print-docs 227 cp -r html $(distdir) 228 cp FAQ.txt $(distdir)/.. 229 cp *.1 $(distdir) 230 cp print/index.pdf $(distdir) 231 cp print/index.ps $(distdir) 232 else 233dist-hook: FAQ.txt html-docs man-pages 234 cp -r html $(distdir) 235 cp FAQ.txt $(distdir)/.. 236 cp *.1 $(distdir) 237 endif 238 239distclean-local: 240 rm -rf html print 241 rm -f FAQ.txt 242 rm -f $(top_builddir)/FAQ.txt $(top_builddir)/docs/*.1 243 244 245 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 249# artefacts. 250 251# chunked html with no html/body tags, css, or top nav, to fit into the website 252website-docs: 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 258 259# valkyrie carries around her own copy of the valgrind manual 260valkyrie-docs: 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 269 270# html.tar.bz2, .pdf, .ps.bz2 files for downloading from the website 271download-docs: 272 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) 273 /bin/rm -fr $(downloadsdir) 274 mkdir -p $(downloadsdir) 275 @echo "" 276 @echo "Generating valgrind_manual.html.tar.bz2 ..." 277 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) 278 /bin/rm -fr $(vgdir) 279 mkdir -p $(vgdir) 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/ 288 @echo "" 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 ) 297 @echo "" 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 304 /bin/rm -fr $(vgdir) 305