# $Id: Makefile 513 2008-09-29 13:41:00Z oneiros $
all: 2.pdf 3.pdf 4.pdf 4-1.pdf 5.pdf

2.pdf: 2.tex poles.pdf
	pdftex -interaction=batchmode 2.tex
	pdfinfo 2.pdf
	@echo "check the second number; it must be 2"
	@fgrep -a "/W [1" 2.pdf
	
3.pdf: 3.tex poles.pdf
	pdftex -interaction=batchmode 3.tex
	pdfinfo 3.pdf
	@echo "check the second number; it must be 3"
	@fgrep -a "/W [1" 3.pdf

4.pdf: 4.tex poles.pdf
	pdftex -interaction=batchmode 4.tex
	pdfinfo 4.pdf
	@echo "check the second number; it must be 4"
	@tail -1000 4.pdf|fgrep -a "/W [1" --

4-1.pdf: 4-1.tex poles.pdf
	pdftex -interaction=batchmode 4-1.tex
	pdfinfo 4-1.pdf
	@echo "check the second number; it must be 4"
	@tail -1000 4-1.pdf|fgrep -a "/W [1" --

5.pdf: 5.tex poles.pdf
	pdftex -interaction=batchmode 5.tex
	@echo "check the second number; it must be 5"
	@tail -2000 5.pdf|fgrep -a "/W [1" --

poles.png:
	ppmpat -poles 1250 1250 |pnmtopng > poles.png

poles.pdf: poles.png
	convert poles.png poles.pdf

.PHONY: clean clobber
clean:
	rm -f *.log

clobber: clean
	rm -f *.png *.pdf
