-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
56 lines (45 loc) · 1.32 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
CASK ?= cask
EMACS ?= emacs
VERSION := $(shell EMACS=$(EMACS) $(CASK) version)
PKG_DIR := $(shell EMACS=$(EMACS) $(CASK) package-directory)
SRC = $(wildcard *.el)
PACKAGE = dist/swift3-mode-$(VERSION).tar
.PHONY: help all deps package install test clean
help:
## Shows this message.
# Process this Makefile with following filters
#
# - Remove empty line.
# - Remove lien containing ## no-doc.
# - Remove after colon if the line is not a comment line.
# - Replace /^## / to " ".
# - Remove other comment lines.
# - Insert newline before rules.
@sed -e '/^\s*$$/d; /^[ .A-Z]/d; /## no-doc/d; s/^\([^#][^:]*\):.*/\1/; s/^## / /; /^#/d; s/^[^ ]/\n&/' Makefile
all: package
## Builds the package.
$(PKG_DIR): ## no-doc
$(CASK) install
deps: $(PKG_DIR)
## Installs the dependencies.
$(PACKAGE): $(SRC) deps ## no-doc
rm -rf dist
$(CASK) package
package: $(PACKAGE)
## Builds the package.
install: package
## Installs the package.
$(CASK) exec $(EMACS) --batch \
-l package \
-f package-initialize \
--eval '(package-install-file "$(PACKAGE)")'
clean:
## Cleans the dist directory.
rm -rf dist
check: deps
## Tests the package.
$(CASK) exec $(EMACS) --batch -q \
--eval "(add-to-list 'load-path \""$(shell realpath .)"\")" \
-l swift3-mode.el \
-l test/swift3-mode-test-indent.el \
-f swift3-mode:run-test:indent