-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
29 lines (22 loc) · 1012 Bytes
/
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
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)"
build-go:
env GO111MODULE=on go build -v $(LDFLAGS) ./cmd/bot
build-solidity:
pushd contracts; \
forge build; \
popd;
bindings: bindings-L2StandardBridgeBot bindings-OptimismPortal
bindings-L2StandardBridgeBot: build-solidity
jq '.abi' contracts/out/L2StandardBridgeBot.sol/L2StandardBridgeBot.json > contracts/out/L2StandardBridgeBot.sol/L2StandardBridgeBot.abi; \
abigen --abi contracts/out/L2StandardBridgeBot.sol/L2StandardBridgeBot.abi --pkg bindings --type L2StandardBridgeBot --out bindings/L2StandardBridgeBot.go
bindings-OptimismPortal:
curl -o bindings/OptimismPortal.go https://raw.githubusercontent.com/ethereum-optimism/optimism/005be54bde97747b6f1669030721cd4e0c14bc69/op-bindings/bindings/optimismportal.go
.PHONY: \
bot \
build-go \
build-solidity \
bindings