Module: sip-router
Branch: master
Commit: 277225d51277d62063071e5b615dc83d8c409503
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=277225d…
Author: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Committer: Andrei Pelinescu-Onciul <andrei(a)iptel.org>
Date: Thu Jun 25 12:56:06 2009 +0200
makefile: better "dirty" local copy detection
Better detection for local changes, when re-generating autover.h.
---
Makefile | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/Makefile b/Makefile
index 307096b..b7ea63f 100644
--- a/Makefile
+++ b/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 " */" >>$@