Skip to content

Commit fe62822

Browse files
committed
Merge pull request #620 from gracjan/pr-makefile
Make Makefile warn if Emacs is too old.
2 parents a69d06d + 489ca51 commit fe62822

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

Makefile

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,20 @@ ELCHECKS=$(addprefix check-, $(ELFILES:.el=))
8585
@$(BATCH) \
8686
-f batch-byte-compile $*.el
8787

88-
.PHONY: all compile info clean check $(ELCHECKS) elpa package
89-
90-
all: compile $(AUTOLOADS) info
88+
.PHONY: all compile info clean check $(ELCHECKS) elpa package check-emacs-version
89+
90+
all: check-emacs-version compile $(AUTOLOADS) info
91+
92+
check-emacs-version :
93+
@$(BATCH) --eval "(when (< emacs-major-version 24) \
94+
(message \"Error: haskell-mode requires Emacs 23 or later\") \
95+
(message \"Your version of Emacs is %s\" emacs-version) \
96+
(message \"Found as '$(EMACS)'\") \
97+
(message \"Use one of:\") \
98+
(message \" 1. export EMACS=/path/to/emacs && make\") \
99+
(message \" 2. EMACS=/path/to/emacs make\") \
100+
(message \" 3. make EMACS=/path/to/emacs\") \
101+
(kill-emacs 2))"
91102

92103
compile: $(ELCFILES)
93104

0 commit comments

Comments
 (0)