forked from nitrogen/simple_bridge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
executable file
·115 lines (79 loc) · 2.79 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
BACKEND:=inets
all: compile
get-deps:
./rebar get-deps
compile: get-deps
./rebar compile
clean: clean-deps
./rebar --config "rebar.$(BACKEND).config" clean
clean-deps:
rm -fr deps/*
platform: clean
(escript rebar_deps/merge_deps.escript rebar.config rebar_deps/$(BACKEND).deps rebar.$(BACKEND).config)
(./rebar --config "rebar.$(BACKEND).config" get-deps)
(./rebar --config "rebar.$(BACKEND).config" compile)
(rm -f rebar.$(BACKEND).config)
run_cowboy:
(make platform run BACKEND=cowboy)
run_elli:
(make platform run BACKEND=elli)
run_inets:
(make platform run BACKEND=inets)
run_mochiweb:
(make platform run BACKEND=mochiweb)
run_webmachine:
(make platform run BACKEND=webmachine)
run_yaws:
(make platform run BACKEND=yaws)
run:
erl -pa ebin/ -pa deps/*/ebin \
-config etc/simple_bridge.config \
-simple_bridge backend $(BACKEND) \
-eval "application:start(simple_bridge)"
##### COMMON TEST
test: test_cowboy test_inets test_mochiweb test_webmachine test_yaws
## Cowboy doesn't support <= Erlang 16
test_nocowboy: test_inets test_mochiweb test_webmachine test_yaws
test_cowboy:
(make test_core BACKEND=cowboy)
test_inets:
(make test_core BACKEND=inets)
test_mochiweb:
(make test_core BACKEND=mochiweb)
test_webmachine:
(make test_core BACKEND=webmachine)
test_yaws:
(make test_core BACKEND=yaws)
clean_test:
(rm -f rebar.test.*.config)
test_core: clean clean_test
(escript rebar_deps/merge_deps.escript rebar.test.config rebar_deps/$(BACKEND).deps rebar.test.$(BACKEND).config)
(cd test; sed "s/BACKEND/$(BACKEND)/" < app.config.src > app.config)
./rebar --config "rebar.test.$(BACKEND).config" get-deps
./rebar --config "rebar.test.$(BACKEND).config" compile
./rebar --config "rebar.test.$(BACKEND).config" skip_deps=true ct
DEPS_PLT=$(CURDIR)/.deps_plt
DEPS=erts kernel stdlib crypto sasl
# removed 'sasl' in attempt to minimize memory usage for Travis
$(DEPS_PLT):
@echo Building local plt at $(DEPS_PLT)
@echo
@## We don't do -r ./deps for this at least until we have a separate
@## dialyzer test for each backend, mostly because webmachine's mochiweb
@## version and mochiweb 2.9 conflict.
@(dialyzer --output_plt $(DEPS_PLT) --build_plt --apps $(DEPS))
dialyzer: $(DEPS_PLT)
@(dialyzer --fullpath --plt $(DEPS_PLT) -Wrace_conditions -r ./ebin)
dialyzer-no-race: $(DEPS_PLT)
@(dialyzer --fullpath --plt $(DEPS_PLT) -r ./ebin)
# TRAVIS-CI STUFF
ERLANG_VERSION_CHECK := erl -eval "io:format(\"~s\",[erlang:system_info(otp_release)]), halt()." -noshell
ERLANG_VERSION = $(shell $(ERLANG_VERSION_CHECK))
# This is primarily for Travis build testing, as each build instruction will overwrite the previous
travis: compile $(ERLANG_VERSION)
R15B: dialyzer test_nocowboy
R15B03: dialyzer test_nocowboy
R16B: dialyzer test
R16B03-1: dialyzer test
17: dialyzer test
18: dialyzer test