summaryrefslogtreecommitdiff
path: root/Makefile
blob: d92146ab0659d1b1198b635a862556a4bc39ff45 (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
45
46
ELS = with-editor.el

DEPS = dash

INFOPAGES = with-editor.info
TEXIPAGES = with-editor.texi

ELCS    = $(ELS:.el=.elc)
DFLAGS  = $(addprefix -L ../,$(DEPS))
EFLAGS ?= $(DFLAGS)
EMACS  ?= emacs
BATCH   = $(EMACS) -batch -Q -L . $(EFLAGS)

MAKEINFO     ?= makeinfo
INSTALL_INFO ?= $(shell command -v ginstall-info || printf install-info)

.PHONY: help clean

help:
	$(info make all    - compile elisp and manual)
	$(info make lisp   - compile elisp)
	$(info make info   - generate info manual)
	$(info make clean  - remove generated files)
	@printf "\n"

all: lisp info

lisp: $(ELCS)
%.elc: %.el
	@printf "Compiling %s\n" $<
	@$(BATCH)\
	  --eval '(setq with-editor-emacsclient-executable nil)'\
	  -f batch-byte-compile $<

info: $(INFOPAGES) dir
%.info: %.texi
	@printf "Generating $@\n"
	@$(MAKEINFO) --no-split $< -o $@

dir: $(TEXIPAGES)
	@printf "Generating dir\n"
	@echo $^ | xargs -n 1 $(INSTALL_INFO) --dir=$@

clean:
	@printf "Cleaning...\n"
	@rm -f $(ELCS)