add RC_VERSION for dm

Signed-off-by: Jason Chen CJ <jason.cj.chen@intel.com>
This commit is contained in:
Jason Chen CJ 2018-03-08 17:48:40 +08:00 committed by lijinxia
parent 2cb8ce50c1
commit e404760cd2
2 changed files with 10 additions and 3 deletions

View File

@ -3,6 +3,7 @@
#
MAJOR_VERSION=0
MINOR_VERSION=1
RC_VERSION=1
BASEDIR := $(shell pwd)
DM_OBJDIR ?= $(CURDIR)/build
@ -111,6 +112,7 @@ include/version.h:
cat license_header > include/version.h;\
echo "#define DM_MAJOR_VERSION $(MAJOR_VERSION)" >> include/version.h;\
echo "#define DM_MINOR_VERSION $(MINOR_VERSION)" >> include/version.h;\
echo "#define DM_RC_VERSION $(RC_VERSION)" >> include/version.h;\
echo "#define DM_BUILD_VERSION "\""$$PATCH"\""" >> include/version.h;\
echo "#define DM_BUILD_TIME "\""$$TIME"\""" >> include/version.h;\
echo "#define DM_BUILD_USER "\""$(USER)"\""" >> include/version.h

View File

@ -160,9 +160,14 @@ usage(int code)
static void
print_version(void)
{
fprintf(stderr, "DM version is: %d.%d-%s, build by %s@%s\n",
DM_MAJOR_VERSION, DM_MINOR_VERSION, DM_BUILD_VERSION,
DM_BUILD_USER, DM_BUILD_TIME);
if (DM_RC_VERSION)
fprintf(stderr, "DM version is: %d.%d-%d-%s, build by %s@%s\n",
DM_MAJOR_VERSION, DM_MINOR_VERSION, DM_RC_VERSION,
DM_BUILD_VERSION, DM_BUILD_USER, DM_BUILD_TIME);
else
fprintf(stderr, "DM version is: %d.%d-%s, build by %s@%s\n",
DM_MAJOR_VERSION, DM_MINOR_VERSION, DM_BUILD_VERSION,
DM_BUILD_USER, DM_BUILD_TIME);
exit(0);
}