# Makefile for documents.
# This will have to be modified for your system to at least
# point to Java classes in the right place.  It uses the following
# tools:
#
#   Xalan/Xerces: XML handling classes from Apache.
#     Available at <http://xml.apache.org/dist/>.
#   Tidy: HTML tidying program by Dave Raggett of W3C.
#     Available at <http://www.w3.org/People/Raggett/tidy/>.
#
# I don't use inference rules here because it's likely that each
# target will be a little different and I want to make it easy
# to customize them.
#

BASECLASSES=/usr/local/jdk/lib/classes.zip
APACHECLASSES=$(HOME)/java
JAVA=java -classpath $(BASECLASSES):$(APACHECLASSES)/xalan.jar:$(APACHECLASSES)/xerces.jar

STYLEIMPORTS=inlines.xsl blocks.xsl lists.xsl

all: faq.inc protocol.inc

faq: faq.inc

installfaq: faq.inc
	scp faq.inc freenet.sourceforge.net:/home/groups/freenet/htdocs

protocol: protocol.inc

# Notice that clean leaves .html files.  You may want to change this.
#
clean:
	rm *.tidy *.inc

faq.inc: faq.html
	awk -f strip.awk <faq.html >faq.inc

faq.html: faq.tidy
	tidy <faq.tidy >faq.html

faq.tidy: faq.xml faq.xsl web.xsl $(STYLEIMPORTS)
	$(JAVA) org.apache.xalan.xslt.Process -IN faq.xml -XSL faq.xsl -OUT faq.tidy

protocol.inc: protocol.html
	awk -f strip.awk <faq.html >faq.inc

protocol.html: protocol.tidy
	tidy <protocol.tidy >protocol.html

protocol.tidy: protocol.xml web.xsl $(STYLEIMPORTS)
	$(JAVA) org.apache.xalan.xslt.Process -IN protocol.xml -XSL web.xsl -OUT protocol.tidy

