From 1fcef7f3642a9669f0b1c114c74eb15abba666e1 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 27 Feb 2026 12:41:19 +0100 Subject: [PATCH 1/3] build: make do.build.parallel PHONY Target do.buil.parallel should have been declared phony but wasn't. This change fixes that. Signed-off-by: Michael Adam --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index a432507df..ac7ab0523 100644 --- a/Makefile +++ b/Makefile @@ -127,6 +127,7 @@ build.common: build.version helm.build mod.check crds gen-rbac do.build.platform.%: @$(MAKE) PLATFORM=$* go.build +.PHONY: do.build.parallel do.build.parallel: $(foreach p,$(PLATFORMS_TO_BUILD_FOR), do.build.platform.$(p)) build: build.common ## Only build for linux platform From a1f3a03e7326f1dacd27d0e12759779246768b73 Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 27 Feb 2026 12:47:22 +0100 Subject: [PATCH 2/3] build: make mod.check and mod.update phony make targets mod.check and mod.update should habve been phony but weren't. This change fixes that. Signed-off-by: Michael Adam --- Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Makefile b/Makefile index ac7ab0523..1c60c2ca2 100644 --- a/Makefile +++ b/Makefile @@ -207,7 +207,10 @@ gen.codegen: codegen codegen: ${CODE_GENERATOR} ## Run code generators. @build/codegen/codegen.sh +.PHONY: mod.check mod.check: go.mod.check ## Check if any go modules changed. + +.PHONY: mod.update mod.update: go.mod.update ## Update all go modules. clean: ## Remove all files that are created by building. From 2f6b7531a604ac44c08d422bbac74081ae59c46d Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Fri, 27 Feb 2026 18:42:32 +0100 Subject: [PATCH 3/3] build: reorganize PHONY target declarations most phony targets in the Makefile were declared phony by grouping multiple targets in long combined .PHONY statements which obfuscates the phony nature of a target to some extent. This change makes the phony target declarations a bit more obvious and explicit by prepending each phony target by a corresponding individual .PHONY statement and removing the confusing combined .PHONY line. Signed-off-by: Michael Adam --- Makefile | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 1c60c2ca2..95d90cb70 100644 --- a/Makefile +++ b/Makefile @@ -118,6 +118,7 @@ build.version: @mkdir -p $(OUTPUT_DIR) @echo "$(VERSION)" > $(OUTPUT_DIR)/version +.PHONY: build.common build.common: export SKIP_GEN_CRD_DOCS=true build.common: build.version helm.build mod.check crds gen-rbac @$(MAKE) go.init @@ -130,10 +131,12 @@ do.build.platform.%: .PHONY: do.build.parallel do.build.parallel: $(foreach p,$(PLATFORMS_TO_BUILD_FOR), do.build.platform.$(p)) +.PHONY: build build: build.common ## Only build for linux platform @$(MAKE) go.build PLATFORM=linux_$(GOARCH) @$(MAKE) -C images PLATFORM=linux_$(GOARCH) +.PHONY: build.all build.all: build.common ## Build source code for all platforms. ifneq ($(GOHOSTARCH),amd64) $(error cross platform image build only supported on amd64 host currently) @@ -141,6 +144,7 @@ endif @$(MAKE) do.build.parallel @$(MAKE) -C images build.all +.PHONY: install install: build.common @$(MAKE) go.install @@ -154,10 +158,12 @@ test: ## Runs unit tests. test-integration: ## Runs integration tests. @$(MAKE) go.test.integration +.PHONY: vet vet: ## Runs lint checks on go sources. @$(MAKE) go.init @$(MAKE) go.vet +.PHONY: fmt fmt: $(YQ) ## Check formatting of go sources. @$(MAKE) go.fmt @@ -180,7 +186,6 @@ yamllint: yamllint -c .yamllint deploy/examples/ --no-warnings .PHONY: helm.lint - helm.lint: ## Check the helm charts ct lint --charts=./deploy/charts/rook-ceph,./deploy/charts/rook-ceph-cluster --validate-yaml=false --validate-maintainers=false helm -n rook-ceph template deploy/charts/rook-ceph > templated.yaml @@ -203,7 +208,9 @@ checkmake: shellcheck: shellcheck --severity=warning --format=gcc --shell=bash $(shell find $(ROOT_DIR) -type f -name '*.sh') build/reset build/sed-in-place +.PHONY: gen.codegen gen.codegen: codegen +.PHONY: codegen codegen: ${CODE_GENERATOR} ## Run code generators. @build/codegen/codegen.sh @@ -213,33 +220,42 @@ mod.check: go.mod.check ## Check if any go modules changed. .PHONY: mod.update mod.update: go.mod.update ## Update all go modules. +.PHONY: clean clean: ## Remove all files that are created by building. @$(MAKE) helm.dependency.clean @$(MAKE) go.mod.clean @$(MAKE) -C images clean @rm -fr $(OUTPUT_DIR) $(WORK_DIR) +.PHONY: distclean distclean: clean ## Remove all files that are created by building or configuring. @rm -fr $(CACHE_DIR) +.PHONY: prune prune: ## Prune cached artifacts. @$(MAKE) -C images prune +.PHONY: gen.crds gen.crds: crds +.PHONY: crds crds: $(CONTROLLER_GEN) $(YQ) @echo Updating CRD manifests @build/crds/build-crds.sh $(CONTROLLER_GEN) $(YQ) @GOBIN=$(GOBIN) build/crds/generate-crd-docs.sh +.PHONY: gen.rbac gen.rbac: gen-rbac +.PHONY: gen-rbac gen-rbac: $(HELM) $(YQ) helm.dependency.build ## Generate RBAC from Helm charts @# output only stdout to the file; stderr for debugging should keep going to stderr HELM=$(HELM) ./build/rbac/gen-common.sh HELM=$(HELM) ./build/rbac/gen-nfs-rbac.sh +.PHONY: gen.docs gen.docs: docs ## generate docs .PHONY: docs docs: helm-docs ## generate documentation +.PHONY: gen.helm-docs gen.helm-docs: helm-docs helm-docs: $(HELM_DOCS) ## Use helm-docs to generate documentation from helm charts $(HELM_DOCS) -c deploy/charts/rook-ceph \ @@ -257,15 +273,15 @@ docs-preview: ## Preview the documentation through mkdocs docs-build: ## Build the documentation to the `site/` directory mkdocs build --strict +.PHONY: gen.crd-docs gen.crd-docs: generate-docs-crds generate-docs-crds: ## Build the documentation for CRD @GOBIN=$(GOBIN) build/crds/generate-crd-docs.sh +.PHONY: generate generate: gen.codegen gen.crds gen.rbac gen.docs gen.crd-docs ## Update all generated files (code, manifests, charts, and docs). -.PHONY: all build.common -.PHONY: build build.all install test check vet fmt codegen gen.codegen gen.rbac gen.crds gen.crd-docs gen.docs gen.helm-docs generate mod.check clean distclean prune # ==================================================================================== # Help