forked from 2600hz/kazoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
57 lines (43 loc) · 1.54 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
PROJECT = media_mgr
ROOT = ../..
REBAR = $(ROOT)/utils/rebar/rebar
DIALYZER = dialyzer
EBINS = $(shell find $(ROOT)/core -maxdepth 2 -name ebin -print) $(shell find $(ROOT)/deps -maxdepth 2 -name ebin -print)
PA = $(foreach EBIN,$(EBINS),-pa $(EBIN))
ERLC_OPTS = -Werror +debug_info +warn_export_all -I$(ROOT)/core -I$(ROOT)/deps $(PA)
# +bin_opt_info
DIRS = . \
$(ROOT)/core/whistle-1.0.0 \
$(ROOT)/core/whistle_amqp-1.0.0 \
$(ROOT)/core/whistle_couch-1.0.0 \
$(ROOT)/core/whistle_apps-1.0.0
.PHONY: all compile clean
all: compile
MODULES = $(shell ls src/*.erl | sed 's/src\///;s/\.erl/,/' | sed '$$s/.$$//')
compile: ebin/$(PROJECT).app
@cat src/$(PROJECT).app.src \
| sed 's/{modules, \[\]}/{modules, \[$(MODULES)\]}/' \
> ebin/$(PROJECT).app
-@$(MAKE) ebin/$(PROJECT).app
ebin/$(PROJECT).app: src/*.erl
@mkdir -p ebin/
erlc -v $(ERLC_OPTS) -o ebin/ -pa ebin/ $?
compile-test: test/$(PROJECT).app
@cat src/$(PROJECT).app.src \
| sed 's/{modules, \[\]}/{modules, \[$(MODULES)\]}/' \
> test/$(PROJECT).app
-@$(MAKE) test/$(PROJECT).app
test/$(PROJECT).app: src/*.erl
@mkdir -p test/
erlc -v $(ERLC_OPTS) -o test/ -pa test/ $?
clean:
rm -f ebin/*
rm -f test/*.beam test/$(PROJECT).app
rm -f erl_crash.dump
test: clean compile-test eunit
eunit: compile-test
erl -noshell -pa test -eval "eunit:test([$(MODULES)], [verbose])" -s init stop
dialyze:
@$(DIALYZER) $(foreach DIR,$(DIRS),$(DIR)/ebin) \
--plt $(ROOT)/.platform_dialyzer.plt --no_native \
-Werror_handling -Wrace_conditions -Wunmatched_returns # -Wunderspecs