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

12 lines
538 B
Makefile
Raw Normal View History

# 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))