Skip to content

Commit 30f6517

Browse files
committed
Add makefile rule to compile bindings
1 parent c8a18b9 commit 30f6517

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
SHELL := /usr/bin/env bash
22

3+
lower = $(shell echo '$1' | tr '[:upper:]' '[:lower:]')
4+
5+
CONTRACTS := $(basename $(notdir $(wildcard ./src/*.sol)))
6+
BINDINGS := $(foreach contract,$(CONTRACTS),$(call lower,$(contract)))
7+
38
all: forge gen
49
.PHONY: all forge gen
510

@@ -8,3 +13,8 @@ forge:
813

914
gen:
1015
go run gen/gen.go -config genconfig.toml -base-path ./
16+
17+
$(BINDINGS:%=bindings/%.go): forge
18+
abigen --abi <(jq '.["abi"]' "out/$(basename $(notdir $@)).sol/$(basename $(notdir $@)).json") --pkg bindings --out $@
19+
20+
bindings: $(BINDINGS:%=bindings/%.go)

0 commit comments

Comments
 (0)