Browse Source

include version string

dev/timer
Oleg Hahm 9 years ago
parent
commit
529f3fb278
  1. 8
      Makefile.base
  2. 2
      core/kernel_init.c

8
Makefile.base

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

2
core/kernel_init.c

@ -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();

Loading…
Cancel
Save