-
Notifications
You must be signed in to change notification settings - Fork 14
/
GNUmakefile
62 lines (47 loc) · 1.29 KB
/
GNUmakefile
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
ERL ?= erl
ERLC ?= $(ERL)c
# Erlang Rebar downloading
# see: https://groups.google.com/forum/?fromgroups=#!topic/erlang-programming/U0JJ3SeUv5Y
REBAR := ./rebar3
REBAR_URL := https://s3.amazonaws.com/rebar3/rebar3
REBAR_OPTS ?=
# Default target - update sources and call all compile rules in succession
.PHONY: all
all: compile
$(REBAR):
$(ERL) -noshell -s inets -s ssl \
-eval '{ok, saved_to_file} = httpc:request(get, {"$(REBAR_URL)", []}, [{ssl, [ {verify, verify_none} ]}], [{stream, "$(REBAR)"}])' \
-s init stop
chmod +x $(REBAR)
# Use Rebar to get, update and compile dependencies
.PHONY: upgrade-deps compile compile shell dialyzer xref test edoc
upgrade-deps: $(REBAR)
$(REBAR) $(REBAR_OPTS) upgrade
compile: $(REBAR)
$(REBAR) $(REBAR_OPTS) compile
shell: $(REBAR) compile
$(REBAR) $(REBAR_OPTS) shell
dialyzer: $(REBAR)
$(REBAR) dialyzer
xref: $(REBAR)
$(REBAR) as test xref
test: $(REBAR)
$(REBAR) as test ct
$(REBAR) as test eunit
edoc: $(REBAR)
$(REBAR) ex_doc
# Cleaning
.PHONY: clean_logs
clean_logs:
@echo "deleting logs:"
rm -f erl_crash.dump
rm -rf priv/log/*
.PHONY: clean
clean: clean_logs $(REBAR)
@echo "removing:"
@echo "cleaning ebin:"
$(REBAR) $(REBAR_OPTS) clean
.PHONY: dist-clean
dist-clean: clean
$(REBAR) $(REBAR_OPTS) clean -a
rm -f ./rebar3