# -*- makefile -*-

XSLTPROC=xsltproc
TIDY=tidy

all:	assertions.html message-exchanges.html scenarios.html

scenarios.html: scenarios.xml scenarios.xsl
	@echo "Generating $@";\
	$(XSLTPROC) --stringparam file scenarios.xml scenarios.xsl scenarios.xml > $@
	@echo "Running tidy on $@";\
	mv $@  $@.old; \
	$(TIDY) $@.old > $@ 2>./tidy-output.txt;\
	rm $@.old

assertions.html: assertions.xml assertions.xsl
	@echo "Generating $@";\
	$(XSLTPROC) --stringparam file assertions.xml assertions.xsl assertions.xml > $@
	@echo "Running tidy on $@";\
	mv $@  $@.old; \
	$(TIDY) $@.old > $@ 2>./tidy-output.txt;\
	rm $@.old

message-exchanges.html: message-exchanges.xml message-exchanges.xsl
	@echo "Generating $@";\
	$(XSLTPROC) --stringparam file message-exchanges.xml message-exchanges.xsl message-exchanges.xml > $@
	@echo "Running tidy on $@";\
	mv $@  $@.old; \
	$(TIDY) $@.old > $@ 2>./tidy-output.txt;\
	rm $@.old

clean:
	rm -f *~* html2ps.dbg ./valid-html.txt ./valid-xml.txt ./checkspell.txt ./valid-links.txt ./valid-pubrules.html ./valid-ns.html ./tidy-output.txt 

.PHONY: clean all
