forked from eproxus/meck
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
63 lines (44 loc) · 1.47 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
PLTFILE=$(CURDIR)/.deps.plt
APP_DEPS=kernel stdlib eunit tools compiler erts
ERLFLAGS= -pa $(CURDIR)/.eunit -pa $(CURDIR)/ebin -pa $(CURDIR)/deps/*/ebin
REBAR="./rebar"
ifeq ($(REBAR),)
$(error "Rebar not available on this system")
endif
ERL = $(shell which erl)
ifeq ($(ERL),)
$(error "Erlang must be available on this system")
endif
BUILD_PLT_INC=$(shell test -d deps && echo '-r deps')
DIALYZER_INC=$(shell test -d include && echo '-I include') $(shell test -d deps && echo '-I deps')
.PHONY: all rebuild compile doc clean test dialyzer typer get-deps clean-deps \
shell clean-plt clean-doc distclean
all: get-deps compile
rebuild: distclean get-deps all
get-deps:
@$(REBAR) -C test.config get-deps
compile:
@$(REBAR) -C rebar.config skip_deps=true compile
doc:
@$(REBAR) -C test.config skip_deps=true doc
clean:
@$(REBAR) -C test.config skip_deps=true clean
test: get-deps compile
@$(REBAR) -C test.config compile
@$(REBAR) -C test.config skip_deps=true eunit
$(PLTFILE):
- dialyzer --build_plt --apps $(APP_DEPS) $(BUILD_PLT_INC) --output_plt $(PLTFILE)
dialyzer: compile $(PLTFILE)
@dialyzer --fullpath --plt $(PLTFILE) $(DIALYZER_INC) -pa $(CURDIR)/ebin -c src --src | \
fgrep -v -f ./dialyzer.ignore-warnings
typer:
typer --plt $(PLTFILE) $(DIALYZER_INC) -r src
shell:
@$(ERL) $(ERLFLAGS)
clean-plt:
@rm -rf $(PLTFILE)
clean-doc:
@cd doc; ls * | grep -v overview.edoc | xargs rm -f
clean-deps:
@rm -rvf $(CURDIR)/deps/*
distclean: clean clean-plt clean-doc clean-deps