-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
92 lines (66 loc) · 1.73 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
## -*- mode: Makefile; fill-column: 80; comment-column: 67; -*-
REBAR ?= $(shell which rebar 2> /dev/null || which ./rebar)
DEPS_DIR = $(CURDIR)/deps
DIALYZER_OPTIONS := --fullpath --no_native -DDIALYZER_RUN -Wunderspecs
ERLANG_DIALYZER_APPS := compiler \
crypto \
erts \
kernel \
stdlib
DIALYZER_PLT := ./dialyzer.plt
.PHONY: default
default: compile
.PHONY: all
all: compile test doc typecheck
########################################################################
# Compilation and Dependency Management
.PHONY: compile
compile: get-deps
$(REBAR) compile
.PHONY: real-clean
real-clean: clean clean-doc clean-plt clean-deps
.PHONY: clean
clean:
$(REBAR) clean
.PHONY: clean-doc
clean-doc:
- rm -rf doc
.PHONY: clean-plt
clean-plt:
- rm -rf $(DIALYZER_PLT) $(DEPS_PLT)
.PHONY: clean-deps
clean-deps:
rm -rf deps
.PHONY: doc
doc:
$(REBAR) skip_deps=true doc
.PHONY: get-deps
get-deps:
$(REBAR) get-deps
########################################################################
# Test
.PHONY: test
test: compile xref eunit typecheck
.PHONY: eunit
eunit: compile
$(REBAR) skip_deps=true eunit -v
.PHONY: ct
ct: compile
$(REBAR) skip_deps=true ct
.PHONY: xref
xref:
$(REBAR) xref
.PHONY: typecheck
typecheck: compile $(DIALYZER_PLT)
dialyzer $(DIALYZER_OPTIONS) --plt $(DIALYZER_PLT) --src src
$(DIALYZER_PLT):
dialyzer --build_plt --apps $(ERLANG_DIALYZER_APPS) \
--output_plt $(@)
#####################################################################
# Relase
release_major: real-clean test
./bin/release.sh major
release_minor: real-clean test
./bin/release.sh minor
release: real-clean test
./bin/release.sh patch