build: allow building from source zip file.

Changes both how we construct it and how we deal with not having git.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2019-01-11 15:26:30 +10:30
parent 75df22e9e2
commit 0d5f0d79da
3 changed files with 13 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
#! /usr/bin/make
VERSION_NAME=Principled Opposition to SegWit
VERSION=$(shell git describe --always --dirty=-modded --abbrev=7)
# Extract version from git, or if we're from a zipfile, use dirname
VERSION=$(shell git describe --always --dirty=-modded --abbrev=7 2>/dev/null || pwd | sed -n 's,.*/clightning-\(v[0-9.rc]*\)$$,\1,p')
ifeq ($(VERSION),)
$(error "ERROR: git is required for generating version information")