File: Makefile

package info (click to toggle)
dash-el 2.19.1%2Bgit20220608.1.0ac1ecf%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 532 kB
  • sloc: lisp: 5,602; makefile: 39; sh: 7
file content (75 lines) | stat: -rw-r--r-- 2,116 bytes parent folder | download
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
# Makefile for Dash.

# Copyright (C) 2021 Free Software Foundation, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <https://www.gnu.org/licenses/>.

# Variables.

EMACS ?= emacs
batch := $(EMACS) -Q -batch -L .
els := dash.el dev/dash-defs.el dev/examples.el
elcs := $(addsuffix c,$(els))
docs := README.md dash.texi
tmpls := readme-template.md dash-template.texi $(wildcard doc/*.texi)

# Targets.

lisp: $(elcs)
.PHONY: lisp

docs: $(docs)
.PHONY: docs

force-docs: maintainer-clean docs
.PHONY: force-docs

# ERT_SELECTOR is a Lisp expression determining which tests to run.
# Its format is described in (info "(ert) Test Selectors").  It
# defaults to selecting all tests.  Note that in batch mode, a nil
# selector is the same as t.
check: ERT_SELECTOR ?= t
check: run := '(ert-run-tests-batch-and-exit (quote $(ERT_SELECTOR)))'
check: lisp
	EMACS_TEST_VERBOSE=1 $(batch) -l dev/examples -eval $(run)
.PHONY: check

all: lisp docs check
.PHONY: all

force-all: maintainer-clean lisp docs check
.PHONY: force-all

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

maintainer-clean: ver := 26
maintainer-clean: msg := Doc regeneration requires $(ver)+
maintainer-clean: clean
	$(batch) -eval '(if (< emacs-major-version $(ver)) (error "$(msg)"))'
	$(RM) $(docs)
.PHONY: maintainer-clean

# Files.

%.elc: WERROR := '(setq byte-compile-error-on-warn t)'
%.elc: %.el
	$(batch) -eval $(WERROR) -f batch-byte-compile $<

$(docs) &: $(elcs) $(tmpls)
	$(batch) -l dev/examples -f dash-make-docs

dev/dash-defs.elc: dash.elc
dev/examples.elc: dash.elc dev/dash-defs.elc