-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
82 lines (62 loc) · 1.73 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
AUTHORITIES_URL = https://curl.se/ca/cacert.pem
AUTHORITIES_FILE = tmp/cacerts.pem
AUTHORITIES_MODULE = src/tls_certificate_check_hardcoded_authorities.erl
MIX_CHECK=$(shell mix -v >/dev/null 2>/dev/null || /bin/echo "no")
ifeq (no, $(MIX_CHECK))
$(warning skipping Elixir-dependent tests)
TEST_PROFILES = test
else
# $(info "mix check: $(MIX_CHECK)")
TEST_PROFILES = test,elixir_test
endif
.PHONY: all build clean \
check dialyzer xref \
test cover \
shell \
doc-dry \
publish \
hardcoded-authorities-update \
hardcoded-authorities-updater \
download-latest-authorities \
invoke-hardcoded-authorities-updater
.NOTPARALLEL: check
all: build
build:
@rebar3 compile
rebar3:
wget $(REBAR3_URL) || curl -Lo rebar3 $(REBAR3_URL)
@chmod a+x rebar3
clean:
@rebar3 clean
check: dialyzer xref
dialyzer:
@rebar3 as hardcoded_authorities_update dialyzer
xref:
@rebar3 as hardcoded_authorities_update xref
test:
@rebar3 as $(TEST_PROFILES) do eunit, ct, cover
cover: test
shell: export ERL_FLAGS = +pc unicode
shell:
@rebar3 as development shell
doc-dry:
@rebar3 hex build
publish:
@rebar3 hex publish
hardcoded-authorities-update: hardcoded-authorities-updater
hardcoded-authorities-update: download-latest-authorities
hardcoded-authorities-update:
@make invoke-hardcoded-authorities-updater
hardcoded-authorities-updater:
@rebar3 as hardcoded_authorities_update escriptize
download-latest-authorities:
@curl \
-o "$(AUTHORITIES_FILE)" \
--remote-time \
"$(AUTHORITIES_URL)"
invoke-hardcoded-authorities-updater: hardcoded-authorities-updater
@./_build/hardcoded_authorities_update/bin/tls_certificate_check_hardcoded_authorities_updater \
"$(AUTHORITIES_FILE)" \
"$(AUTHORITIES_URL)" \
"$(AUTHORITIES_MODULE)" \
"CHANGELOG.md"