+endif
+#
+# SCM detect
+#
+# BRANCH set to 'trunk' if checkout from trunk or 'brc' otherwise
+BRANCH:=$(shell [ "$(shell echo $(basename $(CURDIR)) | sed 's/.*runk.*/trunk/')" = "trunk" ] && echo svn || echo brc)
+#
+in_svn_repo:= $(wildcard .svn/)
+ifeq ($(strip $(in_svn_repo)),)
+in_bzr_repo:= $(wildcard .bzr/)
+ifeq ($(strip $(in_bzr_repo)),)
+in_git_repo:= $(wildcard .git/)
+ifeq ($(strip $(in_git_repo)),)
+ svnrev=unknown
+else
+ svnrev=git-$(shell git describe --always)
+ BRANCH:=$(shell git branch|cut -c3-)
+endif # git
+else
+ svnrev=bzr$(shell bzr revno)
+endif # bzr
+else
+ svnrev:=$(shell LANG=C svn info 2>&1 | grep Revision | cut -d: -f2| sed 's/ //g')
+endif # svn
+