diff --git a/Makefile b/Makefile index b7f8fe971..93d8c76d1 100644 --- a/Makefile +++ b/Makefile @@ -54,11 +54,11 @@ EMULEX_DIR=emulex ISCSI_DIR=iscsi-scst -VERSION = $(shell echo -n "$$(sed -n 's/^\#define[[:blank:]]SCST_VERSION_NAME[[:blank:]]*\"\([^-]*\).*\"/\1/p' scst/include/scst_const.h)."; \ - if svn info >/dev/null 2>&1; \ +REVISION ?= $(shell if svn info >/dev/null 2>&1; \ then svn info | sed -n 's/^Revision:[[:blank:]]*/r/p';\ - else git show | sed -n 's/^commit[[:blank:]]*\(.......\).*/\1/p'; \ + else echo -n r; git log | grep -c ^commit; \ fi) +VERSION = $(shell echo -n "$$(sed -n 's/^\#define[[:blank:]]SCST_VERSION_NAME[[:blank:]]*\"\([^-]*\).*\"/\1/p' scst/include/scst_const.h).$(REVISION)") help: @echo " all : make all" diff --git a/scstadmin/Makefile b/scstadmin/Makefile index 72bb5b831..0cb1cf85c 100644 --- a/scstadmin/Makefile +++ b/scstadmin/Makefile @@ -2,11 +2,11 @@ ifndef PREFIX PREFIX=/usr/local endif -VERSION = $(shell echo -n "$$(sed -n 's/^[[:blank:]]*\$$VERSION[[:blank:]]*=[[:blank:]]*[\"'"'"']\([0-9.]*\)[\"'"'"'];$$/\1/p' scstadmin/scst-*/lib/SCST/SCST.pm)."; \ - if svn info >/dev/null 2>&1; \ +REVISION ?= $(shell if svn info >/dev/null 2>&1; \ then svn info | sed -n 's/^Revision:[[:blank:]]*/r/p';\ - else git show | sed -n 's/^commit[[:blank:]]*\(.......\).*/\1/p'; \ + else echo -n r; git log | grep -c ^commit; \ fi) +VERSION = $(shell echo -n "$$(sed -n 's/^[[:blank:]]*\$$VERSION[[:blank:]]*=[[:blank:]]*[\"'"'"']\([0-9.]*\)[\"'"'"'];$$/\1/p' scstadmin/scst-*/lib/SCST/SCST.pm).$(REVISION)") SCSTADMIN_DIR = $(shell if [ ! -h scstadmin ]; then \ rm -f scstadmin; \