Skip to content

Commit e93d1a0

Browse files
committed
Use version from VERSION file if git describe fails
This fixes issue #100. We prefer to determine version from git tags (using git describe). However, sometimes people don't use git or don't have it installed, which leads to empty version used. To solve this, we use version from VERSION file as a backup.
1 parent fc7aabb commit e93d1a0

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

Makefile

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ CC ?= gcc
1515
CFLAGS ?= -g -O0
1616
CFLAGS += -Wall -Wextra -std=c99 -pedantic
1717
GIT_VERSION := $(shell git describe --abbrev=4 --dirty --always --tags)
18+
ifeq ($(GIT_VERSION),)
19+
GIT_VERSION := $(shell cat VERSION)
20+
endif
1821
CFLAGS += -DPROGRAM_VERSION=\"$(GIT_VERSION)\"
1922

2023
ifeq ($(UNAME_S),Linux)

VERSION

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v2.0.0-dev

0 commit comments

Comments
 (0)