From 489ca515bea4e0462377d8852b7f29714afcba13 Mon Sep 17 00:00:00 2001 From: Gracjan Polak Date: Sat, 2 May 2015 11:20:16 +0200 Subject: [PATCH] Make Makefile warn if Emacs is too old. --- Makefile | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 7e4acd289..359aba7ec 100644 --- a/Makefile +++ b/Makefile @@ -85,9 +85,20 @@ ELCHECKS=$(addprefix check-, $(ELFILES:.el=)) @$(BATCH) \ -f batch-byte-compile $*.el -.PHONY: all compile info clean check $(ELCHECKS) elpa package - -all: compile $(AUTOLOADS) info +.PHONY: all compile info clean check $(ELCHECKS) elpa package check-emacs-version + +all: check-emacs-version compile $(AUTOLOADS) info + +check-emacs-version : + @$(BATCH) --eval "(when (< emacs-major-version 24) \ + (message \"Error: haskell-mode requires Emacs 23 or later\") \ + (message \"Your version of Emacs is %s\" emacs-version) \ + (message \"Found as '$(EMACS)'\") \ + (message \"Use one of:\") \ + (message \" 1. export EMACS=/path/to/emacs && make\") \ + (message \" 2. EMACS=/path/to/emacs make\") \ + (message \" 3. make EMACS=/path/to/emacs\") \ + (kill-emacs 2))" compile: $(ELCFILES)