-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
72 lines (56 loc) · 1.35 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
export INCLUDE_DIR=include
export EBIN_DIR=ebin
export LOG_DIR=log
export DRON_NODE=dron
export ERL_LIBS=lib
DRON_NODES=w1 w2 w3
REBAR=./rebar
DIALYZER=dialyzer
DIALYZER_OPTS=-Wno_return -Wrace_conditions -Wunderspecs
ERL_OPTS=-pa $(EBIN_DIR) -I $(INCLUDE_DIR) -sname $(DRON_NODE) -boot start_sasl -config dron -s dron -env ERL_MAX_ETS_TABLES 65536 -env ERL_MAX_PORTS 16384 +P256000
START_WORKERS=for worker in $(DRON_NODES) ; do \
echo "Starting worker $$worker" ; \
echo 'code:add_pathsa(["$(realpath $(EBIN_DIR))"]).' | \
erl_call -sname $$worker -s -e ; \
done
RUN=erl $(ERL_OPTS)
STOP=$(MAKE) stop_workers
STOP_WORKERS=for worker in $(DRON_NODES) ; do \
echo "Stopping worker $$worker" ; \
erl_call -sname $$worker -q ; \
done
.PHONY: all
all: deps compile
compile:
$(REBAR) compile
deps:
$(REBAR) get-deps
test:
$(REBAR) skip_deps=true eunit
doc:
$(REBAR) doc
run: compile
mkdir -p $(LOG_DIR)
$(MAKE) start_workers
DRON_WORKERS="$(DRON_WORKERS)" \
$(RUN)
$(STOP)
.PHONY: clean
clean:
rm -rf $(LOG_DIR)
rm -rf dron_coordinator_*
rm -rf dron_scheduler_*
$(REBAR) clean
rm -rf Mnesia.*
.PHONY: clean_ec2
clean_ec2:
rm -rf dron_exports
rm -rf dron_instances
.PHONY: start_workers
start_workers:
$(START_WORKERS)
.PHONY: stop_workers
stop_workers:
$(STOP_WORKERS)
analyze: compile
$(DIALYZER) $(DIALYZER_OPTS) -r ebin/