all: pdf html

normal:
	-rm *.aux *.toc
	latex -translate-file=il2-pl '\def\Status{0}\input live'
	latex -translate-file=il2-pl '\def\Status{0}\input live'
	latex -translate-file=il2-pl '\def\Status{0}\input live'
	dvips live -o

pdf:
	-rm *.aux *.toc *.out
	pdflatex '\def\Status{1}\input live'
	pdflatex '\def\Status{1}\input live'
	pdflatex '\def\Status{1}\input live'

html:
	-rm *.aux *.toc
	latex -translate-file=il2-pl '\def\Status{2}\input live'
	latex -translate-file=il2-pl '\def\Status{2}\input live'
	latex -translate-file=il2-pl '\def\Status{2}\input live'
	latex -translate-file=il2-pl '\def\Status{2}\input live'
	tex4ht live
	t4ht live

clean:
	-rm *.aux *.log *.blg *.toc *.out *.lot tex4ht.ps
	-rm *.xref *.lg *.idv *.out *.otc *.tmp tmp.*

realclean: clean
	-rm live.dvi
	-rm live.pdf
	-rm live.bbl
	-rm *.html *.htm *.gif *.css

bib:
	-rm *.aux *.toc
	-hugelatex live
	-bibtex live

nocites:
	find /texlive/texmf/lists -type f | \
	sed 's/$$/ /' | \
	sed 's/.texlive.texmf.lists.*free.//' | \
	sed 's/\// /' | \
	awk '{print "\\nocite{"$$2"}"}' | \
	sort | uniq > nocites.tex 

texlive:
	find /texlive/texmf/lists -type f | \
	sed 's/.texlive.texmf.lists.*free.//' | \
	sed 's/\// /' | \
	awk '{print "$$texlive{\""$$2"\"}=\""$$1"\";"}' | \
	sort | uniq > texlive.pl

catalogue:
	cat entries/*.bib > catalogue.bib

install:
	N=`pwd | sed 's/.*\///'`; echo install in $$N; \
	for i in  live*html live.css *.gif live.pdf; do \
	p4 edit  /texlive/Master/tldoc/$$N/$$i; \
	cp $$i  /texlive/Master/tldoc/$$N; \
	p4 add  /texlive/Master/tldoc/$$N/$$i; \
	done

