1.在二进制文件中增加版本信息

This commit is contained in:
fengweihao
2018-11-30 21:17:04 +08:00
parent d7e32cc350
commit db29918b0e
2 changed files with 11 additions and 2 deletions

View File

@@ -8,6 +8,7 @@ BUILD=$(shell git log | grep -cE 'Author:.*<.*@.*>')
BUILDSHA=$(shell git rev-parse --short HEAD) BUILDSHA=$(shell git rev-parse --short HEAD)
BUILD_FINGERPRINT=$(MAJOR).$(BUILD).$(BUILDSHA) BUILD_FINGERPRINT=$(MAJOR).$(BUILD).$(BUILDSHA)
VERSION_TARGET:=$(BUILDSHA)
# Default simulation parameters # Default simulation parameters
NUM_PROCESSORS=1 NUM_PROCESSORS=1
@@ -64,6 +65,8 @@ CFLAGS_LOCAL = -std=gnu99 -g -O3 -W -Wall \
-I./inc \ -I./inc \
DEPS := $(objs:.o=.d) DEPS := $(objs:.o=.d)
CFLAGS_GLOBAL += -DVERSION_TARGET=\"$(VERSION_TARGET)\"
CLEAN_LIST := $(CLEAN_LIST) $(OBJS) $(DEPS) $(TARGET_LIB) $(OBJ_DIR) CLEAN_LIST := $(CLEAN_LIST) $(OBJS) $(DEPS) $(TARGET_LIB) $(OBJ_DIR)

View File

@@ -19,7 +19,7 @@
#include "MESA_prof_load.h" #include "MESA_prof_load.h"
/* GIT Release */ /* GIT Release */
#define CERT_GIT_RELEASE "1.1.0" #define CERT_GIT_RELEASE "1.1"
#define MODE_TYPE(x) run_mode & x #define MODE_TYPE(x) run_mode & x
@@ -30,6 +30,12 @@
#define CERT_BASIC_CFG "./conf/cert_store.ini" #define CERT_BASIC_CFG "./conf/cert_store.ini"
#endif #endif
#ifdef VERSION_TARGET
char *git_ver = VERSION_TARGET;
#else
char *git_ver = "0"
#endif
static char* cert_revision() { return (CERT_GIT_RELEASE); } static char* cert_revision() { return (CERT_GIT_RELEASE); }
enum syslog_display_format{ enum syslog_display_format{
@@ -42,7 +48,7 @@ static int run_mode;
static void help() static void help()
{ {
printf("Welcome to CertStore %s\n", cert_revision()); printf("Welcome to certstore %s.%s\n", cert_revision(), VERSION_TARGET);
printf("cert_store <--normal|--daemon>\n" printf("cert_store <--normal|--daemon>\n"
"Usage:\n" "Usage:\n"
" --normal | Run the program in normal mode\n" " --normal | Run the program in normal mode\n"