blob: ec95c7723d4dd58438965cc7e099ce2a007d3a01 [file] [log] [blame]
njn3e986b22004-11-30 10:43:45 +00001SUBDIRS = xml lib images
sewardjde4a1d02002-03-22 01:27:54 +00002
njn4452e602004-11-30 19:27:02 +00003EXTRA_DIST = README porting-HOWTO
njn3e986b22004-11-30 10:43:45 +00004
njnc88614a2005-03-12 21:06:06 +00005dist_man_MANS = valgrind.1 # Unsure about this --njn
6
njn3e986b22004-11-30 10:43:45 +00007##-------------------------------------------------------------------
8## Below here is more ordinary make stuff...
9##-------------------------------------------------------------------
10docdir = ./
11xmldir = $(docdir)xml
12imgdir = $(docdir)images
13libdir = $(docdir)lib
14htmldir = $(docdir)html
15printdir = $(docdir)print
16
17XML_CATALOG_FILES = /etc/xml/catalog
18
19# file to log print output to
20LOGFILE = print.log
21
22# validation stuff
23XMLLINT = xmllint
24LINT_FLAGS = --noout --xinclude --noblanks --postvalid
25VALID_FLAGS = --dtdvalid http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd
26XMLLINT_FLAGS = $(LINT_FLAGS) $(VALID_FLAGS)
27
28# stylesheet processor
29XSLTPROC = xsltproc
30XSLTPROC_FLAGS = --nonet --xinclude
31
32# stylesheets
33XSL_HTML_CHUNK_STYLE = $(libdir)/vg-html-chunk.xsl
34XSL_HTML_SINGLE_STYLE = $(libdir)/vg-html-single.xsl
35XSL_FO_STYLE = $(libdir)/vg-fo.xsl
36
37all-docs: html-docs print-docs
38
39valid:
40 $(XMLLINT) $(XMLLINT_FLAGS) $(xmldir)/index.xml
41
42# chunked html
43html-docs:
44 @echo "Generating html files..."
45 export XML_CATALOG_FILES=$(XML_CATALOG_FILES)
46 mkdir -p $(htmldir)
47 /bin/rm -fr $(htmldir)/
48 mkdir -p $(htmldir)/
49 mkdir -p $(htmldir)/images
50 cp $(libdir)/vg_basic.css $(htmldir)/
51 cp $(imgdir)/*.png $(htmldir)/images
52 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(htmldir)/ $(XSL_HTML_CHUNK_STYLE) $(xmldir)/index.xml
53
54# pdf and postscript
55print-docs:
njnc11a29e2004-11-30 14:05:38 +000056 @echo "Generating PDF file: $(printdir)/index.pdf (please be patient)...";
njn3e986b22004-11-30 10:43:45 +000057 export XML_CATALOG_FILES=$(XML_CATALOG_FILES);
58 mkdir -p $(printdir);
59 mkdir -p $(printdir)/images;
60 cp $(imgdir)/massif-graph-sm.png $(printdir)/images;
61 $(XSLTPROC) $(XSLTPROC_FLAGS) -o $(printdir)/index.fo $(XSL_FO_STYLE) $(xmldir)/index.xml;
njnc11a29e2004-11-30 14:05:38 +000062 (cd $(printdir); \
63 pdfxmltex index.fo &> $(LOGFILE); \
64 pdfxmltex index.fo &> $(LOGFILE); \
65 pdfxmltex index.fo &> $(LOGFILE); \
66 echo "Generating PS file: $(printdir)/index.ps ..."; \
67 pdftops index.pdf; \
njn3e986b22004-11-30 10:43:45 +000068 rm *.log *.aux *.fo *.out)
69
70# If the docs have been built, install them. But don't worry if they have
71# not -- developers do 'make install' not from a 'make dist'-ified distro all
72# the time.
73install-data-hook:
74 if test -r html ; then \
njn671319b2004-11-30 11:10:01 +000075 mkdir -p $(datadir)/doc/valgrind/; \
76 cp -r html $(datadir)/doc/valgrind/; \
njn3e986b22004-11-30 10:43:45 +000077 fi
78
79dist-hook: html-docs
80 cp -r html $(distdir)
81
82distclean-local:
83 rm -rf html print