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 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/SPEC-notes.txt \ 32 internals/directory-structure.txt \ 33 internals/howto_BUILD_KDE42.txt \ 34 internals/howto_oprofile.txt \ 35 internals/m_replacemalloc.txt \ 36 internals/m_syswrap.txt \ 37 internals/module-structure.txt \ 38 internals/multiple-architectures.txt \ 39 internals/notes.txt \ 40 internals/performance.txt \ 41 internals/porting-HOWTO.txt \ 42 internals/mpi2entries.txt \ 43 internals/porting-to-ARM.txt \ 44 internals/register-uses.txt \ 45 internals/release-HOWTO.txt \ 46 internals/segments-seginfos.txt \ 47 internals/threads-syscalls-signals.txt \ 48 internals/tm-mutexstates.dot \ 49 internals/tm-threadstates.dot \ 50 internals/tracking-fn-entry-exit.txt \ 51 internals/why-no-libc.txt \ 52 internals/xml-output.txt \ 53 internals/xml-output-protocol4.txt \ 54 lib/line-wrap.xsl \ 55 lib/vg_basic.css \ 56 lib/vg-fo.xsl \ 57 lib/vg-faq2txt.xsl \ 58 lib/vg-html-chunk.xsl \ 59 lib/vg-html-website.xsl \ 60 lib/vg-html-common.xsl \ 61 xml/FAQ.xml \ 62 xml/dist-docs.xml \ 63 xml/index.xml \ 64 xml/licenses.xml \ 65 xml/manpages-index.xml \ 66 xml/manual.xml \ 67 xml/manual-intro.xml \ 68 xml/manual-core.xml \ 69 xml/manual-core-adv.xml \ 70 xml/manual-writing-tools.xml \ 71 xml/design-impl.xml \ 72 xml/quick-start-guide.xml \ 73 xml/tech-docs.xml \ 74 xml/valgrind-manpage.xml \ 75 xml/vg-entities.xml \ 76 xml/xml_help.txt 77 78 79##------------------------------------------------------------------- 80## Below here is more ordinary make stuff... 81##------------------------------------------------------------------- 82myxmldir = $(top_srcdir)/docs/xml 83myimgdir = $(top_srcdir)/docs/images 84mylibdir = $(top_srcdir)/docs/lib 85 86myhtmldir = $(top_builddir)/docs/html 87myprintdir = $(top_builddir)/docs/print 88 89websitedir = $(top_builddir)/docs/website 90valkyriedir = $(top_builddir)/docs/vg-html 91downloadsdir = $(top_builddir)/docs/downloads 92vgdir = $(top_builddir)/docs/valgrind 93 94XML_CATALOG_FILES = /etc/xml/catalog 95 96# file to log print output to 97LOGFILE = print.log 98 99# validation stuff 100XMLLINT = xmllint 101LINT_FLAGS = --noblanks --noout --xinclude --postvalid --noent 102# validate with docbook 4.3 'cos it supports xml:base natively 103VALID_FLAGS = --dtdvalid http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd 104XMLLINT_FLAGS = $(LINT_FLAGS) $(VALID_FLAGS) 105 106# stylesheet processor 107XSLTPROC = xsltproc 108XSLTPROC_FLAGS = --nonet --xinclude 109 110# stylesheets 111XSL_HTML_CHUNK_STYLE = $(mylibdir)/vg-html-chunk.xsl 112XSL_FO_STYLE = $(mylibdir)/vg-fo.xsl 113XSL_TEXT_STYLE = $(mylibdir)/vg-faq2txt.xsl 114XSL_WEBSITE_STYLE = $(mylibdir)/vg-html-website.xsl 115XSL_MAN_STYLES = \ 116 /usr/share/sgml/docbook/xsl-stylesheets/manpages/docbook.xsl \ 117 /usr/share/xml/docbook/stylesheet/nwalsh/current/manpages/docbook.xsl \ 118 /usr/share/xml/docbook/stylesheet/nwalsh/manpages/docbook.xsl 119 120all-docs: FAQ.txt man-pages html-docs print-docs 121 122valid: 123 $(XMLLINT) $(XMLLINT_FLAGS) $(myxmldir)/index.xml 124 125# The text version of the FAQ. 126FAQ.txt: 127 @echo "Generating the text version of the FAQ ..." 128 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) && \ 129 $(XSLTPROC) $(XSLTPROC_FLAGS) -o ./FAQ.txt $(XSL_TEXT_STYLE) $(myxmldir)/FAQ.xml 130 131# the valgrind manpages 132man-pages: 133 set -e; \ 134 for x in $(XSL_MAN_STYLES) ; do \ 135 if test -f $$x; then \ 136 echo "Using manpage stylesheet: $$x"; \ 137 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) && \ 138 $(XSLTPROC) $(XSLTPROC_FLAGS) -o ./ $$x $(myxmldir)/manpages-index.xml; \ 139 exit 0; \ 140 fi; \ 141 done; \ 142 echo ""; \ 143 echo "Error: I can't find the XSL_MAN_STYLE file"; \ 144 echo "Please check where it lives on your system, and" \ 145 "amend the line 'XSL_MAN_STYLES = ' in this Makefile."; \ 146 exit 1; 147 148# chunked html, on a chapter-by-chapter basis 149html-docs: 150 @echo "Generating html files..." 151 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) && \ 152 mkdir -p $(myhtmldir) && \ 153 /bin/rm -fr $(myhtmldir)/ && \ 154 mkdir -p $(myhtmldir)/ && \ 155 mkdir -p $(myhtmldir)/images && \ 156 cp $(mylibdir)/vg_basic.css $(myhtmldir)/ && \ 157 cp $(myimgdir)/*.png $(myhtmldir)/images && \ 158 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(myhtmldir)/ $(XSL_HTML_CHUNK_STYLE) $(myxmldir)/index.xml 159 160# pdf and postscript 161print-docs: 162 @echo "Generating PDF file: $(myprintdir)/index.pdf (please be patient)..."; 163 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) && \ 164 mkdir -p $(myprintdir) && \ 165 mkdir -p $(myprintdir)/images && \ 166 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(myprintdir)/index.fo $(XSL_FO_STYLE) $(myxmldir)/index.xml && \ 167 (cd $(myprintdir) && \ 168 ( pdfxmltex index.fo && \ 169 pdfxmltex index.fo && \ 170 pdfxmltex index.fo ) &> $(LOGFILE) < /dev/null && \ 171 echo "Generating PS file: $(myprintdir)/index.ps ..." && \ 172 pdftops index.pdf && \ 173 rm -f *.log *.aux *.fo *.out) 174 175# If the docs have been built, install them. But don't worry if they have 176# not -- developers do 'make install' not from a 'make dist'-ified distro all 177# the time. 178# 179# Note: this is done at 'make install' time. 180# Note 2: the ifeq/else/endif have to be indented one space 181# because otherwise it seems that automake thinks it should 182# be the one to handle the else/endif parts, not GNU make 183# as we intend. 184install-data-hook: 185 set -e; \ 186 if test -r html ; then \ 187 mkdir -p $(DESTDIR)$(datadir)/doc/valgrind; \ 188 cp -r html $(DESTDIR)$(datadir)/doc/valgrind; \ 189 fi 190 for f in *.1 ; do \ 191 if test -r $$f ; then \ 192 mkdir -p $(DESTDIR)$(mandir)/man1; \ 193 cp $$f $(DESTDIR)$(mandir)/man1; \ 194 fi \ 195 done 196 ifeq ($(BUILD_ALL_DOCS),yes) 197 set -e; \ 198 if test -r index.pdf ; then \ 199 mkdir -p $(DESTDIR)$(datadir)/doc/valgrind; \ 200 cp index.pdf $(DESTDIR)$(datadir)/doc/valgrind/valgrind_manual.pdf; \ 201 fi 202 set -e; \ 203 if test -r index.ps ; then \ 204 mkdir -p $(DESTDIR)$(datadir)/doc/valgrind; \ 205 cp index.ps $(DESTDIR)$(datadir)/doc/valgrind/valgrind_manual.ps; \ 206 fi 207 endif 208 209# This is done at 'make dist' time. It builds the html docs, print 210# docs and man pages and copies them into the docs/ directory in the 211# tarball. 212 ifeq ($(BUILD_ALL_DOCS),yes) 213dist-hook: FAQ.txt html-docs man-pages print-docs 214 cp -r html $(distdir) 215 cp FAQ.txt $(distdir)/.. 216 cp *.1 $(distdir) 217 cp print/index.pdf $(distdir) 218 cp print/index.ps $(distdir) 219 else 220dist-hook: FAQ.txt html-docs man-pages 221 cp -r html $(distdir) 222 cp FAQ.txt $(distdir)/.. 223 cp *.1 $(distdir) 224 endif 225 226distclean-local: 227 rm -rf html print 228 rm -f $(top_builddir)/FAQ.txt $(top_builddir)/docs/*.1 229 230 231 232# ----------------------------------------------------------------------- 233# Note: the rest of this file is nothing to do with the normal build 234# tree. The stuff below contains special targets for web-site 235# artefacts. 236 237# chunked html with no html/body tags, css, or top nav, to fit into the website 238website-docs: 239 @echo "Generating website html files ..." 240 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) 241 /bin/rm -fr $(websitedir) 242 mkdir -p $(websitedir) 243 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(websitedir)/ $(XSL_WEBSITE_STYLE) $(myxmldir)/index.xml 244 245# valkyrie carries around her own copy of the valgrind manual 246valkyrie-docs: 247 @echo "Generating a set of valgrind docs for valkyrie..." 248 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) 249 /bin/rm -fr $(valkyriedir) 250 mkdir -p $(valkyriedir) 251 mkdir -p $(valkyriedir)/images 252 cp $(mylibdir)/vg_basic.css $(valkyriedir)/ 253 cp $(myimgdir)/*.png $(valkyriedir)/images/ 254 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(valkyriedir)/ $(XSL_HTML_CHUNK_STYLE) $(myxmldir)/index.xml 255 256# html.tar.bz2, .pdf, .ps.bz2 files for downloading from the website 257download-docs: 258 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) 259 /bin/rm -fr $(downloadsdir) 260 mkdir -p $(downloadsdir) 261 @echo "" 262 @echo "Generating valgrind_manual.html.tar.bz2 ..." 263 export XML_CATALOG_FILES=$(XML_CATALOG_FILES) 264 /bin/rm -fr $(vgdir) 265 mkdir -p $(vgdir) 266 mkdir -p $(vgdir)/html 267 mkdir -p $(vgdir)/html/images 268 cp $(mylibdir)/vg_basic.css $(vgdir)/html/ 269 cp $(myimgdir)/*.png $(vgdir)/html/images/ 270 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(vgdir)/html/ $(XSL_HTML_CHUNK_STYLE) $(myxmldir)/index.xml 271 (cd $(top_builddir)/docs/ && \ 272 (tar cfj $(downloadsdir)/valgrind_manual.html.tar.bz2 ./valgrind/html/ ) ) 273 /bin/rm -fr $(vgdir)/html/ 274 @echo "" 275 @echo "Generating valgrind_manual.pdf ..." 276 mkdir -p $(vgdir)/print 277 mkdir -p $(vgdir)/print/images 278 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(vgdir)/print/manual.fo $(XSL_FO_STYLE) $(myxmldir)/index.xml 279 (cd $(vgdir)/print/ && \ 280 ( pdfxmltex manual.fo && \ 281 pdfxmltex manual.fo && \ 282 pdfxmltex manual.fo ) &> $(LOGFILE) < /dev/null ) 283 @echo "" 284 @echo "Generating valgrind_manual.ps.bz2 ..." 285 (cd $(vgdir)/print/ && \ 286 ( pdftops manual.pdf ) ) 287 mv $(vgdir)/print/manual.pdf $(downloadsdir)/valgrind_manual.pdf 288 mv $(vgdir)/print/manual.ps $(downloadsdir)/valgrind_manual.ps 289 bzip2 $(downloadsdir)/valgrind_manual.ps 290 /bin/rm -fr $(vgdir) 291