Skip to content

Commit 5a3e0dd

Browse files
committed
Refactored make check target
This introduces "phony" check-* sub-targets instead of the previous batch-mode operation.
1 parent b7e3687 commit 5a3e0dd

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

Makefile

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,25 +42,30 @@ DIST_TGZ = haskell-mode-$(GIT_VERSION).tar.gz
4242

4343
PKG_DIST_FILES = $(ELFILES) logo.svg
4444
PKG_TAR = haskell-mode-$(VERSION).tar
45+
ELCHECKS=$(addprefix check-, $(ELFILES:.el=))
4546

4647
%.elc: %.el
4748
@$(BATCH) \
4849
--eval "(byte-compile-disable-warning 'cl-functions)" \
4950
-f batch-byte-compile $<
5051

51-
.PHONY: all compile info dist clean test elpa package
52+
.PHONY: all compile info dist clean check $(ELCHECKS) elpa package
5253

5354
all: compile $(AUTOLOADS)
5455

5556
compile: $(ELCFILES)
5657

57-
check:
58-
$(BATCH) \
59-
--eval "(setq byte-compile-error-on-warn t)" \
60-
--eval "(byte-compile-disable-warning 'cl-functions)" \
61-
-f batch-byte-compile $(ELFILES)
62-
@$(RM) $(ELCFILES)
63-
$(BATCH) --eval '(when (check-declare-directory ".") (error "check-declare failed"))'
58+
$(ELCHECKS): check-%: %.el
59+
@$(BATCH) --eval '(when (check-declare-file "$*.el") (error "check-declare failed"))'
60+
@$(BATCH) \
61+
--eval "(setq byte-compile-error-on-warn t)" \
62+
--eval "(byte-compile-disable-warning 'cl-functions)" \
63+
-f batch-byte-compile $*.el
64+
@$(RM) $*.elc
65+
@echo "--"
66+
67+
check: $(ELCHECKS)
68+
@echo "checks passed!"
6469

6570
clean:
6671
$(RM) $(ELCFILES) $(AUTOLOADS) $(AUTOLOADS:.el=.elc) $(DIST_TGZ) $(PKG_TAR)

0 commit comments

Comments
 (0)