This repository has been archived by the owner on Oct 7, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
70 lines (48 loc) · 1.86 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
REBAR = $(CURDIR)/tools/rebar3
ERL := $(shell command -v erl 2> /dev/null)
CFG_DIR = $(CURDIR)/config
READ_COVERAGE_SUMMARY_SCRIPT = 'BEGIN {FS="[<>]"; print_headers = 0} $$2 == "tr" {if ($$7 ~ /^posthaste/ || $$7 == "Total") {if ($$13 ~ /%$$/) {maybe_print_headers(); print $$7": " $$13}}} $$2 == "/table" {exit} function maybe_print_headers() {if (!print_headers) {print "Coverage summary:" ; print_headers = 1}}'
COVERAGE_SUMARY_CMD = awk $(READ_COVERAGE_SUMMARY_SCRIPT) _build/test/cover/index.html
RELEASE_DIR = $(CURDIR)/_build/release/rel/posthaste
ifndef ERL
$(error Could not found Erlang/OTP ('erlc' command) installed on this system.)
endif
.PHONY: all compile shell docs test ct dialyzer cover coverage-summary release start stop remote release-shell ping clean distclean
all: test docs release
compile:
@ $(REBAR) compile
shell: compile
ifeq (,$(wildcard $(CURDIR)/tools/user_default.beam))
@ erlc -o $(CURDIR)/tools $(CURDIR)/tools/user_default.erl
endif
@ erl -pa $(shell ls -d _build/default/lib/*/ebin) -pz $(CURDIR)/tools -config $(CFG_DIR)/sys.config -args_file $(CFG_DIR)/vm.args -eval "catch code:load_file('posthaste')"
docs: compile
@ $(REBAR) as doc edoc
test:
@ $(REBAR) as test do dialyzer, ct, cover
@ $(COVERAGE_SUMARY_CMD)
ct:
@ $(REBAR) as test ct
dialyzer:
@ $(REBAR) as test dialyzer
cover:
@ $(REBAR) as test ct, cover
@ $(COVERAGE_SUMARY_CMD)
coverage-summary:
@ $(COVERAGE_SUMARY_CMD)
release:
@ $(REBAR) as release release
start:
@ $(RELEASE_DIR)/bin/posthaste start
stop:
@ $(RELEASE_DIR)/bin/posthaste stop
remote:
@ $(RELEASE_DIR)/bin/posthaste remote_console
release-shell:
@ $(RELEASE_DIR)/bin/posthaste console
ping:
@ $(RELEASE_DIR)/bin/posthaste ping
clean:
@ $(REBAR) clean
distclean: clean
@ rm -rf _build rebar.lock doc