From 63f55c785e59c2e541f557ad86baecd467cb4f6d Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Mon, 27 Nov 2017 05:31:32 -0800 Subject: [PATCH] makefile: Abort build if GREP_OPTIONS environment variable is defined This avoids the interference in this makefile's use of grep as discussed in #492 --- makefile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/makefile b/makefile index d58a7654..7a96a6b2 100644 --- a/makefile +++ b/makefile @@ -67,6 +67,19 @@ # # CC Command (and platform available options). (Poor man's autoconf) # +ifneq (,$(GREP_OPTIONS)) + $(info GREP_OPTIONS is defined in your environment.) + $(info ) + $(info This variable interfers with the proper operation of this script.) + $(info ) + $(info The GREP_OPTIONS environment variable feature of grep is deprecated) + $(info for exactly this reason and will be removed from future versions of) + $(info grep. The grep man page suggests that you use an alias or a script) + $(info to invoke grep with your preferred options.) + $(info ) + $(info unset the GREP_OPTIONS environment variable to use this makefile) + $(error 1) +endif ifeq (old,$(shell gmake --version /dev/null 2>&1 | grep 'GNU Make' | awk '{ if ($$3 < "3.81") {print "old"} }')) GMAKE_VERSION = $(shell gmake --version /dev/null 2>&1 | grep 'GNU Make' | awk '{ print $$3 }') $(warning *** Warning *** GNU Make Version $(GMAKE_VERSION) is too old to)