L2H=/usr/local/latex2html/latex2html  
L2HOPT=-no_math -html_version 3.2,math 
LATEX=latex
DVIPS=dvips
DVIPSOPT=-tlandscape -ta4

%.dvi: %.tex
	$(LATEX) $< ; $(LATEX) $<

%.ps: %.dvi
	$(DVIPS) $(DVIPSOPT) -o $@ $<

%.html : %.dvi
	$(L2H) $(L2HOPT) $*
	touch $@


dvifiles= example1.dvi example2.dvi example3.dvi \
	example1_sol.dvi example2_sol.dvi example3_sol.dvi

psfiles= example1.ps example2.ps example3.ps \
	example1_sol.ps example2_sol.ps example3_sol.ps

htmlfiles= example1.html example2.html example3.html \
	example1_sol.html example2_sol.html example3_sol.html

htmldirs= example1 example2 example3 example1_sol example2_sol example3_sol 


dvi: $(dvifiles)

print: $(dvifiles)
	dvips $?
	touch print

ps: $(psfiles)

html: $(htmlfiles)

all: dvi ps html



tar:
	rm example*/*.pl example*/.*.db
	tar -cvzf examples.tar.gz *.ps $(htmldirs)

clean:	
	rm  -rf *~ *.log *.dvi $(htmldirs) *.ps *.aux *.html
