DISTBASENAME = sather-tutorial-`date '+%y%m%d'`
DIRNAME = $(shell basename `pwd`)

# the following to avoid setting the keywords depending of the build-system:
unexport LANG
unexport LC_ALL
unexport LC_MESSAGES
unexport LC_CTYPE

html: tutorial.html

tutorial.html: tutorial.sgml
	debiandoc2html -k tutorial.sgml

ps: tutorial.dvips
	mv tutorial.dvips tutorial.ps

tutorial.dvips: tutorial.sgml
	debiandoc2dvips tutorial.sgml

dist: html ps
	tar cv tutorial.html | gzip -9 > ../$(DISTBASENAME).html.tar.gz
	cat tutorial.ps | gzip -9 > ../$(DISTBASENAME).ps.gz

srcdist:
	make clean
	cd .. ; tar cv -X $(DIRNAME)/nodistfiles $(DIRNAME) | gzip -9 > $(DISTBASENAME)-src.sgml.tar.gz

clean:
	rm -rf tutorial.html
	rm -f tutorial.ps
	rm -f tutorial.dvips
	rm -f tutorial.sasp*
