diff --git a/scst/include/scst.h b/scst/include/scst.h index 28e79fc02..0ab09b9eb 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -250,7 +250,7 @@ static inline bool list_entry_in_list(const struct list_head *entry) } #define SCST_INTERFACE_VERSION \ - SCST_VERSION_STRING "$Revision$" SCST_CONST_VERSION + SCST_VERSION_STRING SCST_INTF_VER SCST_CONST_VERSION #define SCST_LOCAL_NAME "scst_local" diff --git a/scst/include/scst_const.h b/scst/include/scst_const.h index 3b0e57201..ca17ec628 100644 --- a/scst/include/scst_const.h +++ b/scst/include/scst_const.h @@ -35,6 +35,8 @@ #include #endif +#include "scst_itf_ver.h" + /* * Version numbers, the same as for the kernel. * @@ -51,7 +53,7 @@ #define SCST_VERSION_NAME "3.1.0-pre1" #define SCST_VERSION_STRING SCST_VERSION_NAME SCST_VERSION_STRING_SUFFIX -#define SCST_CONST_VERSION "$Revision$" +#define SCST_CONST_VERSION SCST_CONST_INTF_VER /*** Shared constants between user and kernel spaces ***/ diff --git a/scst/include/scst_user.h b/scst/include/scst_user.h index 1cda6c214..55f1672d2 100644 --- a/scst/include/scst_user.h +++ b/scst/include/scst_user.h @@ -32,7 +32,7 @@ #define DEV_USER_PATH "/dev/" #define DEV_USER_VERSION_NAME SCST_VERSION_NAME #define DEV_USER_VERSION \ - DEV_USER_VERSION_NAME "$Revision$" SCST_CONST_VERSION + DEV_USER_VERSION_NAME DEV_USER_INTF_VER SCST_CONST_VERSION #define SCST_USER_PARSE_STANDARD 0 #define SCST_USER_PARSE_CALL 1 diff --git a/scst/src/Makefile b/scst/src/Makefile index 32575c7ef..1ec0a3b3f 100644 --- a/scst/src/Makefile +++ b/scst/src/Makefile @@ -73,7 +73,23 @@ ifeq ($(INSTALL_MOD_PATH),) export INSTALL_MOD_PATH := $(DESTDIR) endif -all: +ifeq ($(SCST_INC_DIR),) +SCST_INC_DIR := ../include +endif + +SCST_INTF_VER_FILE := $(SCST_INC_DIR)/scst_itf_ver.h + +$(SCST_INTF_VER_FILE): $(SCST_INC_DIR)/scst.h $(SCST_INC_DIR)/scst_const.h $(SCST_INC_DIR)/scst_user.h + echo "/* Autogenerated, don't edit */" >$(SCST_INTF_VER_FILE) + echo "" >>$(SCST_INTF_VER_FILE) + echo -n "#define SCST_INTF_VER " >>$(SCST_INTF_VER_FILE) + echo "\"`sha1sum $(SCST_INC_DIR)/scst.h|awk '{printf $$1}'`\"" >>$(SCST_INTF_VER_FILE) + echo -n "#define SCST_CONST_INTF_VER " >>$(SCST_INTF_VER_FILE) + echo "\"`sha1sum $(SCST_INC_DIR)/scst_const.h|awk '{printf $$1}'`\"" >>$(SCST_INTF_VER_FILE) + echo -n "#define DEV_USER_INTF_VER " >>$(SCST_INTF_VER_FILE) + echo "\"`sha1sum $(SCST_INC_DIR)/scst_user.h|awk '{printf $$1}'`\"" >>$(SCST_INTF_VER_FILE) + +all: $(SCST_INTF_VER_FILE) $(MAKE) -C $(KDIR) SUBDIRS=$(shell pwd) BUILD_DEV=m scst: @@ -171,6 +187,7 @@ clean: cd $(DEV_HANDLERS_DIR) && $(MAKE) $@ extraclean: clean + rm -f $(SCST_INTF_VER_FILE) cd $(DEV_HANDLERS_DIR) && $(MAKE) $@ rm -f *.orig *.rej