blob: 2dc501dab29162827d7fd28789f3c7f329c3f670 (
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
|
ELS = with-editor.el
DEPS = dash
TEXIPAGES = with-editor.texi
INFOPAGES = with-editor.info
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)
WITH_EDITOR_VERSION = 2.5.2
ASYNC_VERSION = 1.9
DASH_VERSION = 2.13.0
.PHONY: help clean AUTHORS.md
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)
$(info )
$(info Release Managment)
$(info =================)
$(info )
$(info make authors - generate AUTHORS.md)
$(info make bump-versions - bump versions for release)
@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 $<
texi: $(TEXIPAGES)
info: $(INFOPAGES) dir
%.info: %.texi
@printf "Generating $@\n"
@$(MAKEINFO) --no-split $< -o $@
dir: $(INFOPAGES)
@printf "Generating dir\n"
@echo $^ | xargs -n 1 $(INSTALL_INFO) --dir=$@
authors: AUTHORS.md
AUTHORS.md:
@ printf "Authors\n=======\n\n" > $@
@ ( printf "%s\n" "- Barak A. Pearlmutter <barak+git@pearlmutter.net>" && \
printf "%s\n" "- Lele Gaifax <lele@metapensiero.it>" && \
printf "%s\n" "- Rémi Vanicat <vanicat@debian.org>" && \
git log --pretty=format:'- %aN <%aE>' \
) | sort -u >> $@
clean:
@printf "Cleaning...\n"
@rm -f $(ELCS)
define set_package_requires
(require 'dash)
(with-current-buffer (find-file-noselect "with-editor.el")
(goto-char (point-min))
(re-search-forward "^;; Package-Requires: ")
(let ((s (read (buffer-substring (point) (line-end-position)))))
(--when-let (assq 'async s) (setcdr it (list async-version)))
(--when-let (assq 'dash s) (setcdr it (list dash-version)))
(delete-region (point) (line-end-position))
(insert (format "%S" s))
(save-buffer)))
endef
export set_package_requires
#'
define set_manual_version
(let ((version (split-string "$(WITH_EDITOR_VERSION)" "\\.")))
(setq version (concat (car version) "." (cadr version)))
(with-current-buffer (find-file-noselect "with-editor.org")
(goto-char (point-min))
(re-search-forward "^#\\+SUBTITLE: for version ")
(delete-region (point) (line-end-position))
(insert version)
(save-buffer)))
endef
export set_manual_version
bump-versions: bump-versions-1 texi
bump-versions-1:
@$(BATCH) --eval "(progn\
(setq async-version \"$(ASYNC_VERSION)\")\
(setq dash-version \"$(DASH_VERSION)\")\
$$set_package_requires\
$$set_manual_version)"
|