This repository has been archived by the owner on Sep 28, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 71
/
Makefile
157 lines (115 loc) · 3.64 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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
PACKAGE ?= lasp
VERSION ?= $(shell git describe --tags)
BASE_DIR = $(shell pwd)
ERLANG_BIN = $(shell dirname $(shell which erl))
REBAR ?= rebar3
VERSION = "0.8.2"
MAKE = make
.PHONY: rel deps test plots dcos logs fpm
all: compile
##
## Compilation targets
##
compile:
$(REBAR) compile
clean: packageclean
$(REBAR) clean
packageclean:
rm -fr *.deb
rm -fr *.tar.gz
##
## Test targets
##
kill:
pkill -9 beam.smp; \
pkill -9 epmd; \
exit 0
check: kill 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} release
stage:
${REBAR} release -d
exp-rel:
${REBAR} as exp release
exp-stage:
${REBAR} as exp release -d
##
## Packaging targets
##
fpm:
gem install --no-ri --no-rdoc fpm
package: rel fpm
fpm -s dir -t deb -n $(PACKAGE) -v $(VERSION) \
--deb-user $(PACKAGE) \
--deb-group $(PACKAGE) \
--before-install=rel/before-install \
_build/default/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: package
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 --name lasp@localhost
##
## 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
tail-logs:
tail -F priv/lager/*/*/log/*.log
logs:
cat priv/lager/*/*/log/*.log
DIALYZER_APPS = kernel stdlib erts sasl eunit syntax_tools compiler crypto
include tools.mk