-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
50 lines (38 loc) · 1 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
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)"
EVENT_ABI_ARTIFACT := ./abis/FishcakeEventManager.sol/FishcakeEventManager.json
NFT_ABI_ARTIFACT := ./abis/NftManager.sol/NftManager.json
fishcake:
env GO111MODULE=on go build -v $(LDFLAGS) ./cmd/fishcake
clean:
rm fishcake
test:
go test -v ./...
lint:
golangci-lint run ./...
bindings: binding-event binding-nft
binding-event:
$(eval temp := $(shell mktemp))
cat $(EVENT_ABI_ARTIFACT) | jq .abi \
| abigen --pkg abi \
--abi - \
--out event/polygon/abi/fish_cake_event_manager.go \
--type FishcakeEventManager \
rm $(temp)
binding-nft:
$(eval temp := $(shell mktemp))
cat $(NFT_ABI_ARTIFACT) | jq .abi \
| abigen --pkg abi \
--abi - \
--out event/polygon/abi/nft_manager.go \
--type NftManager \
rm $(temp)
.PHONY: \
fishcake \
bindings \
clean \
test \
lint