-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
60 lines (45 loc) · 1.29 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
rebar = ./rebar
scripts = start stop status
compile: deps
$(rebar) compile
quick:
$(rebar) compile skip_deps=true
deps:
$(rebar) get-deps
refresh-deps:
$(rebar) delete-deps
$(rebar) get-deps
tests=""
.PHONY: test
test: quick
ifeq ($(tests), "")
$(rebar) -j1 eunit skip_deps=true
else
$(rebar) -j1 eunit suite=$(tests)
endif
.PHONY: doc
doc:
$(rebar) doc
clean:
$(rebar) clean
opts= -sasl errlog_type error -config dev -s hrm
shell: compile
erl -pa ebin $(wildcard deps/*/ebin) -s e2_reloader ${opts}
env-appid:
@if [ -z "${appid}" ]; then \
echo "ERROR: appid is required"; exit 1; fi
env-appdir:
@if [ -z "${appdir}" ]; then \
echo "ERROR: appdir is required"; exit 1; fi
env-module:
@if [ -z "${module}" ]; then \
echo "ERROR: module is required"; exit 1; fi
new-project: env-appid env-appdir
$(rebar) create template=e2app appid=${appid} dest="${appdir}"
$(foreach var,$(scripts),chmod 755 ${appdir}/$(var);)
new-service: env-module
$(rebar) create template=e2service module=${module} dest="$${appdir-.}" skip_deps=true
@echo "TODO: Add ${module} to a supervisor hierarchy (e.g. *_app file)"
new-task: env-module
$(rebar) create template=e2task module=${module} dest="$${appdir-.}" skip_deps=true
@echo "TODO: Add ${module}_sup to a supervisor hierarchy (e.g. *_app file)"