aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 35b0cddd3fcb85dffa9effa89803eadef7e83ac2 (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
43
44

-include config.mk

SEQ_DIR ?= /dev/null
COMPAT_DIR ?= /dev/null
TRANSIENT_DIR ?= /dev/null

LOAD_PATH = -L $(SEQ_DIR) -L $(COMPAT_DIR) -L $(TRANSIENT_DIR) -L .
EMACS = emacs
BATCH = $(EMACS) -Q --batch $(LOAD_PATH)

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

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

.PHONY: test
test:
	@$(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)/\"))"

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

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

.PHONY: sign-tar
sign-tar:
	tag="$$(git describe --abbrev=0)"; \
	object=$$(git archive --format tar \
		    --prefix "snakemake-mode-$${tag#v}/" "$$tag" | \
		  gpg --output - --armor --detach-sign | \
		  git hash-object -w --stdin); \
	git notes --ref=refs/notes/signatures/tar add -C "$$object" "$$tag"