diff options
author | Tristan Gingold <tgingold@free.fr> | 2021-10-04 07:31:35 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2021-10-06 07:44:30 +0200 |
commit | a55be2985363ea431fb9a743f6840009c2b77526 (patch) | |
tree | a5b71b726a4c5209de9efecce7e5ed6322d9f059 /Makefile.in | |
parent | 36d8c01defbcc650818b1606adc1fa952af4a682 (diff) | |
download | ghdl-a55be2985363ea431fb9a743f6840009c2b77526.tar.gz ghdl-a55be2985363ea431fb9a743f6840009c2b77526.tar.bz2 ghdl-a55be2985363ea431fb9a743f6840009c2b77526.zip |
version.in: reformatting, simplify the Makefile rule
Diffstat (limited to 'Makefile.in')
-rw-r--r-- | Makefile.in | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/Makefile.in b/Makefile.in index 09a10480b..869a6e3da 100644 --- a/Makefile.in +++ b/Makefile.in @@ -171,22 +171,20 @@ 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_AUTO_VER_DESC=tarball; \ - GHDL_AUTO_VER_REF=unknown; \ - GHDL_AUTO_VER_HASH=unknown; \ +# The user is allowed to set GHDL_VER_DESC to override description. + DEF_VER_DESC=tarball; \ + VER_REF=unknown; \ + VER_HASH=unknown; \ if test -d $(srcdir)/.git && desc=`cd $(srcdir); git describe --dirty --long`; then \ - 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`; \ + DEF_VER_DESC=`echo $$desc | sed -e 's/\([^-]*-g\)/r\1/' -e 's/-/./g' -e 's/^v//g'`; \ + VER_REF=`cd $(srcdir); git rev-parse --abbrev-ref HEAD`; \ + 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}#" \ - -e "s#@REF@#$${GHDL_VER_REF}#" \ - -e "s#@HASH@#$${GHDL_VER_HASH}#" \ + -e "s#@DESC@#$${GHDL_VER_DESC:-$$DEF_VER_DESC}#" \ + -e "s#@REF@#$${VER_REF}#" \ + -e "s#@HASH@#$${VER_HASH}#" \ < $< > $@; version.ads: version.tmp |