-
-
Notifications
You must be signed in to change notification settings - Fork 120
/
Makefile
80 lines (63 loc) · 1.49 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
REBAR=./rebar
.PHONY: all clean distclean
all: deps
$(REBAR) compile
deps:
$(REBAR) get-deps
clean::
$(REBAR) clean
rm -rf priv/www
distclean::
rm -rf deps priv ebin
# **** serve ****
.PHONY: serve
SERVE_SCRIPT=./examples/cowboy_test_server.erl
serve:
@if [ -e .pidfile.pid ]; then \
kill `cat .pidfile.pid`; \
rm .pidfile.pid; \
fi
@while [ 1 ]; do \
$(REBAR) compile && ( \
echo " [*] Running erlang"; \
$(SERVE_SCRIPT) & \
SRVPID=$$!; \
echo $$SRVPID > .pidfile.pid; \
echo " [*] Pid: $$SRVPID"; \
); \
inotifywait -r -q -e modify src/*erl examples/*erl src/*hrl; \
test -e .pidfile.pid && kill `cat .pidfile.pid`; \
rm -f .pidfile.pid; \
sleep 0.1; \
done
# **** dialyzer ****
.dialyzer_generic.plt:
dialyzer \
--build_plt \
--output_plt .dialyzer_generic.plt \
--apps erts kernel stdlib compiler sasl os_mon mnesia \
tools public_key crypto ssl
.dialyzer_sockjs.plt: .dialyzer_generic.plt
dialyzer \
--no_native \
--add_to_plt \
--plt .dialyzer_generic.plt \
--output_plt .dialyzer_sockjs.plt -r deps/*/ebin
distclean::
rm -f .dialyzer_sockjs.plt
dialyze: .dialyzer_sockjs.plt
@dialyzer \
--plt .dialyzer_sockjs.plt \
--no_native \
--fullpath \
-Wrace_conditions \
-Werror_handling \
-Wunmatched_returns \
ebin
.PHONY: xref
xref:
$(REBAR) xref | egrep -v unused
# **** release ****
# 1. Commit
# 2. Bump version in "src/sockjs.app.src"
# 3. git tag -s "vx.y.z" -m "Release vx.y.z"