r8169: renaming 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 OS:=debian
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 HTMLFILE:=${DOCFILE_BASE}.html
39 TMPFILES:=${DOCFILE_BASE}.aux ${DOCFILE_BASE}.out ${DOCFILE_BASE}.log
40 DOCFILES:=$(shell echo *.xml *.xsl)
41
42 CATALOG:=`pwd`/catalog-${OS}.xml
43 CHECK:=XML_CATALOG_FILES="$(CATALOG)" xmllint --noout --xinclude --postvalid $(DOCFILE) || exit 1
44
45 .PHONY: all
46 all: html pdf 
47
48 .PHONY: dist
49 dist: html pdf
50
51 .PHONY: doc
52 doc: html pdf
53
54 .PHONY: check
55 check:
56         @$(CHECK)
57
58 .PHONY: html
59 html: html.tar.gz
60
61 html.tar.gz: $(DOCFILES) Makefile 
62         @rm -rf html
63         @mkdir html
64         @XML_CATALOG_FILES="$(CATALOG)" xsltproc --xinclude --output html/ html_chunk.xsl $(DOCFILE)
65         @GZIP='-9' tar czf html.tar.gz html 
66
67 .PHONY: fo
68 fo: ${FOFILE}
69
70 ${FOFILE}: $(DOCFILES) Makefile 
71         @XML_CATALOG_FILES="$(CATALOG)" xsltproc --xinclude --output $(FOFILE) fo.xsl $(DOCFILE)
72
73 .PHONY: pdf
74 pdf: ${PDFFILE}
75
76 ${PDFFILE}: ${DOCFILES} Makefile
77         @$(MAKE) fo
78         @fop $(FOFILE) -pdf $(PDFFILE) > /dev/null
79
80 .PHONY: dvi
81 dvi: ${DVIFILE}
82
83 .PHONY: ps
84 ps: ${PSFILE}
85
86 ${PSFILE}: ${DOCFILES} Makefile
87         @$(MAKE) fo
88         @fop $(FOFILE) -ps $(PSFILE) > /dev/null
89
90
91 .PHONY: txt
92 txt: ${TXTFILE}
93
94 ${TXTFILE}: ${FOFILE}
95         @XML_CATALOG_FILES="$(CATALOG)" xsltproc --xinclude --output ${HTMLFILE} html.xsl $(DOCFILE)
96         lynx -dump ${HTMLFILE} > ${TXTFILE}
97
98 .PHONY: clean
99 clean: 
100         @rm -f *~ *.bak *.orig \#*\# .\#* texput.log
101         @rm -rf html ${PSFILE} ${HTMLFILE}
102         @rm -f ${TMPFILES} ${FOFILE}
103         @rm -f  ${DVIFILE} ${TXTFILE}
104
105 .PHONY: distclean
106 distclean: clean