Version 4.0.1
[clsql/s11.git] / doc / Makefile
bloba1033c6c32787120c372fa5341961aef134ff38e
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
9 # CVS Id: $Id$
11 # This file, part of CLSQL, is Copyright (c) 2002-2003 by Kevin M. Rosenberg
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 ##############################################################################
18 DOCFILE_BASE_DEFAULT:=clsql
19 DOCFILE_EXT_DEFAULT:=xml
22 # Standard docfile processing
24 DEBIAN=$(shell expr "`cat /etc/issue 2> /dev/null`" : '.*Debian.*')
25 SUSE=$(shell expr "`cat /etc/issue 2> /dev/null`" : '.*SuSE.*')
26 SUSE91=$(shell expr "`cat /etc/issue 2> /dev/null`" : '.*SuSE Linux 9.1.*')
27 REDHAT=$(shell expr "`cat /etc/issue 2> /dev/null`" : '.*Red Hat.*')
28 MANDRAKE=$(shell expr "`cat /etc/issue 2> /dev/null`" : '.*Mandrake.*')
29 DARWIN=$(shell expr "`uname -a`" : '.*Darwin.*')
32 ifneq (${DEBIAN},0)
33 OS:=debian
34 else
35 ifneq (${SUSE91},0)
36 OS=suse91
37 else
38 ifneq (${SUSE},0)
39 OS=suse
40 else
41 ifneq (${REDHAT},0)
42 OS=redhat
43 else
44 ifneq (${MANDRAKE},0)
45 OS=mandrake
46 else
47 ifneq (${DARWIN},0)
48 OS=darwin
49 endif
50 endif
51 endif
52 endif
53 endif
54 endif
56 ifndef DOCFILE_BASE
57 DOCFILE_BASE=${DOCFILE_BASE_DEFAULT}
58 endif
60 ifndef DOCFILE_EXT
61 DOCFILE_EXT=${DOCFILE_EXT_DEFAULT}
62 endif
64 DOCFILE:=${DOCFILE_BASE}.${DOCFILE_EXT}
65 FOFILE:=${DOCFILE_BASE}.fo
66 PDFFILE:=${DOCFILE_BASE}.pdf
67 PSFILE:=${DOCFILE_BASE}.ps
68 DVIFILE:=${DOCFILE_BASE}.dvi
69 TXTFILE:=${DOCFILE_BASE}.txt
70 HTMLFILE:=${DOCFILE_BASE}.html
71 TMPFILES:=${DOCFILE_BASE}.aux ${DOCFILE_BASE}.out ${DOCFILE_BASE}.log
72 DOCFILES:=$(shell echo *.xml *.xsl)
74 ifeq ($(XSLTPROC),)
75 XSLTPROC:=xsltproc
76 endif
78 CATALOG:=`pwd`/catalog-${OS}.xml
79 CHECK:=XML_CATALOG_FILES="$(CATALOG)" xmllint --noout --xinclude --postvalid $(DOCFILE) || exit 1
81 .PHONY: all
82 all: html pdf
84 .PHONY: dist
85 dist: html pdf
87 .PHONY: doc
88 doc: html pdf
90 .PHONY: check
91 check:
92 @echo "Operating system detected: ${OS}"
93 @$(CHECK)
95 .PHONY: html
96 html: html.tar.gz
98 html.tar.gz: $(DOCFILES) Makefile
99 @rm -rf html
100 @mkdir html
101 @XML_CATALOG_FILES="$(CATALOG)" $(XSLTPROC) --stringparam chunker.output.encoding UTF-8 \
102 --xinclude --output html/ html_chunk.xsl $(DOCFILE)
103 @GZIP='-9' tar czf html.tar.gz html
105 .PHONY: fo
106 fo: ${FOFILE}
108 ${FOFILE}: $(DOCFILES) Makefile
109 @XML_CATALOG_FILES="$(CATALOG)" xsltproc --xinclude --output $(FOFILE) fo.xsl $(DOCFILE)
111 .PHONY: pdf
112 pdf: ${PDFFILE}
114 ${PDFFILE}: ${DOCFILES} Makefile
115 @$(MAKE) fo
116 @fop $(FOFILE) -pdf $(PDFFILE) > /dev/null
118 .PHONY: dvi
119 dvi: ${DVIFILE}
121 .PHONY: ps
122 ps: ${PSFILE}
124 ${PSFILE}: ${DOCFILES} Makefile
125 @$(MAKE) fo
126 @fop $(FOFILE) -ps $(PSFILE) > /dev/null
129 .PHONY: txt
130 txt: ${TXTFILE}
132 ${TXTFILE}: ${FOFILE}
133 @XML_CATALOG_FILES="$(CATALOG)" xsltproc --xinclude --output ${HTMLFILE} html.xsl $(DOCFILE)
134 lynx -dump ${HTMLFILE} > ${TXTFILE}
136 .PHONY: clean
137 clean:
138 @rm -f *~ *.bak *.orig \#*\# .\#* texput.log
139 @rm -rf html ${PSFILE} ${HTMLFILE}
140 @rm -f ${TMPFILES} ${FOFILE}
141 @rm -f ${DVIFILE} ${TXTFILE}
143 .PHONY: distclean
144 distclean: clean