chiark / gitweb /
make clean - remove *.ps
[topbloke-formulae.git] / Makefile
index 06554a21e071aaf9471db79fd1450227f023056c..2e4d97defcf6bab0e0ec6f1ec454d22107ae211e 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,23 @@
 
-default: article.pdf
+SRCS := $(wildcard *.tex)
 
-article.pdf: article.tex
-               pdflatex -halt-on-error $< </dev/null
+default: final.pdf
 
-article.ps: article.pdf
-               pdftops article.pdf article.ps
+once:          revid.inc
+               pdflatex -halt-on-error article.tex </dev/null
+
+revid.inc:     .git-revid $(SRCS) Makefile
+               ./$< >$@.new
+               cmp $@.new $@ || mv -f $@.new $@
+
+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 *~
+       rm -f *.aux *.log *.dvi *.out *.pdf *.ps *~