1
0
mirror of https://github.com/hashcat/hashcat.git synced 2024-11-29 11:28:15 +00:00

Simplify production versioning and fix variable content if there's no git installed

This commit is contained in:
jsteube 2018-01-26 23:15:11 +01:00
parent 18bb0a9493
commit 213de0ba43

View File

@ -6,6 +6,7 @@
SHARED := 0
DEBUG := 0
PRODUCTION := 0
PRODUCTION_VERSION := v4.0.1
##
## Detect Operating System
@ -62,12 +63,16 @@ CC := cc
SED := gsed
endif
# the following variable value will be automatically replaced by the "git archive" command
# (which is automatically run for every github release)
# the value will be something like this: "tag: vX.Y.Z, refs/pull/K/head" or "HEAD -> master, tag: vX.Y.Z"
##
## Version
##
ifeq ($(PRODUCTION),1)
VERSION_TAG := $(PRODUCTION_VERSION)
else
VERSION_TAG := $(shell git describe --tags --dirty=+ || echo $(PRODUCTION_VERSION))
endif # PRODUCTION
VERSION_EXPORT := $Format:%D$
VERSION_TAG := $(shell test -d .git && git describe --tags --dirty=+ || echo "$(VERSION_EXPORT)" | $(SED) 's/.*: v\([\.0-9]*\).*/v\1/')
VERSION_PURE := $(shell echo "$(VERSION_TAG)" | $(SED) 's/.*v\([\.0-9]*\).*/\1/')
##