diff --git a/Makefile b/Makefile index 3e44e8c74b..025a9b0d23 100644 --- a/Makefile +++ b/Makefile @@ -318,13 +318,13 @@ setup-dev: ##@setup Install all necessary tools for development setup-dev: echo "Replaced by Nix shell. Use 'make shell' or just any target as-is." -generate: SHELL := /bin/sh generate: PACKAGES ?= $$(go list -e ./... | grep -v "/contracts/") generate: GO_GENERATE_FAST ?= $(if $(shell which go-generate-fast),"true") generate: export GO_GENERATE_FAST_DEBUG ?= false generate: export GO_GENERATE_FAST_RECACHE ?= false generate: ##@ Run generate for all given packages using go-generate-fast, fallback to `go generate` (e.g. for docker) - @if [ "$(GO_GENERATE_FAST)" = "true" ]; then \ + @GOROOT=$$(go env GOROOT); \ + if [ "$(GO_GENERATE_FAST)" = "true" ]; then \ go-generate-fast -x $(PACKAGES); \ else \ go generate -x $(PACKAGES); \