.SUFFIXES: .hs .hi .o .tex .dvi .ps .pdf SOURCES := $(shell perl -ne 'print $$1,"\n" if /\\VerbatimInput[^{}]*{([^{}]+)}/' *.tex|sort -u) OBJECTS := $(SOURCES:.hs=.o) MAIN=typefun default: pdf all: typefun.pdf $(OBJECTS) typefun.dvi: typefun.bib $(SOURCES) Memo.o Map.o: Tree.o .tex.dvi: texi2dvi --batch $< && ( killall -USR1 xdvi.bin || true ) pdf: pdflatex $(MAIN).tex bibtex $(MAIN) pdflatex $(MAIN).tex .hs.o: ghc -W -fforce-recomp -c $<