From 3e4e64bfb3e4de616380b98cbba0777573f2fd6f Mon Sep 17 00:00:00 2001 From: Jason Chen CJ Date: Thu, 8 Mar 2018 17:48:40 +0800 Subject: [PATCH] add RC_VERSION for dm Signed-off-by: Jason Chen CJ --- Makefile | 2 ++ core/main.c | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 0cbfee007..f017649f9 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/core/main.c b/core/main.c index f05ac2b04..44e8b58f3 100644 --- a/core/main.c +++ b/core/main.c @@ -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); }