diff --git a/Makefile b/Makefile index 2a7c29a..e7b6e71 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,5 @@ SHELL := /bin/bash -GOBIN ?= $(shell go env GOPATH)/bin -GOMAKE ?= github.com/tkrop/go-make@latest -TARGETS := $(shell command -v go-make >/dev/null || \ - go install $(GOMAKE) && go-make targets) - - # Include custom variables to modify behavior. ifneq ("$(wildcard Makefile.vars)","") include Makefile.vars @@ -13,20 +7,16 @@ else $(warning warning: please customize variables in Makefile.vars) endif +GOBIN ?= $(shell go env GOPATH)/bin +GOMAKE ?= github.com/tkrop/go-make@v0.0.10 +TARGETS := $(shell command -v go-make >/dev/null || \ + go install $(GOMAKE) && go-make targets) + +# Declare all targets phony to make them available for auto-completion. +.PHONY: $(TARGETS) -# Include standard targets from go-make providing group targets as well as -# single target targets. The group target is used to delegate the remaining -# request targets, while the single target can be used to define the -# precondition of custom target. -.PHONY: $(TARGETS) $(addprefix target/,$(TARGETS)) +# Delegate all targets to go-make in one call. +# TODO: consider solution that does not delegate local goals. $(eval $(lastwords $(MAKECMDGOALS)):;@:) -$(firstword $(MAKECMDGOALS)): +all $(firstword $(MAKECMDGOALS)):: $(GOBIN)/go-make $(MAKEFLAGS) $(MAKECMDGOALS); -$(addprefix target/,$(TARGETS)): target/%: - $(GOBIN)/go-make $(MAKEFLAGS) $*; - - -# Include custom targets to extend scripts. -ifneq ("$(wildcard Makefile.ext)","") - include Makefile.ext -endif diff --git a/VERSION b/VERSION new file mode 100644 index 0000000..8acdd82 --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.0.1 diff --git a/go.mod b/go.mod index 3c86ae9..b2b3693 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/h2non/gock v1.2.0 github.com/huandu/go-clone v1.6.0 github.com/stretchr/testify v1.8.4 - golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb + golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 golang.org/x/text v0.13.0 golang.org/x/tools v0.16.1 ) diff --git a/go.sum b/go.sum index c6e461d..ac43f78 100644 --- a/go.sum +++ b/go.sum @@ -33,8 +33,8 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb h1:c0vyKkb6yr3KR7jEfJaOSv4lG7xPkbN6r52aJz1d8a8= -golang.org/x/exp v0.0.0-20231206192017-f3f8817b8deb/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848 h1:+iq7lrkxmFNBM7xx+Rae2W6uyPfhPeDWD+n+JgppptE= +golang.org/x/exp v0.0.0-20231219180239-dc181d75b848/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0= golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=