-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
188 lines (159 loc) · 4.02 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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
RELNAME=exodm
ESL="$(PWD)/rel/plugins"
EXODM_DIR=$(PWD)
ED=$(EXODM_DIR)/deps
REBAR=$(EXODM_DIR)/rebar
.PHONY: all compile clean release upgrade test node console start attach tar \
recompile dev devrun
all: compile
tar:
./exorel tar `./exorel current` -root $(PWD)
compile:
$(REBAR) get-deps
$(REBAR) compile
recompile:
$(REBAR) compile
release: compile
cd rel; $(REBAR) create-node skip_deps=true nodeid=$(RELNAME)
generate:
rm -f ./rel/exodm
rm -f rel/exodm rel/lib/exodm
(cd rel && $(REBAR) generate -f skip_deps=true)
./exorel current `./exorel last_build` -root $(PWD)
dev:
./devsetup -target false
devrun:
ifdef n
./devrun -name $(n)
else
echo "no node given (e.g. n=foo make devrun)"
$(error, no node given)
exit 2
endif
node:
ifdef n
./make_node -target $(PWD)/nodes/$(n) -rel $(PWD)/rel/$(RELNAME) -- -name $(n)
else
echo "no node given (e.g. n=foo make node)"
$(error, no node given)
exit 2
endif
start:
ifdef n
(cd nodes/$(n); ERL_SETUP_LIBS=$(ESL) \
../../rel/$(RELNAME)/bin/$(RELNAME) start)
else
echo "no node given (e.g. n=foo make start)"
$(error, no node given)
exit 2
endif
attach:
ifdef n
(cd nodes/$(n); ../../rel/$(RELNAME)/bin/$(RELNAME) attach)
else
echo "no node given (e.g. n=foo make attach)"
$(error, no node given)
exit 2
endif
stop:
ifdef n
(cd nodes/$(n); ../../rel/$(RELNAME)/bin/$(RELNAME) stop)
else
echo "no node given (e.g. n=foo make stop)"
$(error, no node given)
exit 2
endif
setup:
ifdef n
(cd nodes/$(n); ERL_SETUP_LIBS=$(ESL) \
../../rel/$(RELNAME)/bin/$(RELNAME) \
console_boot $(RELNAME)_setup -- -setup mode setup)
else
echo "no node given (e.g. n=foo make setup)"
$(error, no node given)
exit 2
endif
convert:
ifdef n
(cd nodes/$(n); ERL_SETUP_LIBS=$(ESL) \
../../rel/$(RELNAME)/bin/$(RELNAME) \
console_boot $(RELNAME)_setup -- -setup mode convert)
else
echo "no node given (e.g. n=foo make setup)"
$(error, no node given)
exit 2
endif
console:
ifdef n
(cd nodes/$(n); ERL_SETUP_LIBS=$(ESL) \
../../rel/$(RELNAME)/bin/$(RELNAME) console)
else
echo "no node given (e.g. n=foo make attach)"
$(error, no node given)
exit 2
endif
save_release:
ifdef RELVSN
cp -r rel/$(RELNAME) rel/$(RELNAME)-$(RELVSN)
else
echo "no RELVSN set"
$(error no RELVSN set)
exit 2
endif
appup:
ifneq ($(strip $(PREV)),)
(cd rel; $(REBAR) -vvv generate-appup skip_deps=true previous_release=$(PREV))
else
echo "no PREV set"
exit 2
endif
upgrade:
ifneq ($(strip $(PREV)),)
(cd rel; $(REBAR) -vvv generate-upgrade skip_deps=true previous_release=$(PREV))
else
echo "no PREV set"
exit 2
endif
test:
EXO_TEST=true $(REBAR) skip_deps=true eunit
retest:
EXO_TEST=true EXODM_SKIP_MAKE=true $(REBAR) skip_deps=true eunit
# `make test_console` steps into the EUnit directory for the test system
# and starts exodm in 'console' mode. This is useful after a `make test`,
# in order to inspect the database, run test commands, etc.
test_console:
cd .eunit/exodm_tmp; ERL_SETUP_LIBS=$(ESL) ../../rel/exodm/bin/exodm console
# Note: only works if install=false in ck3_test/test/ck3.cfg
# Use this if you don't have REBAR_DEPS, ERL_LIBS and EXODM_PLUGIN_DIR set
ck3_test:
CK3_TEST=true $(REBAR) get-deps compile
rm -rf rel/plugins
mkdir -p rel/plugins
ln -s $(PWD)/deps/exodm_ck3 rel/plugins/
(cd deps/ck3_test/test && ERL_LIBS=$(EXODM_DIR)/deps make)
echo "starting CT run"
(cd deps/ck3_test/test && \
ERL_LIBS=$(ED) ct_run -config ck3.cfg -suite ck3_SUITE -erl_args -name ct -setcookie exodm -pz $(EXODM_DIR)/ebin)
rm -rf rel/plugins
# Use this if you have REBAR_DEPS, ERL_LIBS and EXODM_PLUGIN_DIR set
# and all repos cloned
ck3_test_local:
ifdef EXODM_PLUGIN_DIR
$(REBAR) get-deps compile
rm -rf rel/plugins
mkdir -p rel/plugins
ln -s $(EXODM_PLUGIN_DIR)/exodm_ck3 rel/plugins/
echo "starting CT run"
(cd $(ERL_LIBS)/ck3_test/test && \
ct_run -config ck3.cfg -suite ck3_SUITE -erl_args -name ct -setcookie exodm)
rm -rf rel/plugins
else
echo "no EXODM_PLUGIN_DIR set"
$(error no EXODM_PLUGIN_DIR set)
exit 2
endif
clean:
$(REBAR) clean
realclean:
rm -f rel/reltool.config
rm -rf rel/files