-
Notifications
You must be signed in to change notification settings - Fork 102
/
Makefile
153 lines (123 loc) · 3.26 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
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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
## Common
.PHONY: test
-include config.mk
all: lisp
PKG = rustic
EMACS ?= emacs
EMACS_ARGS ?=
ELS = rustic.el
ELS += rustic-racer.el
ELS += rustic-flycheck.el
ELS += rustic-interaction.el
ELS += rustic-compile.el
ELS += rustic-cargo.el
ELS += rustic-clippy.el
ELS += rustic-popup.el
ELS += rustic-rustfix.el
ELS += rustic-rustfmt.el
ELS += rustic-babel.el
ELS += rustic-lsp.el
ELS += rustic-flycheck.el
ELS += rustic-doc.el
ELCS = $(ELS:.el=.elc)
rustic.elc:
rustic-racer.elc: rustic.elc
rustic-flycheck.elc: rustic.elc
rustic-interaction.elc: rustic.elc
rustic-compile.elc: rustic.elc
rustic-cargo.elc: rustic-compile.elc rustic-interaction.elc
rustic-clippy.elc: rustic-compile.elc
rustic-popup.elc: rustic-cargo.elc
rustic-rustfix.elc: rustic-cargo.elc
rustic-rustfmt.elc: rustic-cargo.elc
rustic-babel.elc: rustic-rustfmt.elc
rustic-lsp.elc: rustic-rustfmt.elc
rustic-playground.elc:
rustic-doc.elc:
## Without Cask
ifdef WITHOUT_CASK
DEPS = company
DEPS += dash
DEPS += f
DEPS += flycheck
DEPS += eglot
DEPS += helm-ag
DEPS += ht
DEPS += hydra
DEPS += lsp-mode
DEPS += lsp-mode/clients
DEPS += lv
DEPS += markdown-mode
DEPS += org/lisp
DEPS += projectile
DEPS += s
DEPS += spinner
DEPS += xterm-color
DEPS += yasnippet
DEPS += rust-mode
LOAD_PATH ?= $(addprefix -L ../,$(DEPS))
LOAD_PATH += -L .
TEST_ELS = test/test-helper.el
TEST_ELS += $(wildcard test/rustic-*-test.el)
TEST_ELCS = $(TEST_ELS:.el=.elc)
lisp: $(ELCS) loaddefs
%.elc: %.el
@printf "Compiling $<\n"
@$(EMACS) -Q --batch $(EMACS_ARGS) $(LOAD_PATH) \
--funcall batch-byte-compile $<
test-lisp: $(TEST_ELCS)
test/%.elc: test/%.el
@printf "Compiling $<\n"
@$(EMACS) -Q --batch $(EMACS_ARGS) $(LOAD_PATH) -L test \
--load $(CURDIR)/test/test-helper \
--funcall batch-byte-compile $<
test: $(TEST_ELCS)
@$(EMACS) -Q --batch $(EMACS_ARGS) $(LOAD_PATH) -L test \
--load $(CURDIR)/test/test-helper \
$(addprefix -l ,$(TEST_ELS)) \
--funcall ert-run-tests-batch-and-exit
## With Cask
else
CASK_DIR := $(shell EMACS=$(EMACS) cask package-directory)
$(CASK_DIR): Cask
EMACS=$(EMACS) cask install
touch $(CASK_DIR)
cask-install: $(CASK_DIR)
cask-build: loaddefs
EMACS=$(EMACS) cask build
lisp: clean cask-install cask-build
test: lisp
if [ -f "$(HOME)/.cargo/env" ] ; then . "$(HOME)/.cargo/env" ; fi ; \
EMACS=$(EMACS) cask exec ert-runner --reporter ert
## Common
endif
CLEAN = $(ELCS) $(PKG)-autoloads.el $(TEST_ELCS)
clean:
@printf "Cleaning...\n"
@rm -rf $(CLEAN)
loaddefs: $(PKG)-autoloads.el
define LOADDEFS_TMPL
;;; $(PKG)-autoloads.el --- automatically extracted autoloads
;;
;;; Code:
(add-to-list 'load-path (directory-file-name \
(or (file-name-directory #$$) (car load-path))))
;; Local Variables:
;; version-control: never
;; no-byte-compile: t
;; no-update-autoloads: t
;; End:
;;; $(PKG)-autoloads.el ends here
endef
export LOADDEFS_TMPL
#'
$(PKG)-autoloads.el: $(ELS)
@printf "Generating $@\n"
@printf "%s" "$$LOADDEFS_TMPL" > $@
@$(EMACS) -Q --batch --eval "(progn\
(setq make-backup-files nil)\
(setq vc-handled-backends nil)\
(setq default-directory (file-truename default-directory))\
(setq generated-autoload-file (expand-file-name \"$@\"))\
(setq find-file-visit-truename t)\
(update-directory-autoloads default-directory))"