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

only add branch to version string if not in master

This commit is contained in:
Oleg Hahm 2013-11-27 17:21:55 +01:00
parent 529f3fb278
commit e9b04cc380

View File

@ -10,8 +10,12 @@ 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/ /-/')
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