summaryrefslogtreecommitdiff
blob: 040ef89f25856634d728c3fe49f69adeb6623f7d (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
PWD         ?= $(shell pwd)

ELS          = $(wildcard $(PWD)/*.el)
ELCS         = $(ELS:.el=.elc)

EMACS       := emacs
RM          := rm -f

EMACFLAGS   := --batch -q --no-site-file -L $(PWD)
EMACSCMD     = $(EMACS) $(EMACFLAGS)


.PHONY: all
all: clean compile

.PHONY: clean
clean:
	$(RM) $(ELCS)

%.elc:
	$(EMACSCMD) --eval "(byte-compile-file \"$(*).el\" 0)"

.PHONY: compile
compile: $(ELCS)

.PHONY: install
install: compile
	$(EMACSCMD) \
		--eval "(require 'package)" \
		--eval "(package-install-file \"$(PWD)\")"