Fix computation of BVERSION leading to error message if beremiz source tree is missing when make is invoked
authorEdouard Tisserant <edouard.tisserant@gmail.com>
Mon, 13 Feb 2023 22:03:09 +0100
changeset 112 b78f14613a6c
parent 111 e31e95e05a3c
child 113 d986e1935daf
Fix computation of BVERSION leading to error message if beremiz source tree is missing when make is invoked
Makefile
windows_installer.mk
--- a/Makefile	Mon Jan 16 20:42:47 2023 +0000
+++ b/Makefile	Mon Feb 13 22:03:09 2023 +0100
@@ -16,8 +16,6 @@
 GITROOT := $(HGROOT)
 CPUS := `cat /proc/cpuinfo | grep -e 'processor\W*:\W*[[:digit:]]*' | nl -n ln | tail -n1 | cut -f1`
 
-BVERSION=$(shell python2 sources/beremiz/version.py)
-
 distfiles = $(src)/distfiles
 sfmirror = downloads
 tmp := $(shell rm -rf $${TMPDIR:-/tmp}/beremiz_dist_build_tmp.* ; mktemp -d -t beremiz_dist_build_tmp.XXXXXXXXXX)
--- a/windows_installer.mk	Mon Jan 16 20:42:47 2023 +0000
+++ b/windows_installer.mk	Mon Feb 13 22:03:09 2023 +0100
@@ -1,4 +1,6 @@
-BVERSION=$(shell python2 sources/beremiz/version.py)
+
+VERSIONPY=sources/beremiz/version.py
+BVERSION?=$(if $(file <$(VERSIONPY)), $(shell python2 $(VERSIONPY)), $(shell date '+%x_%R' | tr '/: ' '---'))
 
 CROSS_COMPILE=i686-w64-mingw32
 CROSS_COMPILE_LIBS_DIR=$(shell dirname $(shell $(CROSS_COMPILE)-gcc -print-libgcc-file-name))