From: Andre Noll Date: Sun, 25 Apr 2021 22:04:05 +0000 (+0200) Subject: build: Bail out early if m4 or lex don't exist. X-Git-Tag: v1.0.4~5^2~3 X-Git-Url: http://git.tuebingen.mpg.de/?p=lopsub.git;a=commitdiff_plain;h=7623e601612eb36cf86511b40fef3f5a20e8b834;ds=sidebyside build: Bail out early if m4 or lex don't exist. This gives a decent error message on the attempt to run make(1) on a system where one or both of these essential programs are not installed. A previous version of the patch used .SHELLSTATUS instead of the dummy variable, but this did not work with make-4.1 which ships with Ubuntu-18.04. Suggested-by: Alex Gietz --- diff --git a/Makefile b/Makefile index 200a7c0..c0057a3 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,15 @@ INSTALL := install GZIP := gzip -fn9 ZCAT := zcat +dummy != $(M4) /dev/null || printf 'failed' +ifeq ($(dummy), failed) +$(error m4 is required to build this package) +endif +dummy != printf '%%%%\n' | $(LEX) -o /dev/null || printf 'failed' +ifeq ($(dummy), failed) +$(error (f)lex is required to build this package) +endif + DATE_FMT := +%B %Y # To get a reproducible build, we use $(SOURCE_DATE_EPOCH) instead of the # current time if this variable is set.