forked from ethereum-optimism/optimism
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
61 lines (50 loc) · 1.5 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
GITCOMMIT := $(shell git rev-parse HEAD)
GITDATE := $(shell git show -s --format='%ct')
GITVERSION := $(shell cat package.json | jq .version)
LDFLAGSSTRING +=-X main.GitCommit=$(GITCOMMIT)
LDFLAGSSTRING +=-X main.GitDate=$(GITDATE)
LDFLAGSSTRING +=-X main.GitVersion=$(GITVERSION)
LDFLAGS := -ldflags "$(LDFLAGSSTRING)"
DEPOSIT_ARTIFACT := ../../packages/contracts/artifacts/contracts/L1/teleportr/TeleportrDeposit.sol/TeleportrDeposit.json
DISBURSER_ARTIFACT := ../../packages/contracts/artifacts/contracts/L2/teleportr/TeleportrDisburser.sol/TeleportrDisburser.json
teleportr:
env GO111MODULE=on go build -v $(LDFLAGS) ./cmd/teleportr
teleportr-api:
env GO111MODULE=on go build -v $(LDFLAGS) ./cmd/teleportr-api
clean:
rm teleportr
rm api
test:
go test -v ./...
lint:
golangci-lint run ./...
bindings: bindings-deposit bindings-disburser
bindings-deposit:
$(eval temp := $(shell mktemp))
cat $(DEPOSIT_ARTIFACT) | jq -r .bytecode > $(temp)
cat $(DEPOSIT_ARTIFACT) | jq .abi | \
abigen \
--pkg deposit \
--abi - \
--out bindings/deposit/teleportr_deposit.go \
--type TeleportrDeposit \
--bin $(temp)
bindings-disburser:
$(eval temp := $(shell mktemp))
cat $(DISBURSER_ARTIFACT) | jq -r .bytecode > $(temp)
cat $(DISBURSER_ARTIFACT) | jq .abi | \
abigen \
--pkg disburse \
--abi - \
--out bindings/disburse/teleportr_disburser.go \
--type TeleportrDisburser \
--bin $(temp)
.PHONY: \
teleportr \
teleportr-api \
bindings \
bindings-deposit \
bindings-disburser \
clean \
test \
lint