From a152beec49b4f4270ec8b734592f2bc1a2f7d3c9 Mon Sep 17 00:00:00 2001 From: Christian Goll Date: Wed, 20 Sep 2023 15:01:23 +0200 Subject: [PATCH] do not download protobuf stuff on offline builds Signed-off-by: Christian Goll --- Makefile | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 568d3312..bb3b101f 100644 --- a/Makefile +++ b/Makefile @@ -151,15 +151,16 @@ reference: wwctl latexpdf: reference make -C userdocs latexpdf - -proto = internal/pkg/api/routes/wwapiv1/routes.pb.go \ +ifndef OFFLINE_BUILD +protofiles = internal/pkg/api/routes/wwapiv1/routes.pb.go \ internal/pkg/api/routes/wwapiv1/routes.pb.gw.go \ internal/pkg/api/routes/wwapiv1/routes_grpc.pb.go .PHONY: proto -proto: $(proto) + +proto: $(protofiles) routes_proto = internal/pkg/api/routes/v1/routes.proto -internal/pkg/api/routes/wwapiv1/%.go: $(PROTOC) $(PROTOC_GEN_GRPC_GATEWAY) $(PROTOC_GEN_GO) $(PROTOC_GEN_GO_GRPC) $(routes_proto) +$(protofiles): $(routes_proto) $(PROTOC) $(PROTOC_GEN_GRPC_GATEWAY) $(PROTOC_GEN_GO) $(PROTOC_GEN_GO_GRPC) PATH=$(TOOLS_BIN):$(PATH) $(PROTOC) \ -I /usr/include -I $(shell dirname $(routes_proto)) -I=. \ --grpc-gateway_opt logtostderr=true \ @@ -168,9 +169,11 @@ internal/pkg/api/routes/wwapiv1/%.go: $(PROTOC) $(PROTOC_GEN_GRPC_GATEWAY) $(PRO --grpc-gateway_out=. \ routes.proto +endif + .PHONY: cleanproto cleanproto: - rm -f $(proto) + rm -f $(protofiles) .PHONY: cleanconfig cleanconfig: