mirror of
https://github.com/mvp/uhubctl.git
synced 2026-05-17 08:26:29 +03:00
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.
This commit is contained in:
3
Makefile
3
Makefile
@@ -15,6 +15,9 @@ CC ?= gcc
|
||||
CFLAGS ?= -g -O0
|
||||
CFLAGS += -Wall -Wextra -std=c99 -pedantic
|
||||
GIT_VERSION := $(shell git describe --abbrev=4 --dirty --always --tags)
|
||||
ifeq ($(GIT_VERSION),)
|
||||
GIT_VERSION := $(shell cat VERSION)
|
||||
endif
|
||||
CFLAGS += -DPROGRAM_VERSION=\"$(GIT_VERSION)\"
|
||||
|
||||
ifeq ($(UNAME_S),Linux)
|
||||
|
||||
Reference in New Issue
Block a user