forked from esl/MongooseIM
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
97 lines (69 loc) · 2.5 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
.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
TESTNODES = internal_mnesia internal_redis odbc_mnesia odbc_redis external_mnesia external_redis
all: deps compile
compile: rebar generate_snmp_header
./rebar compile
deps: rebar generate_snmp_header
./rebar get-deps
clean: rebar
./rebar clean
test: test_deps
cd test/ejabberd_tests; make test
cover_test: test_deps
cd test/ejabberd_tests; make cover_test
show_test_results:
$$BROWSER `ls -td test/ct_report/ct_run.test@*/index.html | head -n 1` & disown
eunit: rebar
./rebar skip_deps=true eunit
rel: rebar deps
./rebar compile generate -f
devrel: $(DEVNODES)
testrel: $(DEVNODES) $(TESTNODES)
$(DEVNODES) $(TESTNODES): rebar deps compile deps_dev
@echo "building $@"
(cd rel && ../rebar generate -f target_dir=../dev/ejabberd_$@ overlay_vars=./reltool_vars/$@_vars.config)
cp apps/ejabberd/src/*.erl dev/ejabberd_$@/lib/ejabberd-2.1.8/ebin/
ifeq ($(shell uname), Linux)
cp -R `dirname $(shell readlink -f $(shell which erl))`/../lib/tools-* dev/ejabberd_$@/lib/
else
cp -R `which erl`/../../lib/tools-* dev/ejabberd_$@/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/ejabberd
COMBO_PLT = $(HOME)/.esl_ejabberd_combo_dialyzer_plt
PLT_LIBS = $(wildcard rel/ejabberd/lib/*/ebin)
DIALYZER_APPS = ejabberd
DIALYZER_APPS_PATHS = $(addsuffix /ebin, $(addprefix apps/, $(DIALYZER_APPS)))
check_plt: rel
dialyzer --check_plt --plt $(COMBO_PLT) $(PLT_LIBS)
build_plt: rel
dialyzer --build_plt --output_plt $(COMBO_PLT) $(PLT_LIBS)
dialyzer: compile
dialyzer -Wno_return --fullpath --plt $(COMBO_PLT) $(DIALYZER_APPS_PATHS) | \
fgrep -v -f ./dialyzer.ignore-warnings
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