-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
93 lines (69 loc) · 2.21 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
81
82
83
84
85
86
87
88
89
90
91
92
93
# Copyright 2013 Erlware, LLC. All Rights Reserved.
#
# BSD License see COPYING
ERL = $(shell which erl)
ERL_VER = $(shell erl -eval 'erlang:display(erlang:system_info(otp_release)), halt().' -noshell)
ERLFLAGS= -pa $(CURDIR)/.eunit -pa $(CURDIR)/ebin -pa $(CURDIR)/*/ebin
REBAR=$(shell which rebar)
ifeq ($(REBAR),)
#$(error "Rebar not available on this system, try running make get-rebar")
REBAR=$(CURDIR)/rebar
endif
ERLWARE_COMMONS_PLT=$(CURDIR)/.erlware_commons_plt
DEPS_PLT=$(CURDIR)/.depsolver_plt
.PHONY: all compile doc clean test shell distclean pdf get-deps rebuild #dialyzer typer #fail on Travis.
all: deps compile
$(REBAR):
wget https://github.com/rebar/rebar/wiki/rebar
chmod a+x rebar
get-rebar: $(REBAR)
deps:
$(REBAR) get-deps
$(REBAR) compile
get-deps: $(REBAR)
$(REBAR) get-deps
$(REBAR) compile
compile: $(REBAR)
$(REBAR) compile
doc: compile
- $(REBAR) skip_deps=true doc
eunit: compile
$(REBAR) skip_deps=true eunit
ct: compile clean-common-test-data
mkdir -p $(CURDIR) logs
ct_run -pa $(CURDIR)/ebin \
-pa $(CURDIR)/deps/*/ebin \
-logdir $(CURDIR)/logs \
-dir $(CURDIR)/test/ \
-suite basic_SUITE
$(DEPS_PLT):
@echo Building local erts plt at $(DEPS_PLT)
@echo
dialyzer --output_plt $(DEPS_PLT) --build_plt \
--apps erts kernel stdlib -r deps
dialyzer: $(DEPS_PLT)
dialyzer --fullpath --plt $(DEPS_PLT) \
-Wrace_conditions -r ./ebin | fgrep -v -f ./dialyzer.ignore-warnings
shell: compile
# You often want *rebuilt* rebar tests to be available to the
# shell you have to call eunit (to get the tests
# rebuilt). However, eunit runs the tests, which probably
# fails (thats probably why You want them in the shell). This
# runs eunit but tells make to ignore the result.
./bin/dikdik
clean-common-test-data:
# We have to do this because of the unique way we generate test
# data. Without this rebar eunit gets very confused
- rm -rf $(CURDIR)/test/*_SUITE_data
clean: clean-common-test-data
- rm -rf $(CURDIR)/test/*.beam
- rm -rf $(CURDIR)/logs
- rm -rf $(CURDIR)/ebin
$(REBAR) skip_deps=true clean
distclean: clean
- rm -rf $(DEPS_PLT)
- rm -rvf $(CURDIR)/deps/*
clean-deps: clean
rm -rvf $(CURDIR)/deps/*
rm -rf $(ERLWARE_COMMONS_PLT).$(ERL_VER)
rebuild: clean-deps get-deps all ct