mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-20 20:21:30 +00:00
Makefile, scst: Add revision to SCST version macro
Add SCST revision to SCST_VERSION_STRING macro. This might be useful for issues reporting/investigation.
This commit is contained in:
12
Makefile
12
Makefile
@@ -70,9 +70,17 @@ EMULEX_DIR=emulex
|
|||||||
|
|
||||||
ISCSI_DIR=iscsi-scst
|
ISCSI_DIR=iscsi-scst
|
||||||
|
|
||||||
REVISION ?= $(shell if [ -e .git ]; then echo -n .; git rev-parse --short HEAD 2>/dev/null; fi)
|
SCST_GIT_COMMIT := $(shell git rev-parse --short HEAD 2>/dev/null)
|
||||||
|
|
||||||
|
REVISION ?= $(SCST_GIT_COMMIT)
|
||||||
|
export REVISION
|
||||||
|
|
||||||
VERSION_WITHOUT_REVISION := $(shell echo -n "$$(sed -n 's/^\#define[[:blank:]]SCST_VERSION_NAME[[:blank:]]*\"\([^-]*\).*\"/\1/p' scst/include/scst_const.h)")
|
VERSION_WITHOUT_REVISION := $(shell echo -n "$$(sed -n 's/^\#define[[:blank:]]SCST_VERSION_NAME[[:blank:]]*\"\([^-]*\).*\"/\1/p' scst/include/scst_const.h)")
|
||||||
VERSION := $(VERSION_WITHOUT_REVISION)$(REVISION)
|
ifneq (, $(REVISION))
|
||||||
|
VERSION := $(VERSION_WITHOUT_REVISION).$(REVISION)
|
||||||
|
else
|
||||||
|
VERSION := $(VERSION_WITHOUT_REVISION)
|
||||||
|
endif
|
||||||
DEBIAN_REVISION=1.1
|
DEBIAN_REVISION=1.1
|
||||||
RPMTOPDIR ?= $(shell if [ $$(id -u) = 0 ]; then echo /usr/src/packages;\
|
RPMTOPDIR ?= $(shell if [ $$(id -u) = 0 ]; then echo /usr/src/packages;\
|
||||||
else echo $$PWD/rpmbuilddir; fi)
|
else echo $$PWD/rpmbuilddir; fi)
|
||||||
|
|||||||
@@ -37,6 +37,9 @@
|
|||||||
|
|
||||||
#include "scst_itf_ver.h"
|
#include "scst_itf_ver.h"
|
||||||
|
|
||||||
|
#define SCST_STRINGIFY_x(x...) #x
|
||||||
|
#define SCST_STRINGIFY(x...) SCST_STRINGIFY_x(x)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Version numbers, the same as for the kernel.
|
* Version numbers, the same as for the kernel.
|
||||||
*
|
*
|
||||||
@@ -45,9 +48,16 @@
|
|||||||
*/
|
*/
|
||||||
#define SCST_VERSION(a, b, c, d) (((a) << 24) + ((b) << 16) + ((c) << 8) + d)
|
#define SCST_VERSION(a, b, c, d) (((a) << 24) + ((b) << 16) + ((c) << 8) + d)
|
||||||
#define SCST_VERSION_CODE SCST_VERSION(3, 8, 0, 0)
|
#define SCST_VERSION_CODE SCST_VERSION(3, 8, 0, 0)
|
||||||
|
|
||||||
|
#ifdef SCST_VERSION_REVISION
|
||||||
|
#define SCST_VERSION_REVISION_SUFFIX "." SCST_STRINGIFY(SCST_VERSION_REVISION)
|
||||||
|
#else
|
||||||
|
#define SCST_VERSION_REVISION_SUFFIX ""
|
||||||
|
#endif
|
||||||
|
|
||||||
#define SCST_VERSION_STRING_SUFFIX
|
#define SCST_VERSION_STRING_SUFFIX
|
||||||
#define SCST_VERSION_NAME "3.8.0-pre"
|
#define SCST_VERSION_NAME "3.8.0-pre"
|
||||||
#define SCST_VERSION_STRING SCST_VERSION_NAME SCST_VERSION_STRING_SUFFIX
|
#define SCST_VERSION_STRING SCST_VERSION_NAME SCST_VERSION_STRING_SUFFIX SCST_VERSION_REVISION_SUFFIX
|
||||||
|
|
||||||
#define SCST_CONST_VERSION SCST_CONST_INTF_VER
|
#define SCST_CONST_VERSION SCST_CONST_INTF_VER
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
# See also Documentation/core-api/symbol-namespaces.rst for more information
|
# See also Documentation/core-api/symbol-namespaces.rst for more information
|
||||||
# about DEFAULT_SYMBOL_NAMESPACE.
|
# about DEFAULT_SYMBOL_NAMESPACE.
|
||||||
ccflags-y += -I$(src)/../include\
|
ccflags-y += -I$(src)/../include \
|
||||||
-DDEFAULT_SYMBOL_NAMESPACE=SCST\
|
-DDEFAULT_SYMBOL_NAMESPACE=SCST \
|
||||||
$(shell [ -n "${CONFIG_SCST_NO_DLM}" ] && echo -DCONFIG_SCST_NO_DLM)
|
$(shell [ -n "${CONFIG_SCST_NO_DLM}" ] && echo -DCONFIG_SCST_NO_DLM) \
|
||||||
|
$(shell [ -n "${REVISION}" ] && echo -DSCST_VERSION_REVISION=${REVISION})
|
||||||
|
|
||||||
#ccflags-y += -DCONFIG_SCST_STRICT_SERIALIZING
|
#ccflags-y += -DCONFIG_SCST_STRICT_SERIALIZING
|
||||||
#ccflags-y += -DCONFIG_SCST_USE_EXPECTED_VALUES
|
#ccflags-y += -DCONFIG_SCST_USE_EXPECTED_VALUES
|
||||||
|
|||||||
Reference in New Issue
Block a user