diff --git a/prism/Makefile b/prism/Makefile index 175cae5c..f1877073 100644 --- a/prism/Makefile +++ b/prism/Makefile @@ -550,7 +550,7 @@ clean_doc: # Set up version, in particular for building releases # Unless VERSION has been passed in (as VERSION=xxx), # extract version number from Java code using printversion -VERSION = $(shell PRISM_SRC_DIR=$(PRISM_SRC_DIR) $(PRISM_SRC_DIR)/scripts/printversion.sh 2> /dev/null) +VERSION = $(shell $(PRISM_SRC_DIR)/scripts/printversion.sh $(PRISM_SRC_DIR) 2> /dev/null) # Default branch for building source releases BRANCH = master diff --git a/prism/src/scripts/printversion.sh b/prism/src/scripts/printversion.sh index 10f87f86..986d93fa 100755 --- a/prism/src/scripts/printversion.sh +++ b/prism/src/scripts/printversion.sh @@ -4,13 +4,11 @@ # based on extraction of the info from Java files. # Mirrors what is done (in Java) in prism.getVersion(). -# If given, PRISM_SRC_DIR is assumed to point to the -# "src" directory in a PRISM source distribution. The -# default is just "src". +# If given, the first argument to the script is assumed +# to point to the "src" directory in a PRISM source +# distribution. The default is just "src". -if [ "$PRISM_SRC_DIR" = "" ]; then - PRISM_SRC_DIR=src; -fi +PRISM_SRC_DIR="${1:-src}" if [ -f "$PRISM_SRC_DIR"/prism/Version.java ]; then VERSION_NUM=`grep versionString "$PRISM_SRC_DIR"/prism/Version.java | sed -E 's/[^"]+"([^"]+)"[^"]+/\1/'`