-
Notifications
You must be signed in to change notification settings - Fork 12
/
sandbox.mk
77 lines (53 loc) · 1.21 KB
/
sandbox.mk
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
ERL = $(shell which erl)
ifeq ($(ERL),)
$(error "Erlang not available on this system")
endif
REBAR_URL=https://s3.amazonaws.com/rebar3/rebar3
REBAR = $(shell pwd)/rebar3
DEPS_PLT=$(CURDIR)/.deps_plt
DEPS=erts kernel stdlib
# export QUIET:=1
# export DEBUG:=1
export REBAR_COLOR:="low"
# use to override vars for your platform
ifeq (env.mk,$(wildcard env.mk))
include env.mk
endif
.PHONY: deps tests
all: $(REBAR) compile
compile: $(REBAR)
$(REBAR) compile
tests: start_epmd $(REBAR)
$(REBAR) as test ct --spec ./test/spec.spec
tests_cover: start_epmd
$(REBAR) as test ct --spec ./test/spec.spec --cover
cover:
@$(REBAR) cover
@xdg-open "_build/test/cover/index.html"
lint:
$(REBAR) as lint lint
xref:
$(REBAR) as prod xref skip_deps=true
dialyzer:
$(REBAR) dialyzer skip_deps=true
deps:
$(REBAR) deps
clean:
$(REBAR) clean
prod: $(REBAR)
$(REBAR) as prod release
rel: compile
$(REBAR) release
run: rel
$(REBAR) run
auto:
$(REBAR) auto
attach:
$(ERL) -name a@127.0.0.1 -remsh dev@127.0.0.1 -setcookie dev
$(REBAR):
curl -Lo rebar3 $(REBAR_URL) || wget $(REBAR_URL)
chmod a+x rebar3
upgrade_rebar:
$(REBAR) local upgrade
start_epmd:
@/bin/sh -c 'if ! pgrep -x epmd > /dev/null ; then epmd -daemon; fi'