sewardj | d6bfc84 | 2005-07-25 23:01:43 +0000 | [diff] [blame] | 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 of course need to re-run configure to make it take effect. |
| 10 | BUILD_ALL_DOCS=yes |
| 11 | |
| 12 | ##------------------------------------------------------------- |
| 13 | ## END OF HACK |
| 14 | ##------------------------------------------------------------- |
| 15 | |
| 16 | |
njn | f7c00b1 | 2005-07-19 21:46:19 +0000 | [diff] [blame] | 17 | SUBDIRS = xml lib images internals |
sewardj | de4a1d0 | 2002-03-22 01:27:54 +0000 | [diff] [blame] | 18 | |
njn | f7c00b1 | 2005-07-19 21:46:19 +0000 | [diff] [blame] | 19 | EXTRA_DIST = README |
njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 20 | |
njn | 4a83015 | 2005-07-02 23:13:59 +0000 | [diff] [blame] | 21 | dist_man_MANS = valgrind.1 |
njn | c88614a | 2005-03-12 21:06:06 +0000 | [diff] [blame] | 22 | |
sewardj | d6bfc84 | 2005-07-25 23:01:43 +0000 | [diff] [blame] | 23 | |
njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 24 | ##------------------------------------------------------------------- |
| 25 | ## Below here is more ordinary make stuff... |
| 26 | ##------------------------------------------------------------------- |
| 27 | docdir = ./ |
| 28 | xmldir = $(docdir)xml |
| 29 | imgdir = $(docdir)images |
| 30 | libdir = $(docdir)lib |
| 31 | htmldir = $(docdir)html |
| 32 | printdir = $(docdir)print |
| 33 | |
| 34 | XML_CATALOG_FILES = /etc/xml/catalog |
| 35 | |
| 36 | # file to log print output to |
| 37 | LOGFILE = print.log |
| 38 | |
| 39 | # validation stuff |
| 40 | XMLLINT = xmllint |
| 41 | LINT_FLAGS = --noout --xinclude --noblanks --postvalid |
| 42 | VALID_FLAGS = --dtdvalid http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd |
| 43 | XMLLINT_FLAGS = $(LINT_FLAGS) $(VALID_FLAGS) |
| 44 | |
| 45 | # stylesheet processor |
| 46 | XSLTPROC = xsltproc |
| 47 | XSLTPROC_FLAGS = --nonet --xinclude |
| 48 | |
| 49 | # stylesheets |
| 50 | XSL_HTML_CHUNK_STYLE = $(libdir)/vg-html-chunk.xsl |
| 51 | XSL_HTML_SINGLE_STYLE = $(libdir)/vg-html-single.xsl |
| 52 | XSL_FO_STYLE = $(libdir)/vg-fo.xsl |
| 53 | |
| 54 | all-docs: html-docs print-docs |
| 55 | |
| 56 | valid: |
| 57 | $(XMLLINT) $(XMLLINT_FLAGS) $(xmldir)/index.xml |
| 58 | |
| 59 | # chunked html |
| 60 | html-docs: |
| 61 | @echo "Generating html files..." |
njn | b026720 | 2005-07-25 21:12:40 +0000 | [diff] [blame] | 62 | export XML_CATALOG_FILES=$(XML_CATALOG_FILES) && \ |
| 63 | mkdir -p $(htmldir) && \ |
| 64 | /bin/rm -fr $(htmldir)/ && \ |
| 65 | mkdir -p $(htmldir)/ && \ |
| 66 | mkdir -p $(htmldir)/images && \ |
| 67 | cp $(libdir)/vg_basic.css $(htmldir)/ && \ |
| 68 | cp $(imgdir)/*.png $(htmldir)/images && \ |
njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 69 | $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(htmldir)/ $(XSL_HTML_CHUNK_STYLE) $(xmldir)/index.xml |
| 70 | |
| 71 | # pdf and postscript |
| 72 | print-docs: |
njn | c11a29e | 2004-11-30 14:05:38 +0000 | [diff] [blame] | 73 | @echo "Generating PDF file: $(printdir)/index.pdf (please be patient)..."; |
njn | b026720 | 2005-07-25 21:12:40 +0000 | [diff] [blame] | 74 | export XML_CATALOG_FILES=$(XML_CATALOG_FILES) && \ |
| 75 | mkdir -p $(printdir) && \ |
| 76 | mkdir -p $(printdir)/images && \ |
| 77 | cp $(imgdir)/massif-graph-sm.png $(printdir)/images && \ |
| 78 | $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(printdir)/index.fo $(XSL_FO_STYLE) $(xmldir)/index.xml && \ |
sewardj | 27eca03 | 2005-07-25 17:53:46 +0000 | [diff] [blame] | 79 | (cd $(printdir) && \ |
njn | b026720 | 2005-07-25 21:12:40 +0000 | [diff] [blame] | 80 | ( pdfxmltex index.fo && \ |
| 81 | pdfxmltex index.fo && \ |
| 82 | pdfxmltex index.fo ) &> $(LOGFILE) && \ |
sewardj | 27eca03 | 2005-07-25 17:53:46 +0000 | [diff] [blame] | 83 | echo "Generating PS file: $(printdir)/index.ps ..." && \ |
| 84 | pdftops index.pdf && \ |
njn | b026720 | 2005-07-25 21:12:40 +0000 | [diff] [blame] | 85 | rm -f *.log *.aux *.fo *.out) |
njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 86 | |
| 87 | # If the docs have been built, install them. But don't worry if they have |
| 88 | # not -- developers do 'make install' not from a 'make dist'-ified distro all |
| 89 | # the time. |
sewardj | d6bfc84 | 2005-07-25 23:01:43 +0000 | [diff] [blame] | 90 | # |
| 91 | # Note: this is done at 'make install' time. |
| 92 | # Note 2: the ifeq/else/endif have to be indented one space |
| 93 | # because otherwise it seems that automake thinks it should |
| 94 | # be the one to handle the else/endif parts, not GNU make |
| 95 | # as we intend. |
njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 96 | install-data-hook: |
| 97 | if test -r html ; then \ |
dirk | 30a1500 | 2005-07-18 23:56:46 +0000 | [diff] [blame] | 98 | mkdir -p $(DESTDIR)$(datadir)/doc/valgrind/; \ |
| 99 | cp -r html $(DESTDIR)$(datadir)/doc/valgrind/; \ |
njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 100 | fi |
sewardj | d6bfc84 | 2005-07-25 23:01:43 +0000 | [diff] [blame] | 101 | ifeq ($(BUILD_ALL_DOCS),yes) |
| 102 | if test -r index.pdf ; then \ |
| 103 | mkdir -p $(DESTDIR)$(datadir)/doc/valgrind/; \ |
sewardj | 645580e | 2005-07-25 23:36:58 +0000 | [diff] [blame] | 104 | cp index.pdf $(DESTDIR)$(datadir)/doc/valgrind/valgrind_manual.pdf; \ |
sewardj | d6bfc84 | 2005-07-25 23:01:43 +0000 | [diff] [blame] | 105 | fi |
| 106 | if test -r index.ps ; then \ |
| 107 | mkdir -p $(DESTDIR)$(datadir)/doc/valgrind/; \ |
sewardj | 645580e | 2005-07-25 23:36:58 +0000 | [diff] [blame] | 108 | cp index.ps $(DESTDIR)$(datadir)/doc/valgrind/valgrind_manual.ps; \ |
sewardj | d6bfc84 | 2005-07-25 23:01:43 +0000 | [diff] [blame] | 109 | fi |
| 110 | endif |
njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 111 | |
sewardj | d6bfc84 | 2005-07-25 23:01:43 +0000 | [diff] [blame] | 112 | |
| 113 | # This is done at 'make dist' time. It builds the html and print docs |
| 114 | # and copies them into the docs/ directory in the tarball. |
| 115 | ifeq ($(BUILD_ALL_DOCS),yes) |
| 116 | dist-hook: html-docs print-docs |
| 117 | cp -r html $(distdir) |
| 118 | cp print/index.pdf $(distdir) |
| 119 | cp print/index.ps $(distdir) |
| 120 | else |
njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 121 | dist-hook: html-docs |
sewardj | d6bfc84 | 2005-07-25 23:01:43 +0000 | [diff] [blame] | 122 | cp -r html $(distdir) |
| 123 | endif |
njn | 3e986b2 | 2004-11-30 10:43:45 +0000 | [diff] [blame] | 124 | |
| 125 | distclean-local: |
| 126 | rm -rf html print |