chiark / gitweb /
more sophisticated makefile (make once etc.)
[topbloke-formulae.git] / Makefile
index 0391a54176f7d05f5e14506c1673f71e8dd2d8c7..8bd84b3ea7214db1a1719fad188214b3a10cbfd9 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,9 +1,19 @@
 
-article.ps: article.pdf
-               pdftops article.pdf article.ps
+SRCS := $(wildcard *.tex)
 
-article.pdf: article.tex
-               pdflatex -halt-on-error $< </dev/null
+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 *~