From 5482c2dcf616b0c1cb196c4c575d31fbf275b086 Mon Sep 17 00:00:00 2001 From: Anna Kapuscinska Date: Fri, 12 Jul 2024 19:23:43 +0100 Subject: [PATCH] Makefile: Reduce the amount of vendoring calls When generating Go code for proto API or k8s CRDs, we don't need to run vendoring for all modules before and after. It should be enough if we run vendoring only for the relevant module (api or pkg/k8s) before, and only for the main module after. Signed-off-by: Anna Kapuscinska --- Makefile | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 39ff329adfc..33acde1a21d 100644 --- a/Makefile +++ b/Makefile @@ -355,9 +355,11 @@ codegen: | protogen protogen: protoc-gen-go-tetragon ## Generate code based on .proto files. # Need to call vendor twice here, once before and once after codegen the reason # being we need to grab changes first plus pull in whatever gets generated here. - $(MAKE) vendor + $(MAKE) -C api vendor $(MAKE) -C api - $(MAKE) vendor + $(GO) mod tidy + $(GO) mod vendor + $(GO) mod verify .PHONY: protoc-gen-go-tetragon protoc-gen-go-tetragon: @@ -368,15 +370,18 @@ generate: | crds crds: ## Generate kubebuilder files. # Need to call vendor twice here, once before and once after generate, the reason # being we need to grab changes first plus pull in whatever gets generated here. - $(MAKE) vendor - $(MAKE) -C pkg/k8s/ - $(MAKE) vendor + $(MAKE) -C pkg/k8s vendor + $(MAKE) -C pkg/k8s + $(MAKE) -C pkg/k8s vendor + $(GO) mod tidy + $(GO) mod vendor + $(GO) mod verify .PHONY: vendor vendor: ## Tidy and vendor Go modules. - $(MAKE) -C ./api vendor - $(MAKE) -C ./pkg/k8s vendor - $(MAKE) -C ./contrib/tetragon-rthooks vendor + $(MAKE) -C api vendor + $(MAKE) -C pkg/k8s vendor + $(MAKE) -C contrib/tetragon-rthooks vendor $(GO) mod tidy $(GO) mod vendor $(GO) mod verify