forked from lasp-lang/lasp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
142 lines (104 loc) · 3.5 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
PACKAGE ?= lasp
VERSION ?= $(shell git describe --tags)
BASE_DIR = $(shell pwd)
ERLANG_BIN = $(shell dirname $(shell which erl))
REBAR = $(shell pwd)/rebar3
MAKE = make
.PHONY: rel deps test plots dcos logs
all: compile
##
## Compilation targets
##
compile:
$(REBAR) compile
clean: packageclean
$(REBAR) clean
packageclean:
rm -fr *.deb
rm -fr *.tar.gz
##
## Test targets
##
check: test xref dialyzer
test: ct eunit ad-counter-simulations game-tournament-simulations
lint:
${REBAR} as lint lint
eunit:
${REBAR} eunit
ct:
${REBAR} ct --suite=lasp_SUITE
ad-counter-simulations: client-server-ad-counter-simulation peer-to-peer-ad-counter-simulation ad-counter-overcounting ad-counter-partition-overcounting
game-tournament-simulations: client-server-game-tournament-simulation peer-to-peer-game-tournament-simulation
peer-to-peer-ad-counter-simulation:
${REBAR} ct --suite=lasp_peer_to_peer_advertisement_counter_SUITE
client-server-ad-counter-simulation:
${REBAR} ct --suite=lasp_client_server_advertisement_counter_SUITE
ad-counter-overcounting:
#${REBAR} ct --suite=lasp_advertisement_counter_overcounting_SUITE
ad-counter-partition-overcounting:
${REBAR} ct --suite=lasp_advertisement_counter_partition_overcounting_SUITE
peer-to-peer-game-tournament-simulation:
${REBAR} ct --suite=lasp_peer_to_peer_game_tournament_SUITE
client-server-game-tournament-simulation:
${REBAR} ct --suite=lasp_client_server_game_tournament_SUITE
peer-to-peer-throughput-simulation:
${REBAR} ct --suite=lasp_peer_to_peer_throughput_SUITE
client-server-throughput-simulation:
${REBAR} ct --suite=lasp_client_server_throughput_SUITE
client-server-divergence-simulation:
${REBAR} as test ct --suite=lasp_client_server_divergence_SUITE
##
## Release targets
##
rel:
${REBAR} as exp release
stage:
${REBAR} as exp release -d
##
## Packaging targets
##
package: rel
fpm -s dir -t deb -n $(PACKAGE) -v $(VERSION) \
--deb-user $(PACKAGE) \
--deb-group $(PACKAGE) \
--before-install=rel/before-install \
_build/exp/rel/$(PACKAGE)=/opt/ \
rel/init=/etc/init.d/$(PACKAGE) \
rel/var/lib/$(PACKAGE)/=/var/lib/$(PACKAGE)/ \
rel/var/log/$(PACKAGE)/=/var/log/$(PACKAGE)/ \
rel/etc/$(PACKAGE)/$(PACKAGE).config=/etc/$(PACKAGE)/$(PACKAGE).config \
rel/etc/default/$(PACKAGE)=/etc/default/$(PACKAGE)
package_cloud:
docker build -f Dockerfiles/packager -t cmeiklejohn/packager .
docker run -i -t -v ~/.packagecloud:/root/.packagecloud cmeiklejohn/packager
cut:
${REBAR} as package hex cut
publish:
${REBAR} as package hex publish
shell:
${REBAR} shell --apps lasp
##
## Evaluation related targets
##
plots:
pkill -9 beam.smp; \
clear; \
rm -rf priv/lager/ priv/evaluation; \
(cd priv/ && git clone https://github.com/lasp-lang/evaluation); \
./rebar3 ct --readable=false --suite=test/lasp_peer_to_peer_advertisement_counter_SUITE; \
./rebar3 ct --readable=false --suite=test/lasp_client_server_advertisement_counter_SUITE; \
cd priv/evaluation && make plots
div:
pkill -9 beam.smp; \
clear; \
./rebar3 ct --readable=false --suite=test/lasp_advertisement_counter_overcounting_SUITE
part-div:
pkill -9 beam.smp; \
clear; \
./rebar3 ct --readable=false --suite=test/lasp_advertisement_counter_partition_overcounting_SUITE
logs:
tail -F priv/lager/*/log/*.log
DIALYZER_APPS = kernel stdlib erts sasl eunit syntax_tools compiler crypto
crdt-tutorial: stage
tmux -f tmux.conf kill-server; tmux -f tmux.conf start-server; tmux -f tmux.conf attach -d -t lasp
include tools.mk