aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 1a2f3f73b3fbcb954c30a0be59770f211720bafd (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
EMACS = emacs -Q --batch
name = org-link-edit
main_el :=  $(name).el
main_elc =  $(main_el)c
AUTOLOADS_FILE := $(name)-autoloads.el

all: $(main_elc)

.PHONY: autoloads
autoloads: $(AUTOLOADS_FILE)

$(AUTOLOADS_FILE): $(main_el)
	@$(EMACS) --eval \
	"(update-file-autoloads \"$(CURDIR)/$<\" nil \"$(CURDIR)/$@\")"

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

.PHONY: help
help:
	@printf "\nTargets:\n\n"
	@printf "  all                Byte compile $(main_el).\n"
	@printf "  autoloads          Generate $(AUTOLOADS_FILE).\n"
	@printf "  clean              Remove generated files.\n"
	@printf "  help               Print this message.\n"
	@printf "  test               Run tests.\n"

.PHONY: test
test:
	@$(EMACS) -L . -l test-org-link-edit \
	--eval "(ert-run-tests-batch-and-exit '(not (tag interactive)))"

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