aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: bcd2893bfb2a7652a07be8028d22ba5fdc7cd922 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42

LOAD_PATH = -L .deps -L .
EMACS = emacs
BATCH = $(EMACS) -Q --batch $(LOAD_PATH)
CURL := curl --silent

els := snakemake.el snakemake-mode.el
elcs := $(patsubst %.el, %.elc, $(els))
AUTOLOADS_FILE = snakemake-autoloads.el

DASH_URL := https://raw.githubusercontent.com/magnars/dash.el/master/dash.el
POPUP_URL := https://raw.githubusercontent.com/magit/magit-popup/master/magit-popup.el

.PHONY: all
all: $(elcs) $(AUTOLOADS_FILE)

.PHONY: test
test: | .deps
	@$(BATCH) -l snakemake-test \
	--eval "(ert-run-tests-batch-and-exit '(not (tag interactive)))"

$(AUTOLOADS_FILE): $(els)
	@$(BATCH) -l autoload --eval \
	"(let ((make-backup-files nil) \
	       (generated-autoload-file \"$(CURDIR)/$@\")) \
	  (update-directory-autoloads \"$(CURDIR)/\"))"

.deps:
	mkdir -p .deps
	$(CURL) $(DASH_URL) > .deps/dash.el
	$(CURL) $(POPUP_URL) > .deps/magit-popup.el

%.elc: %.el | .deps
	@$(BATCH) -f batch-byte-compile $<

.PHONY: clean
clean:
	$(RM) $(elcs) $(AUTOLOADS_FILE)

.PHONY: clean-all
clean-all: clean
	$(RM) -r .deps