#	General makefile for Latex stuff

.SUFFIXES: .tib .verb .tex .fig .dvi .ps


MAIN = dependent-kinds

# Styles are in papers/styles
TEXINPUTS := .:../styles//:$(TEXINPUTS)

# Bibliographies are in papers/bibs
BIBINPUTS := .:../bibs//:$(BIBINPUTS)

default: $(MAIN).pdf
# basic-algo-and-proofs.ps chr-based-approach.ps

$(MAIN).pdf : always

# Depending on 'always' ensures that the work is redone
.PHONY : always
always:  

######## General rules

.verb.tex:
	expand $*.verb | verbatim > $*.tex

%.pdf : %.tex
	pdflatex $*.tex
	-bibtex $*
#	AcroRd32 $*.pdf
	touch always

# Cancel this
%.dvi : %.tex

%.ps : %.pdf
	pdf2ps $*.pdf $*.ps

%.ps : %.dvi
	dvips -f -t a4 < $*.dvi > $*.ps
	ps2pdf $*.ps

