-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
76 lines (51 loc) · 1.38 KB
/
Makefile
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
project_root := $(CURDIR)
cask_install_path := $(project_root)/cask-repository
emacs ?= emacs
cask ?= CASK_EMACS=$(emacs) \
EMACSLOADPATH=$(project_root):$(EMACSLOADPATH) \
$(cask_install_path)/bin/cask
casked_emacs := $(cask) emacs
git ?= git
markdown ?= markdown
all: compile clean
.PHONY: all
el = $(wildcard *.el)
elc = $(el:%.el=%.elc)
clean:
$(RM) $(elc)
#####################################
# Testing
.PHONY: test compile info
test: compile info
compile: $(elc)
$(elc): %.elc: %.el
$(casked_emacs) -batch -q -f batch-byte-compile $<
elisp_get_file_package_info := \
(lambda (f) \
(with-temp-buffer \
(insert-file-contents-literally f) \
(package-buffer-info)))
elisp_print_infos := \
(mapc \
(lambda (f) \
(message \"Loading info: %s\" f) \
(message \"%S\" (funcall $(elisp_get_file_package_info) f))) \
command-line-args-left)
info: $(el)
$(casked_emacs) -batch -Q \
--eval "(require 'package)" \
--eval "$(elisp_print_infos)" \
$^
elpa:
$(cask) exec bin/github-elpa update
args ?=
run:
$(cask) exec bin/github-elpa $(args)
##############################
cask_repository := https://github.com/cask/cask.git
cask_version := v0.8.4
install-cask:
test -d $(cask_install_path) || $(git) clone $(cask_repository) $(cask_install_path)
cd $(cask_install_path) && $(git) checkout -f $(cask_version) && $(git) clean -xdf
cask-install:
$(cask) install