Skip to content

Commit 8ba36bd

Browse files
committed
Improve getting version from git describe
* To determine version, only consider tags starting with v{digit} * Strip v prefix from version
1 parent aaf87ac commit 8ba36bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ RM := rm -rf
1414
CC ?= gcc
1515
CFLAGS ?= -g -O0
1616
CFLAGS += -Wall -Wextra -std=c99 -pedantic
17-
GIT_VERSION := $(shell git describe --abbrev=8 --dirty --always --tags)
17+
GIT_VERSION := $(shell git describe --match "v[0-9]*" --abbrev=8 --dirty --always --tags | cut -c2-)
1818
ifeq ($(GIT_VERSION),)
1919
GIT_VERSION := $(shell cat VERSION)
2020
endif

0 commit comments

Comments
 (0)