-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
49 lines (37 loc) · 1.39 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
SERVERS = 5
CLIENTS = 5
CONFIG = high_load_prevent_livelock_crash_1_server
DEBUG = 0
MAX_TIME = 60000
START = Multipaxos.start
HOST := 127.0.0.1
# --------------------------------------------------------------------
TIME := $(shell date +%H:%M:%S)
SECS := $(shell date +%S)
COOKIE := $(shell echo $$PPID)
NODE_SUFFIX := ${SECS}_${LOGNAME}@${HOST}
ELIXIR := elixir --no-halt --cookie ${COOKIE} --name
MIX := -S mix run -e ${START} \
${NODE_SUFFIX} ${MAX_TIME} ${DEBUG} ${SERVERS} ${CLIENTS} ${CONFIG}
# --------------------------------------------------------------------
run cluster: compile
@ ${ELIXIR} server1_${NODE_SUFFIX} ${MIX} cluster_wait &
@ ${ELIXIR} server2_${NODE_SUFFIX} ${MIX} cluster_wait &
@ ${ELIXIR} server3_${NODE_SUFFIX} ${MIX} cluster_wait &
@ ${ELIXIR} server4_${NODE_SUFFIX} ${MIX} cluster_wait &
@ ${ELIXIR} server5_${NODE_SUFFIX} ${MIX} cluster_wait &
@ ${ELIXIR} client1_${NODE_SUFFIX} ${MIX} cluster_wait &
@ ${ELIXIR} client2_${NODE_SUFFIX} ${MIX} cluster_wait &
@ ${ELIXIR} client3_${NODE_SUFFIX} ${MIX} cluster_wait &
@ ${ELIXIR} client4_${NODE_SUFFIX} ${MIX} cluster_wait &
@ ${ELIXIR} client5_${NODE_SUFFIX} ${MIX} cluster_wait &
@sleep 3
@ ${ELIXIR} multipaxos_${NODE_SUFFIX} ${MIX} cluster_start
compile:
mix compile
clean:
mix clean
@rm -f erl_crash.dump
ps:
@echo ------------------------------------------------------------
epmd -names