1 # Makefile for SBCL document generation
3 # This file is part of the SBCL system. It was copied from UFFI and
4 # placed into the public domain by the original author, Kevin
7 DOCFILE_BASE_DEFAULT:=user-manual
8 DOCFILE_EXT_DEFAULT:=xml
10 SYSTEM:=$(shell uname)
12 ifeq ($(SYSTEM),Linux)
13 ifneq ($(shell expr "`cat /etc/issue`" : '.*Debian.*'),0)
14 # Old Debian used /usr/share/sgml/docbook, new Debian uses
15 # /usr/share/xml/docbook.
16 ifneq ($(shell expr "`ls -d /usr/share/xml`" : '.*/usr/share/xml.*'),0)
19 # Evidently it's not a new-style Debian DocBook setup, ergo:
23 ifneq ($(shell expr "`cat /etc/issue`" : '.*SuSE.*'),0)
26 ifneq ($(shell expr "`cat /etc/issue`" : 'Red Hat Linux release 9'),0)
29 ifneq ($(shell expr "`cat /etc/issue`" : '.*Yarrow.*'),0)
37 ifeq ($(SYSTEM),Darwin)
42 DOCFILE_BASE=${DOCFILE_BASE_DEFAULT}
46 DOCFILE_EXT=${DOCFILE_EXT_DEFAULT}
49 DOCFILE:=${DOCFILE_BASE}.${DOCFILE_EXT}
50 FOFILE:=${DOCFILE_BASE}.fo
51 PDFFILE:=${DOCFILE_BASE}.pdf
52 PSFILE:=${DOCFILE_BASE}.ps
53 DVIFILE:=${DOCFILE_BASE}.dvi
54 TXTFILE:=${DOCFILE_BASE}.txt
55 HTMLFILE:=${DOCFILE_BASE}.html
56 TMPFILES:=${DOCFILE_BASE}.aux ${DOCFILE_BASE}.out ${DOCFILE_BASE}.log
57 DOCFILES:=$(shell echo *.xml *.xsl)
63 CATALOG:=`pwd`/catalogs/catalog-${OS}.xml
64 CHECK:=XML_CATALOG_FILES="$(CATALOG)" xmllint --noout --xinclude --postvalid $(DOCFILE) || exit 1
77 @echo "Operating system detected: ${OS}"
83 html-stamp: $(DOCFILES) Makefile
86 @XML_CATALOG_FILES="$(CATALOG)" $(XSLTPROC) --stringparam chunker.output.encoding ISO-8859-1 \
87 --xinclude --output html/ html_chunk.xsl $(DOCFILE)
93 ${FOFILE}: $(DOCFILES) Makefile
94 @XML_CATALOG_FILES="$(CATALOG)" $(XSLTPROC) --xinclude --output $(FOFILE) fo.xsl $(DOCFILE)
99 ${PDFFILE}: ${DOCFILES} Makefile
101 @fop $(FOFILE) -pdf $(PDFFILE) > /dev/null
109 ${PSFILE}: ${DOCFILES} Makefile
111 @fop $(FOFILE) -ps $(PSFILE) > /dev/null
117 ${TXTFILE}: ${FOFILE}
118 @XML_CATALOG_FILES="$(CATALOG)" $(XSLTPROC) --xinclude --output ${HTMLFILE} html.xsl $(DOCFILE)
119 lynx -dump ${HTMLFILE} > ${TXTFILE}
123 @rm -f *~ *.bak *.orig \#*\# .\#* texput.log
124 @rm -rf html $(PSFILE) $(HTMLFILE) $(PDFFILE) html-stamp
125 @rm -f $(TMPFILES) $(FOFILE)
126 @rm -f $(DVIFILE) $(TXTFILE)