chiark / gitweb /
revid - better deps
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 18 Mar 2012 11:29:20 +0000 (11:29 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 18 Mar 2012 11:42:19 +0000 (11:42 +0000)
Makefile

index 2e4d97d..88cfc3b 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -6,11 +6,15 @@ default: final.pdf
 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 $@
 
-final.pdf: $(SRCS)
+final.pdf: $(SRCS) revid.inc
                $(MAKE) once
                $(MAKE) once
                $(MAKE) once