-
Notifications
You must be signed in to change notification settings - Fork 63
/
Makefile
74 lines (56 loc) · 1.37 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
export KAFKA_VERSION ?= 2.4
all: compile
rebar ?= $(shell which rebar3)
rebar_cmd = $(rebar) $(profile:%=as %)
GEN_INPUT = include/*.hrl priv/kpro_gen.escript priv/kafka.bnf priv/kpro_scanner.xrl priv/kpro_parser.yrl
GEN_CODE = src/kpro_schema.erl
# results of this target are to be committed in this repo
.PHONY: kafka-bnf
kafka-bnf:
@cd priv/kafka_protocol_bnf && gradle run
@cat priv/kafka.bnf | grep "#.*ApiKey" | awk '{print "{"$$2" "$$3"}."}' | sed -r 's/([A-Z])/_\L\1/g' | sed 's/{_/{/' | sort -hk2 > priv/api-keys.eterm
$(GEN_CODE): $(GEN_INPUT)
@priv/kpro_gen.escript
$(PROJECT).d: $(GEN_CODE)
.PHONY: gen-code
gen-code: $(GEN_CODE)
@$(verbose) :
.PHONY: gen-clean
gen-clean:
@rm -f priv/*.beam priv/*.erl
.PHONY: clean
clean: gen-clean
@$(rebar_cmd) clean
.PHONY: xref
xref:
@$(rebar_cmd) xref
.PHONY: eunit
eunit:
@$(rebar_cmd) eunit -v --cover_export_name $(KAFKA_VERSION)
.PHONY: compile
compile:
@$(rebar_cmd) compile
.PHONY: distclean
distclean: clean
@rm -rf _build deps
@rm -f rebar.lock
.PHONY: edoc
edoc: profile=edown
edoc:
@$(rebar_cmd) edoc
.PHONY: ex_doc
ex_doc:
@$(rebar_cmd) ex_doc
.PHONY: dialyze dialyzer
dialyze: dialyzer
dialyzer: compile
@$(rebar_cmd) dialyzer
.PHONY: hex-publish
hex-publish: distclean
$(verbose) rebar3 hex publish --repo=hexpm
.PHONY: test-env
test-env:
@./scripts/setup-test-env.sh
.PHONY: cover
cover:
@rebar3 cover -v