-
Notifications
You must be signed in to change notification settings - Fork 2
/
GNUmakefile
70 lines (54 loc) · 1.4 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
63
64
65
66
67
68
69
70
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)", []}, [], [{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
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) xref
test: $(REBAR)
$(REBAR) $(REBAR_OPTS) ct
$(REBAR) as test proper -n 1
# 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
##
## Doc targets
##
docs: $(REBAR)
$(REBAR) edoc
edoc_private: $(REBAR)
$(REBAR) as edoc_private edoc
exdoc: $(REBAR)
$(REBAR) ex_doc --logo doc/img/logo.png --output edoc