Skip to content
Snippets Groups Projects
Commit e5613d30 authored by Ludwig Knüpfer's avatar Ludwig Knüpfer
Browse files

make: allow setting RIOT_VERSION externally

also make the RIOT_VERSION variable available in buildtest
parent 1b3f3450
No related branches found
No related tags found
No related merge requests found
...@@ -55,6 +55,7 @@ buildtest: ...@@ -55,6 +55,7 @@ buildtest:
RIOTCPU=$${RIOTCPU} \ RIOTCPU=$${RIOTCPU} \
BINDIRBASE=$${BINDIRBASE} \ BINDIRBASE=$${BINDIRBASE} \
RIOTNOLINK=$${RIOTNOLINK} \ RIOTNOLINK=$${RIOTNOLINK} \
RIOT_VERSION=$${RIOT_VERSION} \
$(MAKE) -j$(NPROC) 2>&1 >/dev/null) ; \ $(MAKE) -j$(NPROC) 2>&1 >/dev/null) ; \
if [ "$${?}" = "0" ]; then \ if [ "$${?}" = "0" ]; then \
$${ECHO} "$${GREEN}success$${RESET}"; \ $${ECHO} "$${GREEN}success$${RESET}"; \
......
...@@ -64,16 +64,18 @@ endif ...@@ -64,16 +64,18 @@ endif
include $(RIOTBASE)/Makefile.cflags include $(RIOTBASE)/Makefile.cflags
# make the RIOT version available to the program # make the RIOT version available to the program
GIT_STRING := $(shell git describe --always --abbrev=4 --dirty=-`hostname`) ifeq ($(origin RIOT_VERSION), undefined)
ifneq (,$(GIT_STRING)) GIT_STRING := $(shell git describe --always --abbrev=4 --dirty=-`hostname`)
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD) ifneq (,$(GIT_STRING))
ifeq ($(strip $(GIT_BRANCH)),master) GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
RIOT_VERSION := $(GIT_STRING) ifeq ($(strip $(GIT_BRANCH)),master)
RIOT_VERSION := $(GIT_STRING)
else
RIOT_VERSION := $(GIT_STRING)-$(GIT_BRANCH)
endif
else else
RIOT_VERSION := $(GIT_STRING)-$(GIT_BRANCH) RIOT_VERSION := UNKNOWN
endif endif
else
RIOT_VERSION := UNKNOWN
endif endif
export CFLAGS += -DRIOT_VERSION='"$(RIOT_VERSION)"' export CFLAGS += -DRIOT_VERSION='"$(RIOT_VERSION)"'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment