@@ -27,11 +27,7 @@ EMACS := $(shell which "$${EMACS}" 2> /dev/null || which "emacs")
27
27
EMACS_VERSION := $(shell "$(EMACS ) " -Q --batch --eval '(princ emacs-version) ')
28
28
29
29
EFLAGS = --eval "(add-to-list 'load-path (expand-file-name \"tests/compat\") 'append)" \
30
- --eval '(setq byte-compile-error-on-warn t)' \
31
- --eval '(when (not (version< emacs-version "24.4")) (setq load-prefer-newer t))' \
32
- --eval '(defun byte-compile-dest-file (filename) \
33
- (concat (file-name-directory filename) "build-" emacs-version "/" \
34
- (file-name-nondirectory filename) "c"))'
30
+ --eval "(when (boundp 'load-prefer-newer) (setq load-prefer-newer t))"
35
31
36
32
BATCH = $(EMACS ) $(EFLAGS ) --batch -Q -L .
37
33
@@ -58,32 +54,35 @@ check-emacs-version :
58
54
(message \" 3. make EMACS=/path/to/emacs\") \
59
55
(kill-emacs 2))"
60
56
61
- compile : build-$(EMACS_VERSION )
57
+ compile : build-$(EMACS_VERSION ) /build-flag
62
58
63
- build-$(EMACS_VERSION ) : $(ELFILES )
64
- if [ ! -d $@ ]; then mkdir $@ ; fi
65
- $(BATCH ) -f batch-byte-compile-if-not-done $^
59
+ build-$(EMACS_VERSION ) /build-flag : $(ELFILES )
60
+ if [ ! -d $$ (dirname $@ ) ]; then mkdir $$ (dirname $@ ); fi
61
+ $(BATCH ) --eval ' (setq byte-compile-error-on-warn t)' \
62
+ --eval " (defun byte-compile-dest-file (filename) \
63
+ (concat (file-name-directory filename) \" build-\" emacs-version \" /\" \
64
+ (file-name-nondirectory filename) \" c\" ))' " \
65
+ -f batch-byte-compile $^
66
+ touch $@
66
67
67
68
check-% : tests/% -tests.el
68
69
$(BATCH ) -l " $<" -f ert-run-tests-batch-and-exit;
69
70
70
- check : $(ELCHECKS ) build-$(EMACS_VERSION )
71
+ check : compile $(AUTOLOADS ) check-ert check-conventions
72
+
73
+ check-conventions :
74
+ $(BATCH ) -l tests/haskell-code-conventions.el \
75
+ -f haskell-check-conventions-batch-and-exit
76
+ @echo "conventions are okay"
77
+
78
+ check-ert : $(ELCHECKS )
71
79
$(BATCH ) --eval " (when (= emacs-major-version 24) \
72
80
(require 'undercover) \
73
81
(undercover \"*.el\" \
74
82
( :exclude \"haskell-mode-pkg.el\" \"haskell-compat.el\")))" \
75
83
-L tests \
76
84
$(patsubst %,-l %,$(ELCHECKS)) \
77
85
-f ert-run-tests-batch-and-exit
78
- @TAB=$$(echo "\t"); \
79
- if grep -Hn "[ $${TAB}]\+\$$" *.el tests/*.el; then \
80
- echo "Error: Files contain whitespace at the end of lines" >&2; \
81
- exit 3; \
82
- fi; \
83
- if grep -Hn "[$${TAB}]" *.el tests/*.el; then \
84
- echo "Error: Tab character is not allowed" >&2; \
85
- exit 3; \
86
- fi
87
86
@echo "checks passed!"
88
87
89
88
clean :
0 commit comments