-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
91 lines (69 loc) · 1.48 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
CLI_ARTIFACT_PATH = _build/escriptize/bin/locus
SHELL := bash
.ONESHELL:
.SHELLFLAGS := -euc
.DELETE_ON_ERROR:
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
export ERL_FLAGS = -enable-feature maybe_expr # needed for katana-code under OTP 25
## General Rules
all: compile
.PHONY: all
.NOTPARALLEL: all
compile:
@rebar3 compile
.PHONY: compile
clean:
@rebar3 clean -a
.PHONY: clean
check: xref hank-dead-code-cleaner elvis-linter dialyzer
.NOTPARALLEL: check
.PHONY: check
test: eunit ct cli
./locus check --log-level debug test/priv/GeoLite2-Country.tar.gz
.NOTPARALLEL: test
.PHONY: test
## Tests
ct:
@rebar3 do ct, cover
.PHONY: ct
eunit:
@rebar3 eunit
.PHONY: eunit
## Checks
xref:
@rebar3 xref
.PHONY: xref
hank-dead-code-cleaner:
@if rebar3 plugins list | grep '^rebar3_hank\>' >/dev/null; then \
rebar3 hank; \
else \
echo >&2 "WARN: skipping rebar3_hank check"; \
fi
.PHONY: hank-dead-code-cleaner
elvis-linter:
@if rebar3 plugins list | grep '^rebar3_lint\>' >/dev/null; then \
rebar3 lint; \
else \
echo >&2 "WARN: skipping rebar3_lint check"; \
fi
.PHONY: elvis-linter
dialyzer:
@rebar3 dialyzer
.PHONY: dialyzer
eqwalizer:
@rebar3 as eqwalizer,test compile
elp eqwalize-all
## Shell, docs and publication
shell: export ERL_FLAGS = +pc unicode
shell:
@rebar3 as shell shell
cli:
@rebar3 as escriptize escriptize
cp -p "$(CLI_ARTIFACT_PATH)" ./
doc-dry:
@rebar3 hex build
.PHONY: doc-dry
publish:
publish: doc
@rebar3 hex publish