From 3595f5ccf56b8849769f1f21ce221693a3cd4fe1 Mon Sep 17 00:00:00 2001 From: "Geoffrey D. Bennett" Date: Wed, 15 Nov 2023 00:00:04 +1030 Subject: [PATCH] Update Makefile to get version from $APP_VERSION If git describe fails, check $APP_VERSION, otherwise set the version to "Unknown". --- src/Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index e5564f8..4a5a945 100644 --- a/src/Makefile +++ b/src/Makefile @@ -4,7 +4,11 @@ # Credit to Tom Tromey and Paul D. Smith: # http://make.mad-scientist.net/papers/advanced-auto-dependency-generation/ -VERSION := $(shell git describe --abbrev=4 --dirty --always --tags) +VERSION := $(shell \ + git describe --abbrev=4 --dirty --always --tags 2>/dev/null || \ + echo $${APP_VERSION:-Unknown} \ +) + DEPDIR := .deps DEPFLAGS = -MT $@ -MMD -MP -MF $(DEPDIR)/$*.d