Skip to content

Commit f95422e

Browse files
schmirulope
authored andcommitted
Speedup 'make generate' and the generate pre-commit hook
1 parent 0903a0e commit f95422e

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

rolling-shutter/Makefile

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ TINYGO ?= tinygo
66
WASMOPT ?= wasm-opt
77
BINDIR ?= ./bin
88
EXECUTABLE ?= ${BINDIR}/rolling-shutter
9+
GOPATH ?= $(${GO} env GOPATH)
910

1011
build:
1112
${GO} build ${GOFLAGS} -o ${EXECUTABLE}
@@ -50,36 +51,41 @@ clean:
5051
install-tools: install-codegen-tools install-golangci-lint install-cobra install-gofumpt install-gci install-gotestsum
5152

5253
# code generation tools: pin version
53-
install-codegen-tools: install-npm install-abigen install-sqlc install-protoc-gen-go install-oapi-codegen install-stringer install-go-enum install-cobra
54+
install-codegen-tools: install-npm install-abigen install-sqlc install-protoc-gen-go install-oapi-codegen install-go-enum
5455

55-
install-npm:
56+
../contracts/node_modules/.mark-npm-install: ../contracts/package.json ../contracts/package-lock.json
5657
cd ../contracts && npm install
58+
@touch ../contracts/node_modules/.mark-npm-install
5759

58-
install-sqlc:
60+
install-npm: ../contracts/node_modules/.mark-npm-install
61+
62+
${GOPATH}/bin/sqlc:
5963
${GO} install github.com/kyleconroy/sqlc/cmd/[email protected]
64+
install-sqlc: ${GOPATH}/bin/sqlc
65+
6066

61-
install-go-enum:
67+
${GOPATH}/bin/go-enum:
6268
${GO} install github.com/abice/[email protected]
69+
install-go-enum: ${GOPATH}/bin/go-enum
6370

64-
install-abigen:
71+
${GOPATH}/bin/abigen:
6572
${GO} install github.com/ethereum/go-ethereum/cmd/[email protected]
73+
install-abigen: ${GOPATH}/bin/abigen
74+
6675

67-
install-protoc-gen-go:
76+
${GOPATH}/bin/protoc-gen-go:
6877
${GO} install google.golang.org/protobuf/cmd/[email protected]
78+
install-protoc-gen-go: ${GOPATH}/bin/protoc-gen-go
6979

70-
install-oapi-codegen:
71-
${GO} install github.com/deepmap/oapi-codegen/cmd/[email protected]
7280

73-
install-stringer:
74-
${GO} install golang.org/x/tools/cmd/[email protected]
81+
${GOPATH}/bin/oapi-codegen:
82+
${GO} install github.com/deepmap/oapi-codegen/cmd/[email protected]
83+
install-oapi-codegen: ${GOPATH}/bin/oapi-codegen
7584

7685
# non code generation tools
7786
install-golangci-lint:
7887
${GO} install github.com/golangci/golangci-lint/cmd/golangci-lint@latest
7988

80-
install-cobra:
81-
${GO} install github.com/spf13/cobra-cli@latest
82-
8389
install-gofumpt:
8490
${GO} install mvdan.cc/gofumpt@latest
8591

0 commit comments

Comments
 (0)