default: tds.info tds_toc.html tds.dvi

tds_toc.html: tds.texi /usr/local/bin/texi2html
	texi2html -split_node -menu $<

tds.info: tds.texi
	makeinfo --no-split $<

tds.texi.tmp: tds.tex tds2texi.el 
	emacs -batch -l tds2texi.el -f tds2texi-convert --eval '(write-file "$@")'

tds.texi: tds.texi.tmp tds.sed
	sed -f tds.sed $< >$@

tds.dvi: tds.tex tdsguide.cls
	latex '\nonstopmode \input tds'
	$(MAKE) -s check

check:
	dw <tds.tex
	chkdelim <tds.tex
	ispell -t -l <tds.tex | sort -u

dist: check tds.dvi
	-rcsdiff -c tds.tex >/tmp/diff
	rm -f tds.texi* *~
	tar chzvvf /tmp/tds.tar.gz C* M* tds* *.sty *.fd
	shar -z tds.dvi >/tmp/shar
	@echo "Now ci -l -m'$(log)' tds.tex and change the tdsVersion."
