From 0af037d474d4f87189df85a783da7c624559a755 Mon Sep 17 00:00:00 2001 From: 10sr <8slashes+git@gmail.com> Date: Wed, 14 Jan 2015 20:59:55 +0900 Subject: [PATCH] Makefile: Add syntax check target --- Makefile | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 3d53239..68c38b2 100644 --- a/Makefile +++ b/Makefile @@ -17,13 +17,25 @@ emacs ?= emacs all: default -tests = test-el test-sh -test: $(tests) +# `make check` is just an alias for `make test` +check: test + +# Similarly, check-syntax is test-syntax +check-syntax: test-syntax + +tests = test-el +test: $(tests) test-syntax + +test_syntaxes = test-syntax-el test-syntax-sh +test-syntax: $(test_syntaxes) setups = setup-darwin setup-directories setup-emacs setup: $(setups) -.PHONY: all default test $(tests) setup $(setups) +.PHONY: all default \ + test check $(tests) \ + test-syntax check-syntax $(test_syntaxes)\ + setup $(setups) @@ -82,13 +94,19 @@ setup-emacs: emacs.el # test # ==== -test_shs = test-shrc test-profile test-setup.sh test-xinitrc test-xprograms -test-sh: $(test_shs) -.PHONY: $(test_shs) - -$(test_shs): test-%: % - sh -ec 'for sh in $(shrc_loadables); do $$sh -n $<; done' - test-el: emacs.el EMACS_EL_DRY_RUN=t $(emacs) -q --debug-init --batch \ --eval "(setq debug-on-error t)" --load $< --kill + + + +# test syntax +# =========== + +test_syntax_shs = test-syntax-shrc test-syntax-profile test-syntax-setup.sh \ + test-syntax-xinitrc test-syntax-xprograms +test-syntax-sh: $(test_syntax_shs) +.PHONY: $(test_syntax_shs) + +$(test_syntax_shs): test-syntax-%: % + sh -ec 'for sh in $(shrc_loadables); do $$sh -n $<; done'