-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
44 lines (36 loc) · 1.18 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
THIS_MAKEFILE_DIR = $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
EMACS ?= emacs
SRC=oauth2-auto.el
TEST=
BUILD_LOG = build.log
CASK ?= cask
PKG_DIR := $(shell $(CASK) package-directory)
ELCFILES = $(SRC:.el=.elc)
.DEFAULT_GOAL := all
.PHONY: all clean load-path compile test test-checkdoc test-unit elpa
# Remove test target until tests are implemented.
all: compile test
clean:
rm -f $(ELCFILES) $(BUILD_LOG); rm -rf $(PKG_DIR)
elpa: $(PKG_DIR)
$(PKG_DIR): Cask
$(CASK) install
touch $@
compile: $(SRC) elpa
$(CASK) build 2>&1 | tee $(BUILD_LOG); \
! ( grep -E -e ':(Warning|Error):' $(BUILD_LOG) )
# Remove test-unit target until unit tests are implemented.
test: test-checkdoc
test-checkdoc: $(SRC) elpa compile
FILES="$(SRC)" $(CASK) eval '\
(let* ((files (split-string (getenv "FILES") " "))) \
(dolist (file files) \
(let ((pkg (intern-soft (file-name-base file)))) \
(require pkg) \
(checkdoc-file file))) \
(when (get-buffer "*Warnings*") \
(kill-emacs 1)))'
test-unit: $(SRC) $(TEST) elpa
echo Tests not yet implemented; exit 1; \
$(CASK) exec ert-runner -L $(THIS_MAKEFILE_DIR) \
$(foreach test,$(TEST),$(addprefix $(THIS_MAKEFILE_DIR)/,$(test)))