forked from esl/MongooseIM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
121 lines (86 loc) · 3.2 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
.PHONY: rel deps test show_test_results generate_snmp_header
EJABBERD_DIR = apps/ejabberd
EJD_INCLUDE = $(EJABBERD_DIR)/include
EJD_PRIV = $(EJABBERD_DIR)/priv
EJD_PRIV_MIB = $(EJD_PRIV)/mibs
EJD_MIB = $(EJABBERD_DIR)/mibs
DEVNODES = node1 node2
all: deps compile
compile: rebar generate_snmp_header
./rebar compile
deps: rebar generate_snmp_header
./rebar get-deps
clean: rebar
./rebar clean
quick_compile: rebar
./rebar compile skip_deps=true
reload: quick_compile
@E=`ls ./rel/mongooseim/lib/ | grep ejabberd-2 | sort -r | head -n 1` ;\
rsync -uW ./apps/ejabberd/ebin/*beam ./rel/mongooseim/lib/$$E/ebin/ ;\
ct: deps quick_compile
@if [ "$(SUITE)" ]; then ./rebar -q ct suite=$(SUITE) skip_deps=true;\
else ./rebar -q ct skip_deps=true; fi
test: test_deps
cd test/ejabberd_tests; make test
test_preset: test_deps
cd test/ejabberd_tests; make test_preset
run: deps compile quickrun
quickrun:
erl -sname ejabberd -setcookie ejabberd -pa deps/*/ebin apps/*/ebin -config rel/files/app.run.config -s ejabberd -s sync
cover_test: test_deps
cd test/ejabberd_tests; make cover_test
quicktest: test_deps
cd test/ejabberd_tests; make quicktest
show_test_results:
$$BROWSER `ls -td test/ct_report/ct_run.test@*/index.html | head -n 1` & disown
eunit: rebar deps
./rebar compile
./rebar skip_deps=true eunit
rel: rebar deps
./rebar compile generate -f
devrel: $(DEVNODES)
$(DEVNODES): rebar deps compile deps_dev
@echo "building $@"
(cd rel && ../rebar generate -f target_dir=../dev/mongooseim_$@ overlay_vars=./reltool_vars/$@_vars.config)
cp apps/ejabberd/src/*.erl `ls -dt dev/mongooseim_$@/lib/ejabberd-2.1.8*/ebin/ | head -1`
ifeq ($(shell uname), Linux)
cp -R `dirname $(shell readlink -f $(shell which erl))`/../lib/tools-* dev/mongooseim_$@/lib/
else
cp -R `which erl`/../../lib/tools-* dev/mongooseim_$@/lib/
endif
deps_dev:
mkdir -p dev
cp rel/files/test_cert.pem /tmp/server.pem
cp rel/files/sample_external_auth.py /tmp
devclean:
rm -rf dev/*
generate_snmp_header: apps/ejabberd/include/EJABBERD-MIB.hrl
$(EJD_INCLUDE)/EJABBERD-MIB.hrl: $(EJD_PRIV_MIB)/EJABBERD-MIB.bin
erlc -o $(EJD_INCLUDE) $<
$(EJD_PRIV_MIB)/EJABBERD-MIB.bin: $(EJD_MIB)/EJABBERD-MIB.mib $(EJD_MIB)/EJABBERD-MIB.funcs
erlc -o $(EJD_PRIV_MIB) $<
relclean:
rm -rf rel/mongooseim
COMBO_PLT = .mongooseim_combo_dialyzer.plt
DEPS_LIBS = $(wildcard deps/*/ebin/*.beam)
MONGOOSE_LIBS = $(wildcard apps/ejabberd/ebin/*.beam)
OTP_APPS = compiler crypto erts kernel stdlib mnesia ssl ssh
DIALYZER_APPS = ejabberd
DIALYZER_APPS_PATHS = $(addsuffix /ebin, $(addprefix apps/, $(DIALYZER_APPS)))
check_plt:
dialyzer --check_plt --plt $(COMBO_PLT) $(MONGOOSE_LIBS)
build_plt:
dialyzer --build_plt --apps $(OTP_APPS) \
--output_plt $(COMBO_PLT) $(DEPS_LIBS) $(MONGOOSE_LIBS)
dialyzer: compile
dialyzer -Wno_return --fullpath --plt $(COMBO_PLT) $(DIALYZER_APPS_PATHS) | \
fgrep -v -f ./dialyzer.ignore-warnings | tee dialyzer.log
cleanplt:
rm $(COMBO_PLT)
test_deps: rebar
./rebar -C rebar.tests.config get-deps
# This might download a version which can't build the project properly!
# Compatible rebar version should be checked into the repository.
rebar:
wget -q http://cloud.github.com/downloads/basho/rebar/rebar
chmod u+x rebar