aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile.in
diff options
context:
space:
mode:
authorAndreas Bombe <aeb@debian.org>2021-10-03 20:29:20 +0200
committertgingold <tgingold@users.noreply.github.com>2021-10-04 07:24:42 +0200
commit5ae1ab81b54e0a065c9a309e64dc8f790ea94b2c (patch)
tree01651f27a8fced4846af9b008883809edfbfe170 /Makefile.in
parent23b2ab60ed68afc91fc68aafaf4ad54efcead307 (diff)
downloadghdl-5ae1ab81b54e0a065c9a309e64dc8f790ea94b2c.tar.gz
ghdl-5ae1ab81b54e0a065c9a309e64dc8f790ea94b2c.tar.bz2
ghdl-5ae1ab81b54e0a065c9a309e64dc8f790ea94b2c.zip
Makefile.in: Allow overriding version string even with git
When creating version.tmp, the Makefile.in has provisions for setting the DESC, REF and HASH variables from environment variables. However these would be overwritten if it detects it is building from a git checkout. This commit changes it to always override the default or autodetected values when the environment variables are available,
Diffstat (limited to 'Makefile.in')
-rw-r--r--Makefile.in15
1 files changed, 9 insertions, 6 deletions
diff --git a/Makefile.in b/Makefile.in
index 007879e70..09a10480b 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -171,14 +171,17 @@ include $(srcdir)/src/grt/Makefile.inc
version.tmp: $(srcdir)/src/version.in force
# Create version.tmp from version.in, using git date/hash, or envvars.
- GHDL_VER_DESC=$${GHDL_VER_DESC:-tarball}; \
- GHDL_VER_REF=$${GHDL_VER_REF:-unknown}; \
- GHDL_VER_HASH=$${GHDL_VER_HASH:-unknown}; \
+ GHDL_AUTO_VER_DESC=tarball; \
+ GHDL_AUTO_VER_REF=unknown; \
+ GHDL_AUTO_VER_HASH=unknown; \
if test -d $(srcdir)/.git && desc=`cd $(srcdir); git describe --dirty --long`; then \
- GHDL_VER_DESC=`echo $$desc | sed -e 's/\([^-]*-g\)/r\1/' -e 's/-/./g' -e 's/^v//g'`; \
- GHDL_VER_REF=`cd $(srcdir); git rev-parse --abbrev-ref HEAD`; \
- GHDL_VER_HASH=`cd $(srcdir); git rev-parse HEAD`; \
+ GHDL_AUTO_VER_DESC=`echo $$desc | sed -e 's/\([^-]*-g\)/r\1/' -e 's/-/./g' -e 's/^v//g'`; \
+ GHDL_AUTO_VER_REF=`cd $(srcdir); git rev-parse --abbrev-ref HEAD`; \
+ GHDL_AUTO_VER_HASH=`cd $(srcdir); git rev-parse HEAD`; \
fi; \
+ GHDL_VER_DESC=$${GHDL_VER_DESC:-$$GHDL_AUTO_VER_DESC}; \
+ GHDL_VER_REF=$${GHDL_VER_REF:-$$GHDL_AUTO_VER_REF}; \
+ GHDL_VER_HASH=$${GHDL_VER_HASH:-$$GHDL_AUTO_VER_HASH}; \
sed \
-e "s#@VER@#$(ghdl_version)#" \
-e "s#@DESC@#$${GHDL_VER_DESC}#" \