This repository has been archived by the owner on May 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
97 lines (76 loc) · 1.61 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
PROJECT = brucke
PROJECT_DESCRIPTION = Inter-cluster bridge of kafka topics
PROJECT_VERSION = $(shell erl -noshell -eval "{ok, [{_, _, L}]} = file:consult('src/brucke.app.src'), io:put_chars([V || {vsn, V} <- L]), halt(0)")
all: compile
rebar ?= $(shell which rebar3)
rebar_cmd = $(rebar) $(profile:%=as %)
.PHONY: compile
compile:
@$(rebar_cmd) compile
.PHONY: xref
xref:
@$(rebar_cmd) xref
.PHONY: clean
clean:
@$(rebar_cmd) clean
.PHONY: distclean
distclean:
@$(rebar_cmd) clean
@rm -rf _build
.PHONY: eunit
eunit:
@$(rebar_cmd) eunit -v
.PHONY: ct
ct:
@$(rebar_cmd) ct
.PHONY: edoc
edoc: profile=edown
edoc:
@$(rebar_cmd) edoc
.PHONY: shell
shell: profile=dev
shell:
@$(rebar_cmd) shell --apps brod
.PHONY: dialyzer
dialyzer: compile
@$(rebar_cmd) dialyzer
.PHONY: cover
cover:
@$(rebar_cmd) cover -v
.PHONY: t
t: eunit ct cover
.PHONY: test-env
test-env:
./scripts/start-test-brokers.sh
.PHONY: rel
rel: profile=prod
rel: all
@$(rebar_cmd) release
.PHONY: run
run: profile=dev
run:
@$(rebar_cmd) release
@_build/dev/rel/brucke/bin/brucke console
TOPDIR = /tmp/brucke-rpm
PWD = $(shell pwd)
.PHONY: rpm
rpm: profile=prod
rpm: rel
@rpmbuild -v -bb \
--define "_sourcedir $(PWD)" \
--define "_builddir $(PWD)" \
--define "_rpmdir $(PWD)" \
--define "_topdir $(TOPDIR)" \
--define "_name $(PROJECT)" \
--define "_description $(PROJECT_DESCRIPTION)" \
--define "_version $(PROJECT_VERSION)" \
rpm/brucke.spec
.PHONY: hex-publish
hex-publish: distclean
@$(rebar_cmd) hex publish
.PHONY: coveralls
coveralls:
@$(rebar_cmd) coveralls send
.PHONY: escript
escript:
@$(rebar_cmd) escriptize