clean removes local.ent
[mp-xquery-moved-to-github.git] / doc / Makefile
1
2 .PHONY: check all
3 .SUFFIXES: .3mp .xml .1
4
5 prefix = /usr
6
7 VERSION=$(shell . ../IDMETA; echo $$VERSION)
8
9 XSLTPROC_COMPILE = xsltproc --xinclude -path "."
10 PDF_COMPILE = dblatex -P latex.class.options=a4paper,12pt,twoside,openright
11 HTML_COMPILE = $(XSLTPROC_COMPILE) common/id.htmlhelp.xsl
12 MAN_COMPILE = $(XSLTPROC_COMPILE) common/id.man.xsl
13 REFFILES = xquery.xml
14 MANFILES=xquery.3mp
15
16 XMLFILES=book.xml manref.xml
17
18 all: index.html $(MANFILES)
19
20 index.html: $(XMLFILES) local.ent
21         $(HTML_COMPILE) book.xml
22
23 manref.xml: $(REFFILES) local.ent
24         rm -f manref.xml
25         for i in $(REFFILES); do \
26                 xsltproc stripref.xsl $$i | sed 1d >>manref.xml; \
27         done
28
29 mp-xquery.pdf: $(XMLFILES) local.ent
30         rm -f mp-xquery.pdf
31         $(PDF_COMPILE) book.xml
32         mv book.pdf mp-xquery.pdf
33
34 .xml.3mp:
35         $(MAN_COMPILE) $<
36
37 clean:
38         rm -f local.ent *.html *.pdf manref.xml *.hhp *.hhc $(MANFILES)
39
40 distclean: clean
41
42 local.ent: local.ent.in 
43         sed "s/@VERSION@/$(VERSION)/" <local.ent.in >local.ent
44
45 check: all
46
47 install:
48         mkdir -p $(DESTDIR)$(prefix)/share/man/man3
49         cp *.3mp $(DESTDIR)$(prefix)/share/man/man3/
50