r8125: convert to xml format
[clsql.git] / doc / Makefile
1 ##############################################################################
2 # FILE IDENTIFICATION
3
4 #  Name:         Makefile
5 #  Purpose:      Makefile for the clsql documentation
6 #  Programer:    Kevin M. Rosenberg
7 #  Date Started: Mar 2002
8 #
9 #  CVS Id:   $Id$
10 #
11 # This file, part of CLSQL, is Copyright (c) 2002-2003 by Kevin M. Rosenberg
12 #
13 # CLSQL users are granted the rights to distribute and use this software
14 # as governed by the terms of the Lisp Lesser GNU Public License
15 # (http://opensource.franz.com/preamble.html), also known as the LLGPL.
16 ##############################################################################
17
18 OS:=debian
19 DOCFILE_BASE_DEFAULT:=clsql
20 DOCFILE_EXT_DEFAULT:=xml
21
22 # Standard docfile processing
23
24 ifndef DOCFILE_BASE
25 DOCFILE_BASE=${DOCFILE_BASE_DEFAULT}
26 endif
27
28 ifndef DOCFILE_EXT
29 DOCFILE_EXT=${DOCFILE_EXT_DEFAULT}
30 endif
31
32 DOCFILE:=${DOCFILE_BASE}.${DOCFILE_EXT}
33 FOFILE:=${DOCFILE_BASE}.fo
34 PDFFILE:=${DOCFILE_BASE}.pdf
35 PSFILE:=${DOCFILE_BASE}.ps
36 DVIFILE:=${DOCFILE_BASE}.dvi
37 TXTFILE:=${DOCFILE_BASE}.txt
38 TMPFILES:=${DOCFILE_BASE}.aux ${DOCFILE_BASE}.out ${DOCFILE_BASE}.log
39 DOCFILES:=$(shell echo *.xml *.xsl)
40
41 CATALOG:=`pwd`/catalog-${OS}.xml
42 CHECK:=XML_CATALOG_FILES="$(CATALOG)" xmllint --noout --xinclude --postvalid $(DOCFILE) || exit 1
43
44 .PHONY: all
45 all: html pdf 
46
47 .PHONY: dist
48 dist: html pdf
49
50 .PHONY: doc
51 doc: html pdf
52
53 .PHONY: check
54 check:
55         @$(CHECK)
56
57 .PHONY: html
58 html: html.tar.gz
59
60 html.tar.gz: $(DOCFILES) Makefile 
61         @rm -rf html
62         @mkdir html
63         @XML_CATALOG_FILES="$(CATALOG)" xsltproc --xinclude --output html/ html.xsl $(DOCFILE)
64         @GZIP='-9' tar czf html.tar.gz html 
65
66 .PHONY: fo
67 fo: ${FOFILE}
68
69 ${FOFILE}: $(DOCFILES) Makefile 
70         @XML_CATALOG_FILES="$(CATALOG)" xsltproc --xinclude --output $(FOFILE) fo.xsl $(DOCFILE)
71
72 .PHONY: pdf
73 pdf: ${PDFFILE}
74
75 ${PDFFILE}: ${FOFILE}
76         @fop $(FOFILE) -pdf $(PDFFILE) > /dev/null
77
78 .PHONY: dvi
79 dvi: ${DVIFILE}
80
81 .PHONY: ps
82 ps: ${PSFILE}
83
84 ${PSFILE}: ${FOFILE}
85         @fop $(FOFILE) -ps $(PSFILE) > /dev/null
86
87
88 .PHONY: txt
89 txt: ${TXTFILE}
90
91 ${TXTFILE}: ${FOFILE}
92         @fop $(FOFILE) -txt $(TXTFILE) > /dev/null
93
94 .PHONY: clean
95 clean: 
96         @rm -f *~ *.bak *.orig \#*\# .\#* texput.log
97         @rm -rf html ${PSFILE}
98         @rm -f ${TMPFILES} ${FOFILE}
99         @rm -f  ${DVIFILE} ${TXTFILE}
100
101 .PHONY: distclean
102 distclean: clean