-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
57 lines (41 loc) · 1.06 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
REBAR3_URL=https://s3.amazonaws.com/rebar3/rebar3
ifeq ($(wildcard rebar3),rebar3)
REBAR3 = $(CURDIR)/rebar3
endif
ifdef RUNNING_ON_CI
REBAR3 = ./rebar3
else
REBAR3 ?= $(shell test -e `which rebar3` 2>/dev/null && which rebar3 || echo "./rebar3")
endif
ifeq ($(REBAR3),)
REBAR3 = $(CURDIR)/rebar3
endif
.PHONY: deps build clean dialyzer xref doc test publish
.NOTPARALLEL: check
all: build
build: $(REBAR3)
@$(REBAR3) compile
$(REBAR3):
wget $(REBAR3_URL) || curl -Lo rebar3 $(REBAR3_URL)
@chmod a+x rebar3
clean: $(REBAR3)
@$(REBAR3) clean
check: dialyzer xref
dialyzer: $(REBAR3)
@$(REBAR3) dialyzer
xref: $(REBAR3)
@$(REBAR3) xref
doc: $(REBAR3)
@$(REBAR3) edoc
README.md: doc
# non-portable dirty hack follows (pandoc 2.1.1 used)
# gfm: "github-flavoured markdown"
@pandoc --from html --to gfm doc/overview-summary.html -o README.md
@tail -n +11 <"README.md" >"README.md_"
@head -n -12 <"README.md_" >"README.md"
@tail -n 2 <"README.md_" >>"README.md"
@rm "README.md_"
test: $(REBAR3)
@$(REBAR3) eunit
publish: $(REBAR3)
@$(REBAR3) hex publish