r8104: convert to use of XML Docbook files
[uffi.git] / doc / Makefile
1 ##############################################################################
2 # FILE IDENTIFICATION
3
4 #  Name:         Makefile
5 #  Purpose:      Makefile for the uffi documentation
6 #  Programer:    Kevin M. Rosenberg
7 #  Date Started: Mar 2002
8 #
9 #  CVS Id:   $Id$
10 #
11 # This file, part of UFFI, is Copyright (c) 2002-2003 by Kevin M. Rosenberg
12 #
13 # UFFI 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
19 DOCFILE_BASE_DEFAULT=uffi
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 *.sgml)
40
41 .PHONY: all
42 all: html pdf 
43
44 .PHONY: dist
45 dist: html pdf
46
47 .PHONY: doc
48 doc: html pdf
49
50 .PHONY: check
51 check:
52         @$(CHECK)
53
54 .PHONY: html
55 html: html.tar.gz
56
57 html.tar.gz: $(DOCFILES) Makefile
58         @rm -rf html
59         @xmlto -o html xhtml $(DOCFILE)
60         @GZIP='-9' tar czf html.tar.gz html 
61
62 .PHONY: fo
63 fo: ${FOFILE}
64
65 ${FOFILE}: $(DOCFILES) Makefile
66         @xmlto fo $(DOCFILE)
67
68 .PHONY: pdf
69 pdf: ${PDFFILE}
70
71 ${PDFFILE}: ${FOFILE}
72         @fop $(FOFILE) -pdf $(PDFFILE) > /dev/null
73
74 .PHONY: dvi
75 dvi: ${DVIFILE}
76
77 .PHONY: ps
78 ps: ${PSFILE}
79
80 ${PSFILE}: ${FOFILE}
81         @fop $(FOFILE) -ps $(PSFILE) > /dev/null
82
83
84 .PHONY: txt
85 txt: ${TXTFILE}
86
87 ${TXTFILE}: ${FOFILE}
88         @fop $(FOFILE) -txt $(TXTFILE) > /dev/null
89
90 .PHONY: clean
91 clean: 
92         @rm -f *~ *.bak *.orig \#*\# .\#* texput.log
93         @rm -rf html ${PSFILE}
94         @rm -f ${TMPFILES} ${FOFILE}
95         @rm -f  ${DVIFILE} ${TXTFILE}
96
97 .PHONY: distclean
98 distclean: clean