PAPER=probability-monads all: program paper # Actually make sure the code in our paper compiles. program: $(PAPER) # Compile our code with GHC. $(PAPER): $(PAPER).lhs ghc --make -fglasgow-exts $(PAPER).lhs # Generate PDF of the paper, with literate source code. paper: $(PAPER).pdf # Run literate source code through lhs2TeX and generate a TeX file. $(PAPER).tex: $(PAPER).lhs lhs2TeX -o $(PAPER).tex $(PAPER).lhs # Build our figures. #figs.1: figs.mp # mpost figs.mp # Build our final PDF. In the worst-case scenario, this requires multiple # passes to support BibTeX and cross-referencing. $(PAPER).pdf: $(PAPER).tex bibliography.bib pdflatex $(PAPER) bibtex $(PAPER) pdflatex $(PAPER) pdflatex $(PAPER) # A quick and dirty regeneration of the paper, with no bibliography or # cross-reference updates. Useful when editing xypic diagrams. quick: $(PAPER).tex pdflatex $(PAPER) # Delete all the build byproducts. clean: rm -f $(PAPER).aux $(PAPER).bbl $(PAPER).blg $(PAPER).hi $(PAPER).log \ $(PAPER).o $(PAPER).out $(PAPER).pdf $(PAPER).ptb $(PAPER).tex \ Control/Monad/*.o Control/Monad/*.hi $(PAPER).tex $(PAPER) .PHONY: all program paper quick clean