-SVNRELEASE := $(shell svn info | grep "Revision: " | sed -e s'/^[^0-9]*\([0-9]*\).*$$/\1/')
-DEBRELEASE := 0rsm$(SVNRELEASE)
+
+REPORELEASE := $(shell svn info 2>/dev/null | grep "Revision: " | sed -e s'/^[^0-9]*\([0-9]*\).*$$/\1/')
+ifeq (,$(REPORELEASE))
+ REPORELEASE := $(shell git svn info 2>/dev/null | grep "Revision: " | sed -e s'/^[^0-9]*\([0-9]*\).*$$/\1/')
+endif
+ifeq (,$(REPORELEASE))
+ $(error You much check the code out from svn using svn or git)
+endif
+
+DEBRELEASE := 0tmi$(REPORELEASE)