summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile46
1 files changed, 46 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..d92146a
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,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)