Skip to content

Commit e2f13d6

Browse files
committed
copy from cask documentatin
1 parent 4e21bff commit e2f13d6

File tree

1 file changed

+13
-20
lines changed

1 file changed

+13
-20
lines changed

Makefile

+13-20
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,21 @@
11
THIS_MAKEFILE_DIR = $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
2-
EMACS ?= emacs
3-
SRC=org-gcal.el org-generic-id.el
4-
TEST=test/org-gcal-test.el test/org-generic-id-test.el
5-
BUILD_LOG = build.log
6-
CASK ?= cask
7-
PKG_DIR := $(shell $(CASK) package-directory)
8-
ELCFILES = $(SRC:.el=.elc)
9-
.DEFAULT_GOAL := all
102

11-
.PHONY: all clean load-path compile test elpa
3+
export EMACS ?= $(shell command -v emacs 2>/dev/null)
4+
CASK_DIR := $(shell cask package-directory)
125

13-
all: compile test
6+
$(CASK_DIR): Cask
7+
cask install
8+
@touch $(CASK_DIR)
149

15-
clean:
16-
rm -f $(ELCFILES) $(BUILD_LOG); rm -rf $(PKG_DIR)
10+
.PHONY: cask
11+
cask: $(CASK_DIR)
1712

18-
elpa: $(PKG_DIR)
19-
$(PKG_DIR): Cask
20-
$(CASK) install
21-
touch $(PKG_DIR)
22-
23-
compile: $(SRC) elpa
24-
$(CASK) build 2>&1 | tee $(BUILD_LOG); \
25-
! ( grep -E -e ':(Warning|Error):' $(BUILD_LOG) )
13+
.PHONY: compile
14+
compile: cask
15+
cask emacs -batch -L . -L test \
16+
--eval "(setq byte-compile-error-on-warn t)" \
17+
-f batch-byte-compile $$(cask files); \
18+
(ret=$$? ; cask clean-elc && exit $$ret)
2619

2720
test: $(SRC) $(TEST) elpa
2821
$(CASK) exec ert-runner -L $(THIS_MAKEFILE_DIR) \

0 commit comments

Comments
 (0)