forked from dapplink-labs/key-locker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
55 lines (40 loc) · 1.15 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
SHELL := /bin/bash
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)"
CONTRACTS_PATH := "./packages/key-contract/artifacts/contracts"
GENPATH := "./proto/common"
COMMONPATH := "github.com/savour-labs/key-locker/proto/common"
PWD := $(shell pwd)
key-locker:
env GO111MODULE=on go build $(LDFLAGS)
.PHONY: key-locker
clean:
rm key-locker
test:
go test -v ./...
lint:
golangci-lint run ./...
abi:
cat $(CONTRACTS_PATH)/KeyLocker.sol/KeyLocker.json \
| jq '{abi,bytecode}' \
> packages/key-contract/abis/KeyLocker.json
binding: abi
$(eval temp := $(shell mktemp))
cat packages/key-contract/abis/KeyLocker.json \
| jq -r .bytecode > $(temp)
cat packages/key-contract/abis/KeyLocker.json \
| jq .abi \
| abigen --pkg bindings \
--abi - \
--out blockchain/ethereum/bindings/keylocker.go \
--type KeyLocker \
--bin $(temp)
rm $(temp)
gen :$PWD
sh ./script/proto_gen.sh
$PWD: