Commit 36a32aaa authored by Adam Wujek's avatar Adam Wujek 💬

kernel: add versions of used submodules to the kernel module

Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent eeb0a7e4
......@@ -22,12 +22,19 @@ ccflags-$(CONFIG_FMC_TDC_VERBOSE_DEBUG) += -DVERBOSE_DEBUG
ccflags-y += -D__ZIO_MIN_MAJOR_VERSION=$(shell echo $(ZIO_VERSION) | cut -d '-' -f 2 | cut -d '.' -f 1; )
ccflags-y += -D__ZIO_MIN_MINOR_VERSION=$(shell echo $(ZIO_VERSION) | cut -d '-' -f 2 | cut -d '.' -f 2; )
# For this CSM_VERSION, please see ohwr.org/csm documentation
ifdef CONFIG_CSM_VERSION
ccflags-y += -D"CERN_SUPER_MODULE=MODULE_VERSION(\"$(CONFIG_CSM_VERSION)\")"
else
ccflags-y += -DCERN_SUPER_MODULE=""
# add versions of supermodule. It is useful when fine-delay-sw is included as sub-module
# of a bigger project that we want to track
ifdef CONFIG_SUPER_REPO
ifdef CONFIG_SUPER_REPO_VERSION
SUBMODULE_VERSIONS += MODULE_INFO(version_$(CONFIG_SUPER_REPO),\"$(CONFIG_SUPER_REPO_VERSION)\");
endif
endif
# add versions of used submodules
SUBMODULE_VERSIONS += MODULE_INFO(version_fmc_bus,\"$(FMC_BUS_VERSION)\");
SUBMODULE_VERSIONS += MODULE_INFO(version_zio,\"$(ZIO_VERSION)\");
SUBMODULE_VERSIONS += MODULE_INFO(version_spec_sw,\"$(SPEC_SW_VERSION)\");
ccflags-y += -DADDITIONAL_VERSIONS="$(SUBMODULE_VERSIONS)"
subdirs-ccflags-y = $(ccflags-y)
......
......@@ -18,8 +18,13 @@ SPEC_SW_ABS ?= $(abspath $(SPEC_SW) )
GIT_VERSION = $(shell git describe --always --dirty --long --tags)
export GIT_VERSION
ZIO_VERSION = $(shell cd $(ZIO_ABS); git describe --always --dirty --long --tags)
FMC_BUS_VERSION ?= $(shell cd $(FMC_BUS_ABS); git describe --always --dirty --long --tags)
ZIO_VERSION ?= $(shell cd $(ZIO_ABS); git describe --always --dirty --long --tags)
SPEC_SW_VERSION ?= $(shell cd $(SPEC_SW_ABS); git describe --always --dirty --long --tags)
export FMC_BUS_VERSION
export ZIO_VERSION
export SPEC_SW_VERSION
all: modules
......
......@@ -365,4 +365,4 @@ module_exit(ft_exit);
MODULE_VERSION(GIT_VERSION);
MODULE_LICENSE("GPL and additional rights"); /* LGPL */
CERN_SUPER_MODULE;
ADDITIONAL_VERSIONS;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment