.PHONY: check run test clean help

GO ?= go
GO_EXPERIMENT ?=
GOCACHE ?= /tmp/aip56-go-cache
GO_ENV = GOEXPERIMENT="$(GO_EXPERIMENT)" GOCACHE="$(GOCACHE)"

check:
	$(GO_ENV) $(GO) run . --check

run:
	$(GO_ENV) $(GO) run .

test:
	$(GO_ENV) $(GO) test ./...

clean:
	$(GO_ENV) $(GO) clean -cache -testcache
	rm -rf "$(GOCACHE)"

help:
	@printf '%s\n' \
		'make check  Validate the canonical wordlist' \
		'make run    Generate one AIP-56 phrase' \
		'make test   Run the Go tests' \
		'make clean  Remove the dedicated Go cache' \
		'make help   Show these targets' \
		'' \
		'Overrides: GO_EXPERIMENT=name GOCACHE=/path'
