forked from rpip/fakerl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·79 lines (60 loc) · 1.85 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
APPNAME = fakerl
DIALYZER = dialyzer
ERL = $(shell which erl)
ERLFLAGS= -pa $(CURDIR)/.eunit -pa $(CURDIR)/ebin -pa $(CURDIR)/deps/*/ebin -s $(APPNAME)
REBAR = ./rebar $(REBAR_ARGS)
REBAR_URL := https://github.com/rebar/rebar/wiki/rebar
.PHONY: all compile docs clean tests build-plt dialyze shell distclean pdf \
update-deps rebuild
# ================================================================
# Verify that porgrames needed by this Makefile are available
# ================================================================
ifeq ($(ERL),)
$(error "Erlang not running on this system")
endif
# ==============================================================
# Make build rules
# ==============================================================
all: app
app: rebar deps
@$(REBAR) compile
deps:
@$(REBAR) get-deps
$(REBAR) compile
update-deps:
$(REBAR) update-deps
$(RENDER) compile
compile:
$(REBAR) skip_deps=true compile
clean:
- rm -rf $(CURDIR)/test/*.beam
- rm -rf $(CURDIR)/ebin
- rm -rf $(CURDIR)/*.dump
$(REBAR) skip_deps=true clean
distclean: clean
- rm -rvf $(CURDIR)/deps
- rm -rf $(CURDIR)/doc/*
tests: REBAR_ARGS = -C rebar.test.config
tests: clean app eunit ct
eunit: compile clean
@$(REBAR) eunit skip_deps=true
ct:
@$(REBAR) ct skip_deps=true
build-plt:
@$(DIALYZER) --build_plt --output_plt .$(APPNAME)_dialyzer.plt \
--apps kernel stdlib sasl inets crypto public_key ssl
dialyze:
@$(DIALYZER) --src src --plt .$(APPNAME)_dialyzer.plt --no_native \
-Werror_handling -Wrace_conditions -Wunmatched_returns # -Wunderspecs
docs:
@$(REBAR) doc skip_deps=true
pdf:
pandoc README.md -o README.pdf
shell: deps compile
- @$(REBAR) skip-deps=true eunit
@$(ERL) $(ERLFLAGS)
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