genode/base/src/core/version.inc
Christian Helmuth 2c7c814e19 Generate Genode version string on each build
The version string was generated when core/main.cc was rebuilt, which
happens on changes in the file itself or in a header file it includes.
But, the version should reflect if the Genode repository was changed at
any place. Therefore, I moved the version string to its own version.cc
which is forcedly rebuilt any time core is examined by the build system.

@nfeske what do you think about it? Core is now relinked on any build.

Fixes #551.
2014-04-16 17:30:31 +02:00

27 lines
567 B
Makefile

#
# Provide version information to main.cc
#
GENODE_ROOT_DIR = $(BASE_DIR)/..
GENODE_VERSION := $(shell \
which git > /dev/null \
&& git -C $(GENODE_ROOT_DIR) describe --dirty=" <local changes>" 2> /dev/null \
&& exit 0 \
|| \
test -r $(GENODE_ROOT_DIR)/VERSION \
&& cat $(GENODE_ROOT_DIR)/VERSION \
&& exit 0 \
|| \
echo "<unknown version>")
CC_OPT_version += -DGENODE_VERSION="\"$(GENODE_VERSION)\""
SRC_CC += version.cc
vpath version.cc $(BASE_DIR)/src/core
version.o: force_version_compilation
force_version_compilation:
# vi: set ft=make :