-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
65 lines (44 loc) · 1.42 KB
/
Copy pathMakefile
File metadata and controls
65 lines (44 loc) · 1.42 KB
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
# Makefile for namespace.el
# Copyright (C) 2014 Helmut Eller
# SPDX-License-Identifier: GPL-3.0-or-later
help:
@printf "\
Main targets\n\
all -- compile namespace.el\n\
check -- run tests\n\
clean -- delete generated files\n\
install -- install ELPA package\n\
uninstall -- uninstall ELPA package\n\
help -- print this message\n"
ELFILES := namespace.el cl-ns.el namespace-tools.el namespace-test.el
ELCFILES := $(ELFILES:.el=.elc)
EMACS := emacs
all: $(ELCFILES)
%.elc: %.el
$(EMACS) --batch -L . -f batch-byte-compile $<
RUNTESTS = $(EMACS) --batch -L . -l $(1) -f ert-run-tests-batch-and-exit
check: $(ELCFILES)
$(call RUNTESTS,namespace-test.elc)
$(call RUNTESTS,namespace-test.el)
clean:
find . -maxdepth 1 \
-regex '.*\(\.elc\|\.tar\|-pkg\.el\)$$' \
-exec rm -v {} \;
PKGFILES := $(ELFILES) namespace-pkg.el README.org
VERSION := $(shell awk '/^;; Version: [0-9.]+/ { print $$3 }' namespace.el)
TARDIR := namespace-$(VERSION)
PKGTAR := $(TARDIR).tar
$(PKGTAR): $(PKGFILES)
mkdir -p $(TARDIR)
cp $(PKGFILES) $(TARDIR)
tar -cvf $@ $(TARDIR)
rm -r $(TARDIR)
DOCSTRING := Namespaces for Emacs Lisp
namespace-pkg.el:
echo '(define-package "namespace" "$(VERSION)" "$(DOCSTRING)")' >$@
.INTERMEDIATE: $(PKGTAR) namespace-pkg.el
install: $(PKGTAR)
$(EMACS) -batch -eval '(package-install-file "$(PKGTAR)")'
uninstall:
rm -vr ~/.emacs.d/elpa/namespace-$(VERSION)
# Makefile ends here