Skip to content

Commit

Permalink
Makefile: turn any byte-compilation warnings into errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Hi-Angel committed Feb 20, 2024
1 parent 0c79bf0 commit c41e60f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,23 @@ INIT_PACKAGES="(progn \
(package-install pkg))) \
)"

BATCH_W_ERROR = -batch --eval "(setq byte-compile-error-on-warn t)"

all: compile-tests test package-lint clean-elc

package-lint:
${EMACS} --eval ${INIT_PACKAGES} -batch -f package-lint-batch-and-exit hcl-mode.el
${EMACS} --eval ${INIT_PACKAGES} $(BATCH_W_ERROR) -f package-lint-batch-and-exit hcl-mode.el

hcl-mode.elc: hcl-mode.el Makefile
${EMACS} -batch -f batch-byte-compile $<
${EMACS} $(BATCH_W_ERROR) -f batch-byte-compile $<

test/test-helper.elc: test/test-helper.el hcl-mode.elc
${EMACS} -L . -batch -f batch-byte-compile $<
${EMACS} -L . $(BATCH_W_ERROR) -f batch-byte-compile $<

TESTS-EL = test/test-command.el test/test-highlighting.el test/test-indentation.el
TESTS-ELC = test/test-command.elc test/test-highlighting.elc test/test-indentation.elc
$(TESTS-ELC): test/test-helper.elc hcl-mode.elc $(TESTS-EL)
${EMACS} -L . -l test/test-helper.elc -batch -f batch-byte-compile test/test-command.el test/test-highlighting.el test/test-indentation.el
${EMACS} -L . -l test/test-helper.elc $(BATCH_W_ERROR) -f batch-byte-compile test/test-command.el test/test-highlighting.el test/test-indentation.el
compile-tests: $(TESTS-ELC)

test: $(TESTS-ELC)
Expand Down

0 comments on commit c41e60f

Please sign in to comment.