add the git prefix to the long version output

Tested on MacOS, written and not tested for Linux, not attempted for Windows
This commit is contained in:
nhkeni
2024-06-19 12:28:13 -04:00
parent 0cc134bb95
commit a8b5e88744
6 changed files with 23 additions and 1 deletions

View File

@@ -285,6 +285,7 @@ VARDATND += $(sort $(VARDATND0))
GIT_HASH := $(shell echo `git rev-parse --verify HEAD` 2>&1)
GIT_BRANCH := $(shell echo `git rev-parse --abbrev-ref HEAD` 2>&1)
GIT_PREFIX := $(shell echo `git config nethack.substprefix` 2>&1)
ifdef GIT_HASH
GITHASH = -DNETHACK_GIT_SHA=\"$(GIT_HASH)\"
@@ -292,6 +293,9 @@ endif
ifdef GIT_BRANCH
GITBRANCH = -DNETHACK_GIT_BRANCH=\"$(GIT_BRANCH)\"
endif
ifdef GIT_PREFIX
GITPREFIX = -DNETHACK_GIT_PREFIX=\"$(GIT_PREFIX)\"
endif
ifdef WANT_LIBNH
CFLAGS += -DSHIM_GRAPHICS -DNOTTYGRAPHICS -DNOSHELL -DLIBNH