r8116: Automated commit for Debian build of uffi upstream-version-1.3.8
[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 *.xml)
40
41 CHECK:=xmllint --noout --catalogs --xinclude --postvalid $(DOCFILE) || exit 1
42
43 .PHONY: all
44 all: html pdf 
45
46 .PHONY: dist
47 dist: html pdf
48
49 .PHONY: doc
50 doc: html pdf
51
52 .PHONY: check
53 check:
54         @$(CHECK)
55
56 .PHONY: html
57 html: html.tar.gz
58
59 html.tar.gz: $(DOCFILES) Makefile check
60         @rm -rf html
61         @xmlto --skip-validation -o html xhtml $(DOCFILE)
62         @GZIP='-9' tar czf html.tar.gz html 
63
64 .PHONY: fo
65 fo: ${FOFILE}
66
67 ${FOFILE}: $(DOCFILES) Makefile check
68         @xmlto --skip-validation fo $(DOCFILE)
69
70 .PHONY: pdf
71 pdf: ${PDFFILE}
72
73 ${PDFFILE}: ${FOFILE}
74         @fop $(FOFILE) -pdf $(PDFFILE) > /dev/null
75
76 .PHONY: dvi
77 dvi: ${DVIFILE}
78
79 .PHONY: ps
80 ps: ${PSFILE}
81
82 ${PSFILE}: ${FOFILE}
83         @fop $(FOFILE) -ps $(PSFILE) > /dev/null
84
85
86 .PHONY: txt
87 txt: ${TXTFILE}
88
89 ${TXTFILE}: ${FOFILE}
90         @fop $(FOFILE) -txt $(TXTFILE) > /dev/null
91
92 .PHONY: clean
93 clean: 
94         @rm -f *~ *.bak *.orig \#*\# .\#* texput.log
95         @rm -rf html ${PSFILE}
96         @rm -f ${TMPFILES} ${FOFILE}
97         @rm -f  ${DVIFILE} ${TXTFILE}
98
99 .PHONY: distclean
100 distclean: clean