Make 'make distcheck' work
[metaproxy-moved-to-github.git] / doc / Makefile.am
1 ## $Id: Makefile.am,v 1.9 2006-04-22 13:29:37 adam Exp $
2 docdir=$(datadir)/doc/@PACKAGE@
3
4 SUBDIRS = common
5
6 SUFFIXES=.3mp .1
7
8 XMLFILES = main.xml.in book.xml manref.xml progref.xml copyright.xml \
9         metaproxy.xml
10
11 MAINXML = main.xml
12
13 XMLMAN   = auth_simple.xml backend_test.xml frontend_net.xml \
14         http_file.xml log.xml multi.xml query_rewrite.xml \
15         session_shared.xml template.xml virt_db.xml z3950_client.xml
16 MANFILES = auth_simple.3mp backend_test.3mp frontend_net.3mp \
17         http_file.3mp log.3mp multi.3mp query_rewrite.3mp \
18         session_shared.3mp template.3mp virt_db.3mp z3950_client.3mp \
19         metaproxy.1
20
21 HTMLFILES = architecture.html \
22         classes.html \
23         configuration.html \
24         example.configuration.html \
25         extensions.html \
26         filterref.html \
27         filters.html \
28         future.directions.html \
29         individual.classes.html \
30         introduction.html \
31         licence.html \
32         metaproxy.html \
33         multidb.html \
34         other.source.files.html \
35         overview.filter.types.html \
36         overview.xml.structure.html \
37         refguide.html
38
39 PNGFILES=
40 EPSFILES=
41
42 doc_DATA = $(HTMLFILES) metaproxy.pdf $(PNGFILES)
43 man_MANS = $(MANFILES)
44
45 EXTRA_DIST = $(XMLFILES) $(XMLMAN) $(doc_DATA) $(EPSFILES) $(man_MANS)
46
47 $(HTMLFILES): $(XMLFILES)
48         jade -E14 -D $(srcdir) -d common/html.dsl -t sgml $(srcdir)/common/xml.dcl $(MAINXML)
49
50 .xml.3mp:
51         docbook2man $<
52
53 .xml.1:
54         docbook2man $<
55
56 metaproxy.pdf: $(XMLFILES)
57         for i in $(PNGFILES) $(EPSFILES); do \
58                 if test ! -f $$i; then ln -s $(srcdir)/$$i .; fi; \
59         done
60         jade -E14 -D $(srcdir) -d common/print.dsl -t tex $(srcdir)/common/xml.dcl $(MAINXML)
61         rm -f metaproxy.tex
62         mv main.tex metaproxy.tex
63         pdfjadetex metaproxy.tex >/dev/null
64         pdfjadetex metaproxy.tex >/dev/null
65         pdfjadetex metaproxy.tex >/dev/null
66
67 index.tkl: $(XMLFILES) common/tkl.xsl
68         xsltproc common/tkl.xsl $(MAINXML)
69
70 manref.xml: $(XMLMAN) $(srcdir)/common/ref2dbinc.xsl
71         rm -f manref.xml
72         for i in $(XMLMAN); do \
73                 xsltproc $(srcdir)/common/ref2dbinc.xsl $$i | sed 1d >> manref.xml; \
74         done
75
76 progref.xml: metaproxy.xml
77         rm -f $@
78         xsltproc $(srcdir)/common/ref2dbinc.xsl $? | sed 1d >> $@
79
80 clean-data-hook:
81         rm -f [0-9]* *.bak
82
83 dist-hook:
84         for f in $(srcdir)/*.html; do \
85                 found=0; \
86                 b=`basename $$f`; \
87                 for h in $(HTMLFILES); do \
88                         if test "$$h" = "$$b"; then \
89                                 found=1; \
90                         fi \
91                 done; \
92                 if test "$$found" = "0"; then \
93                         echo "$$f not found in HTMLFILES"; \
94                         exit 1; \
95                 fi \
96         done