mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 00:49:45 +01:00
21649b2cb3
Move git version evaluation to a separate file. The definition has been updated it to a deferred only definition. This way git is not called when GIT_VERSION is not used.
12 lines
538 B
Makefile
12 lines
538 B
Makefile
# GIT_VERSION is git description + branch name if it not master
|
|
# Empty when not in a git repository
|
|
#
|
|
# 2019.10-devel-97-g3bcc72
|
|
# 2019.10-devel-97-g3bcc72-pr/git_version
|
|
|
|
GIT_DESCRIBE = $(call memoized,GIT_DESCRIBE,$(shell git --git-dir="$(RIOTBASE)/.git" describe --always --abbrev=4 2> /dev/null))
|
|
GIT_BRANCH = $(call memoized,GIT_BRANCH,$(shell git --git-dir="$(RIOTBASE)/.git" rev-parse --abbrev-ref HEAD))
|
|
_GIT_VERSION = $(GIT_DESCRIBE)$(addprefix -,$(GIT_BRANCH:master=))
|
|
|
|
GIT_VERSION ?= $(if $(GIT_DESCRIBE),$(_GIT_VERSION))
|