forked from epgsql/pooler
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
80 lines (59 loc) · 1.89 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
ERLFLAGS= -pa $(CURDIR)/.eunit -pa $(CURDIR)/ebin -pa $(CURDIR)/deps/*/ebin
DEPS_PLT=$(CURDIR)/.deps_plt
# =============================================================================
# Verify that the programs we need to run are installed on this system
# =============================================================================
ERL = $(shell which erl)
ifeq ($(ERL),)
$(error "Erlang not available on this system")
endif
REBAR=$(shell which rebar)
# If building on travis, use the rebar in the current directory
ifeq ($(TRAVIS),true)
REBAR=$(CURDIR)/rebar
endif
ifeq ($(REBAR),)
REBAR=$(CURDIR)/rebar
endif
.PHONY: all compile test dialyzer clean distclean doc
all: compile test dialyzer
REBAR_URL=https://github.com/rebar/rebar/wiki/rebar
$(REBAR):
curl -Lo rebar $(REBAR_URL) || wget $(REBAR_URL)
chmod a+x rebar
get-rebar: $(REBAR)
compile: $(REBAR)
$(REBAR) compile
eunit: compile clean-common-test-data
$(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/ \
-cover cover.spec
test: compile dialyzer eunit ct
$(DEPS_PLT): compile
@echo Building local erts plt at $(DEPS_PLT)
@echo
$(DIALYZER) --output_plt $(DEPS_PLT) --build_plt \
--apps erts kernel stdlib -r deps
dialyzer: compile $(DEPS_PLT)
@dialyzer -Wunderspecs -r ebin
doc:
$(REBAR) doc skip_deps=true
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 $(REBAR)
- rm -rf $(CURDIR)/test/*.beam
- rm -rf $(CURDIR)/logs
- rm -rf $(CURDIR)/ebin
$(REBAR) skip_deps=true clean
distclean: clean
- rm -rf $(DEPS_PLT)
$(REBAR) delete-deps
demo_shell: compile test
@erl -pa .eunit ebin -config pooler-example -s pooler manual_start