Browse Source

makefile: better "dirty" local copy detection

Better detection for local changes, when re-generating autover.h.
Andrei Pelinescu-Onciul 16 years ago
parent
commit
277225d512
1 changed files with 5 additions and 3 deletions
  1. 5 3
      Makefile

+ 5 - 3
Makefile

@@ -458,9 +458,11 @@ ifneq ($(wildcard .git),)
 # if .git/ exists
 repo_ver=$(shell  RV=`git rev-parse --verify --short=6 HEAD 2>/dev/null`;\
 					[ -n "$$RV" ] && \
-					test -n "`git diff-index --name-only HEAD >/dev/null`" && \
+					test -n "`git update-index --refresh --unmerged >/dev/null\
+							; git diff-index --name-only HEAD 2>/dev/null | \
+								grep -v Makefile`" &&\
 						RV="$$RV"-dirty; echo "$$RV")
-autover_h_dep=.git
+autover_h_dep=.git $(filter-out $(auto_gen), $(sources)) cfg.y cfg.lex
 else
 # else if .git/ does not exist
 repo_ver=
@@ -469,7 +471,7 @@ endif
 
 
 autover.h: $(autover_h_dep)
-	@echo  "generating autover.h ($(autover_h_dep)) ..."
+	@echo  "generating autover.h ..."
 	@echo "/* this file is autogenerated by make autover.h" >$@
 	@echo " * DO NOT EDIT IT" >>$@
 	@echo " */" >>$@