blob: c15e45184efcb9716f4a08436cd57b255a2d8de1 [file] [log] [blame]
sewardjd6bfc842005-07-25 23:01:43 +00001
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.
10BUILD_ALL_DOCS=yes
11
12##-------------------------------------------------------------
13## END OF HACK
14##-------------------------------------------------------------
15
16
njnf7c00b12005-07-19 21:46:19 +000017SUBDIRS = xml lib images internals
sewardjde4a1d02002-03-22 01:27:54 +000018
njnf7c00b12005-07-19 21:46:19 +000019EXTRA_DIST = README
njn3e986b22004-11-30 10:43:45 +000020
njn4a830152005-07-02 23:13:59 +000021dist_man_MANS = valgrind.1
njnc88614a2005-03-12 21:06:06 +000022
sewardjd6bfc842005-07-25 23:01:43 +000023
njn3e986b22004-11-30 10:43:45 +000024##-------------------------------------------------------------------
25## Below here is more ordinary make stuff...
26##-------------------------------------------------------------------
27docdir = ./
28xmldir = $(docdir)xml
29imgdir = $(docdir)images
30libdir = $(docdir)lib
31htmldir = $(docdir)html
32printdir = $(docdir)print
33
34XML_CATALOG_FILES = /etc/xml/catalog
35
36# file to log print output to
37LOGFILE = print.log
38
39# validation stuff
40XMLLINT = xmllint
41LINT_FLAGS = --noout --xinclude --noblanks --postvalid
42VALID_FLAGS = --dtdvalid http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd
43XMLLINT_FLAGS = $(LINT_FLAGS) $(VALID_FLAGS)
44
45# stylesheet processor
46XSLTPROC = xsltproc
47XSLTPROC_FLAGS = --nonet --xinclude
48
49# stylesheets
50XSL_HTML_CHUNK_STYLE = $(libdir)/vg-html-chunk.xsl
51XSL_HTML_SINGLE_STYLE = $(libdir)/vg-html-single.xsl
52XSL_FO_STYLE = $(libdir)/vg-fo.xsl
53
54all-docs: html-docs print-docs
55
56valid:
57 $(XMLLINT) $(XMLLINT_FLAGS) $(xmldir)/index.xml
58
59# chunked html
60html-docs:
61 @echo "Generating html files..."
njnb0267202005-07-25 21:12:40 +000062 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 && \
njn3e986b22004-11-30 10:43:45 +000069 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(htmldir)/ $(XSL_HTML_CHUNK_STYLE) $(xmldir)/index.xml
70
71# pdf and postscript
72print-docs:
njnc11a29e2004-11-30 14:05:38 +000073 @echo "Generating PDF file: $(printdir)/index.pdf (please be patient)...";
njnb0267202005-07-25 21:12:40 +000074 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 && \
sewardj27eca032005-07-25 17:53:46 +000079 (cd $(printdir) && \
njnb0267202005-07-25 21:12:40 +000080 ( pdfxmltex index.fo && \
81 pdfxmltex index.fo && \
82 pdfxmltex index.fo ) &> $(LOGFILE) && \
sewardj27eca032005-07-25 17:53:46 +000083 echo "Generating PS file: $(printdir)/index.ps ..." && \
84 pdftops index.pdf && \
njnb0267202005-07-25 21:12:40 +000085 rm -f *.log *.aux *.fo *.out)
njn3e986b22004-11-30 10:43:45 +000086
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.
sewardjd6bfc842005-07-25 23:01:43 +000090#
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.
njn3e986b22004-11-30 10:43:45 +000096install-data-hook:
97 if test -r html ; then \
dirk30a15002005-07-18 23:56:46 +000098 mkdir -p $(DESTDIR)$(datadir)/doc/valgrind/; \
99 cp -r html $(DESTDIR)$(datadir)/doc/valgrind/; \
njn3e986b22004-11-30 10:43:45 +0000100 fi
sewardjd6bfc842005-07-25 23:01:43 +0000101 ifeq ($(BUILD_ALL_DOCS),yes)
102 if test -r index.pdf ; then \
103 mkdir -p $(DESTDIR)$(datadir)/doc/valgrind/; \
sewardj645580e2005-07-25 23:36:58 +0000104 cp index.pdf $(DESTDIR)$(datadir)/doc/valgrind/valgrind_manual.pdf; \
sewardjd6bfc842005-07-25 23:01:43 +0000105 fi
106 if test -r index.ps ; then \
107 mkdir -p $(DESTDIR)$(datadir)/doc/valgrind/; \
sewardj645580e2005-07-25 23:36:58 +0000108 cp index.ps $(DESTDIR)$(datadir)/doc/valgrind/valgrind_manual.ps; \
sewardjd6bfc842005-07-25 23:01:43 +0000109 fi
110 endif
njn3e986b22004-11-30 10:43:45 +0000111
sewardjd6bfc842005-07-25 23:01:43 +0000112
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)
116dist-hook: html-docs print-docs
117 cp -r html $(distdir)
118 cp print/index.pdf $(distdir)
119 cp print/index.ps $(distdir)
120 else
njn3e986b22004-11-30 10:43:45 +0000121dist-hook: html-docs
sewardjd6bfc842005-07-25 23:01:43 +0000122 cp -r html $(distdir)
123 endif
njn3e986b22004-11-30 10:43:45 +0000124
125distclean-local:
126 rm -rf html print