1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #378 from OlegHahm/version_string

include version string
This commit is contained in:
Christian Mehlis 2013-12-03 02:54:02 -08:00
commit 863c0a7e14
2 changed files with 13 additions and 1 deletions

View File

@ -9,6 +9,18 @@ endif
OBJ = $(SRC:%.c=$(BINDIR)%.o)
DEP = $(SRC:%.c=$(BINDIR)%.d)
GIT_STRING := $(shell git describe --abbrev=4 --dirty=-`hostname`)
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
ifeq ($(strip $(GIT_BRANCH)),master)
GIT_VERSION = $(GIT_STRING)
else
GIT_VERSION = $(shell echo $(GIT_STRING) $(GIT_BRANCH) | sed 's/ /-/')
endif
ifeq ($(strip $(GIT_VERSION)),)
GIT_VERSION := "UNKNOWN"
endif
export CFLAGS += -DVERSION=\"$(GIT_VERSION)\"
.PHONY: clean
include $(RIOTCPU)/Makefile.base

View File

@ -64,7 +64,7 @@ static char idle_stack[KERNEL_CONF_STACKSIZE_IDLE];
void kernel_init(void)
{
dINT();
printf("kernel_init(): This is RIOT!\n");
printf("kernel_init(): This is RIOT! (Version: %s)\n", VERSION);
sched_init();