Commit ae168755 authored by ulrich_y's avatar ulrich_y

Added version tracking in releases

parent 532aa4f1
*.mm gitlab-language=mathematica
*.m gitlab-language=mathematica
*.tm gitlab-language=c
configure export-subst
......@@ -148,6 +148,32 @@ done
test=test$$
trap "rm -fr $test* =." 0 1 2 3 15
HAVE_GIT=false
if type -P git &>/dev/null ; then
if [ -d .git ]; then
HAVE_GIT=true
fi
fi
# This will be set by git-archive
VTAG="$Format: %D, %h$"
if $HAVE_GIT ; then
VERSION=`git describe`
COMMIT=`git log -1 --pretty=format:"%h"`
elif [[ "$VTAG" == *"HEAD"* ]]; then
VERSION=`echo $VTAG | perl -lpe 's/.*?(, tag: ([^,]*))?,.*? ([a-f\d]+)$/\2/g'`
COMMIT=` echo $VTAG | perl -lpe 's/.*?(, tag: ([^,]*))?,.*? ([a-f\d]+)$/\3/g'`
if [ -z "$VERSION" ]; then
VERSION="untagged-$COMMIT"
fi
else
VERSION="v?.?.?"
COMMIT="unknown"
fi
if $COVERAGE ; then
$DEBUG || echo "Warning: --coverage implies --debug!" 1>&3
......@@ -702,7 +728,8 @@ EOF
$HAVE_MCC && cat >> makefile <<EOF
build/%.tm.c: src/%.tm
@echo "MPREP \$@"
@cat \$< | sed '/:Begin:/,/:End:/ s/Real/Real$($CONF_QUAD && echo 128)/g' | \$(MPREP) > \$@
@cat \$< | sed '/:Begin:/,/:End:/ s/Real/Real$($CONF_QUAD && echo 128)/g' \\
| sed 's/__VERSION__/$VERSION/g' | \$(MPREP) > \$@
build/mathlink.o: build/mathlink.tm.c
@echo "CC \$<"
......@@ -838,3 +865,6 @@ distclean:
@rm -f checks/test-chen.f90 checks/test-muone.f90 checks/test-muoneNP.f90
@rm -f makefile handyg.pc
EOF
echo "Configuration of handyG $VERSION done. Now type \"make\"."
:Evaluate: BeginPackage["handyG`"];
:Evaluate:
Print["handyG by L. Naterop, Y. Ulrich, A. Signer"];
Print["handyG-__VERSION__ by L. Naterop, Y. Ulrich, A. Signer"];
G::usage = "G function";
ClearCache::usage = "Clears handyG cache";
SetHandyOptions::usage = "Sets evaluation options";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment