1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2026-01-01 01:41:18 +01:00

Merge pull request #1499 from LudwigOrtmann/riot-version-fail

make: improve failing RIOT_VERSION
This commit is contained in:
René Kijewski 2014-07-30 19:33:24 +02:00
commit 23e125463d

View File

@ -65,7 +65,7 @@ include $(RIOTBASE)/Makefile.cflags
# make the RIOT version available to the program
ifeq ($(origin RIOT_VERSION), undefined)
GIT_STRING := $(shell git describe --always --abbrev=4 --dirty=-`hostname`)
GIT_STRING := $(shell git describe --always --abbrev=4 --dirty=-`hostname` 2> /dev/null)
ifneq (,$(GIT_STRING))
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
ifeq ($(strip $(GIT_BRANCH)),master)
@ -74,7 +74,7 @@ ifeq ($(origin RIOT_VERSION), undefined)
RIOT_VERSION := $(GIT_STRING)-$(GIT_BRANCH)
endif
else
RIOT_VERSION := UNKNOWN
RIOT_VERSION := UNKNOWN (builddir: $(RIOTBASE))
endif
endif
export CFLAGS += -DRIOT_VERSION='"$(RIOT_VERSION)"'