-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile
82 lines (62 loc) · 1.54 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
GITCOMMIT := $(shell git rev-parse HEAD)
GITDATE := $(shell git show -s --format='%ct')
LDFLAGSSTRING +=-X main.GitCommit=$(GITCOMMIT)
LDFLAGSSTRING +=-X main.GitDate=$(GITDATE)
LDFLAGS := -ldflags "$(LDFLAGSSTRING)"
L1POOL_ABI_ARTIFACT := bridge-contracts/out/L1PoolManager.sol/L1PoolManager.json
L2POOL_ABI_ARTIFACT := bridge-contracts/out/L2PoolManager.sol/L2PoolManager.json
MSG_ABI_ARTIFACT := bridge-contracts/out/MessageManager.sol/MessageManager.json
acorus:
env GO111MODULE=on go build -v $(LDFLAGS) ./cmd/acorus
clean:
rm acorus
test:
go test -v ./...
lint:
golangci-lint run ./...
bindings: binding-l1p binding-l2p binding-msg
binding-l1p:
$(eval temp := $(shell mktemp))
cat $(L1POOL_ABI_ARTIFACT) \
| jq -r .bytecode > $(temp)
cat $(L1POOL_ABI_ARTIFACT) \
| jq .abi \
| abigen --pkg bindings \
--abi - \
--out bindings/l1_pool_manager.go \
--type L1PoolManager \
--bin $(temp)
rm $(temp)
binding-l2p:
$(eval temp := $(shell mktemp))
cat $(L2POOL_ABI_ARTIFACT) \
| jq -r .bytecode > $(temp)
cat $(L2POOL_ABI_ARTIFACT) \
| jq .abi \
| abigen --pkg bindings \
--abi - \
--out bindings/l2_pool_manager.go \
--type L2PoolManager \
--bin $(temp)
rm $(temp)
binding-msg:
$(eval temp := $(shell mktemp))
cat $(MSG_ABI_ARTIFACT) \
| jq -r .bytecode > $(temp)
cat $(MSG_ABI_ARTIFACT) \
| jq .abi \
| abigen --pkg bindings \
--abi - \
--out bindings/message_manager.go \
--type MessageManager \
--bin $(temp)
rm $(temp)
.PHONY: \
acorus \
bindings \
bindings-l1p \
bindings-l2p \
bindings-msg \
clean \
test \
lint