Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ TMPDIR ?= /tmp
# Setup default go-make installation flags.
INSTALL_FLAGS ?= -mod=readonly -buildvcs=auto
# Setup go-make version to use desired build and config scripts.
GOMAKE_DEP ?= github.com/tkrop/go-make@v0.0.169
GOMAKE_DEP ?= github.com/tkrop/go-make@v0.0.170
# Request targets from go-make show-targets target.
TARGETS := $(shell command -v $(GOBIN)/go-make >/dev/null || \
$(GO) install $(INSTALL_FLAGS) $(GOMAKE_DEP) >&2 && \
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.0.169
0.0.170
2 changes: 1 addition & 1 deletion config/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ TMPDIR ?= /tmp
# Setup default go-make installation flags.
INSTALL_FLAGS ?= -mod=readonly -buildvcs=auto
# Setup go-make version to use desired build and config scripts.
GOMAKE_DEP ?= github.com/tkrop/go-make@v0.0.169
GOMAKE_DEP ?= github.com/tkrop/go-make@v0.0.170
# Request targets from go-make show-targets target.
TARGETS := $(shell command -v $(GOBIN)/go-make >/dev/null || \
$(GO) install $(INSTALL_FLAGS) $(GOMAKE_DEP) >&2 && \
Expand Down
42 changes: 25 additions & 17 deletions config/Makefile.base
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,9 @@ LD_FLAGS_LINUX ?= $(strip -s -w $(LDFLAGS))
TESTFLAGS ?=
TEST_FLAGS ?= $(strip $(mod-readonly) -count=1 -race $(TESTFLAGS))
BUILDFLAGS ?= # -linkmode 'external' -extldflags '-static'
BUILD_FLAGS ?= $(strip $(mod-readonly) -buildvcs=auto -trimpath $(BUILDFLAGS))
BUILD_FLAGS ?= $(strip $(mod-readonly) -trimpath $(BUILDFLAGS))
INSTALLFLAGS ?=
INSTALL_FLAGS ?= $(strip $(mod-readonly) -buildvcs=auto $(INSTALLFLAGS))
INSTALL_FLAGS ?= $(strip $(mod-readonly) $(INSTALLFLAGS))

# Find container image command (docker, podman, or colima).
find-cmd-image := $(shell command -v docker || \
Expand Down Expand Up @@ -177,7 +177,7 @@ DIR_CACHE := $(abspath $(TMPDIR))/go-make-$(USER)$(DIR_REAL)
$(call cdebug,using DIR_CACHE [$(DIR_CACHE)])

# Setup go-make to use desired build and config scripts.
GOMAKE_DEP := github.com/tkrop/go-make@v0.0.169
GOMAKE_DEP := github.com/tkrop/go-make@v0.0.170
GOMAKE_PATH := $(GOPATH)/pkg/mod/$(GOMAKE_DEP)/config
GOMAKE_MAKEFILE := $(realpath $(firstword $(MAKEFILE_LIST)))
GOMAKE_CONFIG := $(patsubst %/,%,$(dir $(GOMAKE_MAKEFILE)))
Expand Down Expand Up @@ -393,10 +393,23 @@ GOLANGCI_VERSION ?= v2.5.0
# https://github.com/codacy/codacy-gorevive/blob/master/.tool_version
REVIVE_VERSION ?= v1.12.0

# Setup default variables for kubernetes code generation.
KUBE_APIS ?= $(shell FILES=($$($(call find-go,.,-path "*/apis/*/*/*.go"))); \
if [ -n "$${FILES}" ]; then grep -E "\+(kubebuilder|k8s)" "$${FILES[@]}" | \
sed "s|apis/[^/]*/[^/]*/[^/]*.go:.*|apis|" | sort --unique; \
fi)
KUBE_DIRS += $(strip $(KUBE_APIS:%/apis=%/clients) $(KUBE_APIS:%/apis=%/manifests))
$(call cdebug,using KUBE_DIRS [$(KUBE_DIRS)])
KUBE_SOURCES += $(strip $(shell $(call find-go,.,-name "mock_*_test.go" -o \
-name "mock_*.go" -o -name "$(FILE_DEEPCOPY)")) \
$(shell if [ -n "$(KUBE_DIRS)" ]; then $(call find-go,$(KUBE_DIRS),); fi))
SOURCES := $(filter-out $(KUBE_SOURCES),$(shell $(call find-go,.,)))
MODULES := $(shell echo $(SOURCES) | xargs -r dirname | sort --unique)

# Setup default tool command versions to be installed.
TOOL_MOCK ?= $(or $(shell awk '($$1 ~ "/mock$$") && ($$3 != "//") \
{ print $$1 }' go.mod 2>/dev/null),go.uber.org/mock)/mockgen
TOOLS_GO += $(TOOL_MOCK) \
TOOL_MOCKGEN ?= $(or $(shell awk '($$1 ~ "/mock$$") { print $$1 }' \
go.mod 2>/dev/null | head --line=1),go.uber.org/mock)/mockgen
TOOLS_GO += $(TOOL_MOCKGEN) \
github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_VERSION) \
github.com/zalando/zally/cli/zally \
golang.org/x/vuln/cmd/govulncheck \
Expand Down Expand Up @@ -569,10 +582,6 @@ $(call cdebug,using CODACY_PROJECT_TOKEN [$(CODACY_PROJECT_TOKEN)])
$(call cdebug,using CODACY_API_BASE_URL [$(CODACY_API_BASE_URL)])
$(call cdebug,using CODACY_REPORTER_VERSION [$(CODACY_REPORTER_VERSION)])

KUBE_APIS ?= $(shell FILES=($$($(call find-go,.,-path "*/apis/*/*/*.go"))); \
if [ -n "$${FILES}" ]; then grep -E "\+(kubebuilder|k8s)" "$${FILES[@]}" | \
sed "s|apis/[^/]*/[^/]*/[^/]*.go:.*|apis|" | sort --unique; \
fi)
UPDATE_KUBE_APIS ?= $(KUBE_APIS:%=update-kube/%)
$(call cdebug,using UPDATE_KUBE_APIS [$(UPDATE_KUBE_APIS)])
UPDATE_KUBE_TARGETS := install-deepcopy-gen install-client-gen \
Expand Down Expand Up @@ -623,13 +632,6 @@ run-token-link = \


# Setup default environment variables.
KUBE_DIRS += $(strip $(KUBE_APIS:%/apis=%/clients) $(KUBE_APIS:%/apis=%/manifests))
$(call cdebug,using KUBE_DIRS [$(KUBE_DIRS)])
KUBE_SOURCES += $(strip $(shell $(call find-go,.,-name "mock_*_test.go" -o \
-name "mock_*.go" -o -name "$(FILE_DEEPCOPY)")) \
$(shell if [ -n "$(KUBE_DIRS)" ]; then $(call find-go,$(KUBE_DIRS),); fi))
SOURCES := $(filter-out $(KUBE_SOURCES),$(shell $(call find-go,.,)))
MODULES := $(shell echo $(SOURCES) | xargs -r dirname | sort --unique)
COMMANDS := $(shell $(call find-go,.,-name "main.go") | xargs -r readlink -f | \
awk -F '/' '{ for ( field = NF-1; field > 0; field--) { \
if ($$field != "cmd") { print $$field; break; } \
Expand Down Expand Up @@ -2345,6 +2347,12 @@ debug-kube::
echo 'KUBE_SOURCES $(KUBE_SOURCES)'; \
echo 'KUBE_TARGETS $(KUBE_TARGETS)';

#@ debug the command environment variables.
debug-tools::
@echo 'TOOLS_GO $(TOOLS_GO)'; \
echo 'TOOLS_SH $(TOOLS_SH)'; \
echo 'TOOLS_NPM $(TOOLS_NPM)';

#@ debug the command environment variables.
debug-commands::
@echo 'COMMANDS $(COMMANDS)'; \
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/tkrop/go-make

go 1.25.6
go 1.25.7

require (
github.com/stretchr/testify v1.11.1
Expand Down
1 change: 1 addition & 0 deletions internal/make/fixtures/targets/go-make-std.out
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ debug-targets-run
debug-targets-test
debug-targets-uninstall
debug-targets-update
debug-tools
format
format-go
git-clean
Expand Down
1 change: 1 addition & 0 deletions internal/make/fixtures/targets/go-make-trace.out
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ debug-targets-run
debug-targets-test
debug-targets-uninstall
debug-targets-update
debug-tools
format
format-go
git-clean
Expand Down
1 change: 1 addition & 0 deletions internal/make/fixtures/targets/std.out
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ debug-targets-run
debug-targets-test
debug-targets-uninstall
debug-targets-update
debug-tools
format
format-go
git-clean
Expand Down
1 change: 1 addition & 0 deletions internal/make/fixtures/targets/trace.out
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ debug-targets-run
debug-targets-test
debug-targets-uninstall
debug-targets-update
debug-tools
format
format-go
git-clean
Expand Down
Loading