SDP Logo
Attributes
Narrative
- - -
Quest
Motley

 

Copyright/Credits
SDP

Scott Dustin Penrose's Homepage

NARRATIVE

Consisting of or characterised by the telling of a story

-
-
# ==============================================================================
# DocBook Convert Makefile
# ==============================================================================
# by: Scott Penrose <scottp@myinternet.com.au>
#
# DEFINITIONS
#
#       * Keep your definitions, locations, executables etc all in one
#         place. This makes it far easier for future maintainers or
#         implementors to maintain this code.
#
# Required Tools
# ==============
# apt convert - Almost Plain Text - http://XXX 
APTCONVERT=aptconvert
# XSL - XSLT for convert from DcoBook to PS/HTML etc - http://docbook.sf.com/
XSLT_PATH=/usr/local/docbook-xsl-1.50.0
# FOP - Format Object P XXX - http://XXX 
FOP=/usr/local/fop-0.20.3/fop.sh
# HTML2DB - Convert HTML to DocBook - http://XXX 
HTML2DB=/home/scottp/src/docbook/DocParse/html2db

#
# SUFFIX
# 
#       * Each Suffix must be listed here for Makefile to even try and
#         understand it.
#
.SUFFIXES : .ps .pdf .xdbk .apt .html .lpr .xv .pod .pm .dbk .xpdf .fo .acroread .tex .doc .mozilla .svg .test .index .tar

# ==============================================================================
#
# APT -> xdbk (Almost Plain Text -> XML DocBook)
#
#       * Document everything - What is this seciton doing ?
#       * I am using extensions to indicate file types

.apt.xdbk:
	${APTCONVERT} -toc -enc ASCII $(basename $@).temp.xml $<
	mv $(basename $@).temp.xml $@

# ==============================================================================
#
# XDBK -> FO (XML DocBook -> Format Object)
# XDBK -> HTML (XML DocBook to Simple HTML)
#

.xdbk.html:
	-mkdir $(basename $@)
	xsltproc -o $(basename $@)/index.html ${XSLT_PATH}/mi/html.xsl $<

.xdbk.fo:
	xsltproc -o $@ ${XSLT_PATH}/mi/fo.xsl $<

# ==============================================================================
#
# Perl (pm, pod) -> xdbk
#
#	* Note - pod2docbook does not generate correct XML files
#	  but the SGML look fine, so convert to SGML and then to XML DocBook
#

.pm.dbk:
	pod2docbook --infile=$< --outfile=$@

.pod.dbk:
	pod2docbook --infile=$< --outfile=$@

# ==============================================================================
#
# tex -> html (LaTeX to HTML convert)
#
#	* Not yet written

.tex.html:
	/bin/false

# ==============================================================================
#
# MS Word (DOC) converter
#
#	* Using WordView to convert DOC to HTML
#	* Then turn HTML into SGML DocBook
#	* (note - two steps in one)
#	* XXX try doing one step here, then using HTML converter below

.doc.dbk:
	wvHtml --targetdir=/tmp $< tempfile.html
	${HTML2DB} /tmp/tempfile.html > $@

# ==============================================================================
#
# HTML -> DBK (HTML to SGML DocBook)

.html.dbk:
	${HTML2DB} $< > $@

# ==============================================================================
#
# Helpers
#
#	* SGML to XML DocBook convert - Simple but effective

.dbk.xdbk:
	-sgml2xml -xlower $< > $@

# ==============================================================================
#
# FO -> * (Format Object Converters)
#
#	* PS = PostScript for printing
#	* PDF = Portable Document Format for sending
#	* SVG = Experimental converter (mainly for fun)

.fo.ps:
	${FOP} -fo $< -ps $@ 

.fo.pdf:
	${FOP} -fo $< -pdf $@ 

.fo.svg:
	${FOP} -fo $< -svg $@ 

# ==============================================================================
#
# Viewers
#
#	* xpdf - Simple PDF Viewer
#	* acroread - Unix Acrobat reader
#	* mail - Send mail with a PDF
#	* gv - Ghost script view of a PostScript file
#	* lpr - Send file to printer via unix LPR
#	* cups - Send file to printer via cups
#	* mozilla - Open up mozilla with the HTML page

.pdf.xpdf:
	xpdf $<

.pdf.acroread:
	acroread $<

.pdf.mail:
       mail -s 

.ps.gv:
	gv $<

.ps.lpr:
	lpr $<

.ps.cups:
	qtcups $<

.html.mozilla:
	echo "file://`pwd`/$(dir $<)/index.html"
	/usr/local/bin/runmozillawindow file://`pwd`/$(basename $<)/index.html


# ==============================================================================
#
# Testing code
#

.xdbk.test:
	xmlwf $<


# ==============================================================================
# Book generation from an Index
#
# 	* TEMPORARY INDEX to HTML Generation
#	* Convert index and original docs into one DocBook file
#	* Convert that DocBook into HTML by calling make (incidently this makefile)
#	* Tar up the results

.index.tar:
	-mkdir tmp
	~/mcm/tools/build_from_index $< tmp/
	cd tmp; make $(basename $@).html
	cd tmp; tar cvf ../$(basename $@).tar $(basename $@)



syntax highlighted by Code2HTML, v. 0.9.1