chiark / gitweb /
fix leftover \land
[topbloke-formulae.git] / Makefile
index 0f2016e40426218384848c911c789702a98bf9d9..88cfc3b873c973fdd36bab1232b5e6de80edb954 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -6,11 +6,15 @@ default: final.pdf
 once:          revid.inc
                pdflatex -halt-on-error article.tex </dev/null
 
 once:          revid.inc
                pdflatex -halt-on-error article.tex </dev/null
 
-revid.inc:     .git-revid $(SRCS) Makefile
+GITDIR:=$(addsuffix /, $(shell git rev-parse --git-dir))
+HEADREF:=$(shell git symbolic-ref HEAD 2>/dev/null)
+HEADDEPS:=$(addprefix $(GITDIR), HEAD $(HEADREF))
+
+revid.inc:     .git-revid $(SRCS) Makefile $(HEADDEPS)
                ./$< >$@.new
                cmp $@.new $@ || mv -f $@.new $@
 
                ./$< >$@.new
                cmp $@.new $@ || mv -f $@.new $@
 
-final.pdf: $(SRCS)
+final.pdf: $(SRCS) revid.inc
                $(MAKE) once
                $(MAKE) once
                $(MAKE) once
                $(MAKE) once
                $(MAKE) once
                $(MAKE) once
@@ -20,4 +24,4 @@ final.pdf: $(SRCS)
                pdftops $*.pdf $*.ps
 
 clean:
                pdftops $*.pdf $*.ps
 
 clean:
-       rm -f *.aux *.log *.dvi *.out *.pdf *~
+       rm -f *.aux *.log *.dvi *.out *.pdf *.ps *~