From a01342a66adbf2a88b69fcf74b8e1f7b192986fc Mon Sep 17 00:00:00 2001 From: William Casarin Date: Wed, 9 Jan 2019 21:22:46 -0800 Subject: [PATCH] make: fail build if git isn't present git is needed to generate version information Add a sanity check so that the build don't continue with an empty VERSION. This is useful for sandboxed build where we might have forgot to include git. Signed-off-by: William Casarin --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index 912ffb3c9..3457301e8 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,11 @@ #! /usr/bin/make VERSION_NAME=Principled Opposition to SegWit VERSION=$(shell git describe --always --dirty=-modded --abbrev=7) + +ifeq ($(VERSION),) +$(error "ERROR: git is required for generating version information") +endif + DISTRO=$(shell lsb_release -is 2>/dev/null || echo unknown)-$(shell lsb_release -rs 2>/dev/null || echo unknown) PKGNAME = c-lightning