chiark / gitweb /
more sophisticated makefile (make once etc.)
[topbloke-formulae.git] / Makefile
index 3c82b5b7afbb2f5d5bf21797e7c2f5eb73db4c80..8bd84b3ea7214db1a1719fad188214b3a10cbfd9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,19 @@
 
-article.pdf: article.tex
-               pdflatex -halt-on-error $< </dev/null
+SRCS := $(wildcard *.tex)
+
+default: final.pdf
+
+once:
+               pdflatex -halt-on-error article.tex </dev/null
+
+final.pdf: $(SRCS)
+               $(MAKE) once
+               $(MAKE) once
+               $(MAKE) once
+               cp article.pdf final.pdf
+
+%.ps: %.pdf
+               pdftops $*.pdf $*.ps
 
 clean:
        rm -f *.aux *.log *.dvi *.out *.pdf *~