Provide Genode version information in log

Fixes #551
This commit is contained in:
Christian Helmuth 2014-03-18 16:23:52 +01:00
parent 2f3b67c9e0
commit cd0d378142
11 changed files with 36 additions and 0 deletions

1
VERSION Normal file
View File

@ -0,0 +1 @@
14.02

View File

@ -36,6 +36,8 @@ INC_DIR += $(REP_DIR)/src/core/include \
$(REP_DIR)/include/codezero/dummies \
$(BASE_DIR)/src/base/thread
include $(GEN_CORE_DIR)/version.inc
vpath main.cc $(GEN_CORE_DIR)
vpath ram_session_component.cc $(GEN_CORE_DIR)
vpath rom_session_component.cc $(GEN_CORE_DIR)

View File

@ -36,6 +36,8 @@ INC_DIR += $(REP_DIR)/src/core/include \
LIBS += base-common
include $(GEN_CORE_DIR)/version.inc
vpath main.cc $(GEN_CORE_DIR)
vpath multiboot_info.cc $(GEN_CORE_DIR)
vpath ram_session_component.cc $(GEN_CORE_DIR)

View File

@ -42,6 +42,8 @@ INC_DIR += $(REP_DIR)/src/core/include \
$(BASE_DIR)/src/base/thread \
$(REP_DIR)/src/base/console
include $(GEN_CORE_DIR)/version.inc
vpath context_area.cc $(GEN_CORE_DIR)
vpath cpu_session_component.cc $(GEN_CORE_DIR)
vpath dataspace_component.cc $(GEN_CORE_DIR)

View File

@ -60,6 +60,9 @@ SRC_CC += console.cc \
pager.cc \
_main.cc
# provide Genode version information
include $(BASE_DIR)/src/core/version.inc
# declare file locations
vpath _main.cc $(BASE_DIR)/src/platform
vpath cpu_session_component.cc $(BASE_DIR)/src/core

View File

@ -45,6 +45,8 @@ LD_SCRIPT_STATIC = $(LD_SCRIPT_DEFAULT) \
$(call select_from_repositories,src/platform/context_area.stdlib.ld)
endif
include $(GEN_CORE_DIR)/version.inc
vpath main.cc $(GEN_CORE_DIR)
vpath ram_session_component.cc $(GEN_CORE_DIR)
vpath cpu_session_component.cc $(GEN_CORE_DIR)

View File

@ -40,6 +40,8 @@ INC_DIR = $(REP_DIR)/src/core/include \
$(BASE_DIR)/src/base/thread \
$(GEN_CORE_DIR)/include
include $(GEN_CORE_DIR)/version.inc
vpath main.cc $(GEN_CORE_DIR)
vpath ram_session_component.cc $(GEN_CORE_DIR)
vpath rom_session_component.cc $(GEN_CORE_DIR)

View File

@ -39,6 +39,8 @@ INC_DIR += $(REP_DIR)/src/core/include \
$(BASE_DIR)/src/platform \
$(REP_DIR)/src/platform
include $(GEN_CORE_DIR)/version.inc
vpath main.cc $(GEN_CORE_DIR)
vpath ram_session_component.cc $(GEN_CORE_DIR)
vpath rom_session_component.cc $(GEN_CORE_DIR)

View File

@ -36,6 +36,8 @@ INC_DIR += $(REP_DIR)/src/core/include \
$(BASE_DIR)/src/base/thread \
$(GEN_CORE_DIR)/include
include $(GEN_CORE_DIR)/version.inc
vpath main.cc $(GEN_CORE_DIR)
vpath ram_session_component.cc $(GEN_CORE_DIR)
vpath rom_session_component.cc $(GEN_CORE_DIR)

View File

@ -181,6 +181,8 @@ int main()
*/
inhibit_tracing = true;
PINF("Genode " GENODE_VERSION);
PDBG("--- create local services ---");
static Trace::Source_registry trace_sources;

16
base/src/core/version.inc Normal file
View File

@ -0,0 +1,16 @@
#
# 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_main += -DGENODE_VERSION="\"$(GENODE_VERSION)\""