forked from parapluu/Concuerror
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
126 lines (96 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
122
123
124
125
126
###-----------------------------------------------------------------------------
### Application info
###-----------------------------------------------------------------------------
NAME := concuerror
REBAR=$(shell which rebar3 || echo "./rebar3")
.PHONY: default
default bin/$(NAME): $(REBAR)
$(REBAR) escriptize
MAKEFLAGS += --no-builtin-rules
.SUFFIXES:
###-----------------------------------------------------------------------------
### Rebar
###-----------------------------------------------------------------------------
REBAR_URL="https://s3.amazonaws.com/rebar3/rebar3"
./$(REBAR):
wget $(REBAR_URL) && chmod +x rebar3
###-----------------------------------------------------------------------------
### Compile
###-----------------------------------------------------------------------------
.PHONY: dev native pedantic
dev native pedantic: $(REBAR)
$(REBAR) as $@ escriptize
###-----------------------------------------------------------------------------
### Edoc
###-----------------------------------------------------------------------------
.PHONY: edoc
edoc: $(REBAR)
$(REBAR) edoc
###-----------------------------------------------------------------------------
### Lint
###-----------------------------------------------------------------------------
.PHONY: lint
lint: $(REBAR)
$(REBAR) as lint lint
###-----------------------------------------------------------------------------
### Dialyzer
###-----------------------------------------------------------------------------
.PHONY: dialyzer
dialyzer: $(REBAR)
$(REBAR) dialyzer
###-----------------------------------------------------------------------------
### Test
###-----------------------------------------------------------------------------
CONCUERROR?=$(abspath bin/$(NAME))
.PHONY: tests
tests: tests-1 tests-2
.PHONY: tests-1
tests-1: bin/$(NAME)
@$(RM) tests/thediff
@(cd tests; ./runtests.py suites/ba*/src/*)
.PHONY: tests-2
tests-2: bin/$(NAME)
@$(RM) tests/thediff
@(cd tests; ./runtests.py suites/b[^a]*/src/* suites/[^b]*/src/*)
## -j 1: ensure that the outputs of different suites are not interleaved
.PHONY: tests-real
tests-real: bin/$(NAME)
@$(RM) $@/thediff
$(MAKE) -j 1 -C $@ \
TOP_DIR=$(abspath .) \
CONCUERROR=$(CONCUERROR) \
DIFFER=$(abspath tests/differ) \
DIFFPRINTER=$(abspath $@/thediff)
.PHONY: tests-unit
tests-unit: bin/$(NAME)
$(REBAR) eunit
###-----------------------------------------------------------------------------
### Cover
###-----------------------------------------------------------------------------
.PHONY: cover
cover: cover/data bin/$(NAME)
$(RM) $</*
$(MAKE) tests tests-real \
CONCUERROR=$(abspath priv/concuerror) \
CONCUERROR_COVER=$(abspath cover/data)
cd cover; ./cover-report data
cover/data:
@printf " MKDIR $@\n"
@mkdir -p $@
###-----------------------------------------------------------------------------
### Clean
###-----------------------------------------------------------------------------
.PHONY: clean
clean: $(REBAR)
$(REBAR) clean --all
.PHONY: distclean
distclean:
$(RM) bin/$(NAME)
$(RM) -r _build
$(RM) ./$(REBAR)
.PHONY: cover-clean
cover-clean:
$(RM) -r cover/data
$(RM) cover/*.COVER.html
.PHONY: maintainer-clean
maintainer-clean: distclean cover-clean