Skip to content

Commit

Permalink
Merge pull request #1400 from Kijewski/riot-version
Browse files Browse the repository at this point in the history
make: rename VERSION into RIOT_VERSION
  • Loading branch information
Christian Mehlis committed Jul 10, 2014
2 parents a6e97a4 + 919cdde commit 205fe6b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
17 changes: 9 additions & 8 deletions Makefile.include
Expand Up @@ -65,16 +65,17 @@ include $(RIOTBASE)/Makefile.cflags

# make the RIOT version available to the program
GIT_STRING := $(shell git describe --always --abbrev=4 --dirty=-`hostname`)
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
ifeq ($(strip $(GIT_BRANCH)),master)
GIT_VERSION = $(GIT_STRING)
ifneq (,$(GIT_STRING))
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
ifeq ($(strip $(GIT_BRANCH)),master)
RIOT_VERSION := $(GIT_STRING)
else
RIOT_VERSION := $(GIT_STRING)-$(GIT_BRANCH)
endif
else
GIT_VERSION = $(shell echo $(GIT_STRING) $(GIT_BRANCH) | sed 's/ /-/')
RIOT_VERSION := UNKNOWN
endif
ifeq ($(strip $(GIT_VERSION)),)
GIT_VERSION := "UNKNOWN"
endif
export CFLAGS += -DVERSION=\"$(GIT_VERSION)\"
export CFLAGS += -DRIOT_VERSION='"$(RIOT_VERSION)"'

# the binaries to link
BASELIBS += $(BINDIR)$(BOARD)_base.a
Expand Down
2 changes: 1 addition & 1 deletion core/kernel_init.c
Expand Up @@ -85,7 +85,7 @@ static char idle_stack[KERNEL_CONF_STACKSIZE_IDLE];
void kernel_init(void)
{
dINT();
printf("kernel_init(): This is RIOT! (Version: %s)\n", VERSION);
printf("kernel_init(): This is RIOT! (Version: %s)\n", RIOT_VERSION);

hwtimer_init();

Expand Down

0 comments on commit 205fe6b

Please sign in to comment.