From 3a253c6cd7f853015ff8ec260186b9eca1767e9e Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Fri, 19 Jan 2024 15:38:43 +0100 Subject: [PATCH] Makefile: allow to build without GRPC_BACKENDS (#1607) --- Makefile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index ec9ca01f..23fcd536 100644 --- a/Makefile +++ b/Makefile @@ -153,6 +153,10 @@ ifeq ($(GRPC_BACKENDS),) GRPC_BACKENDS=$(ALL_GRPC_BACKENDS) endif +ifeq ($(BUILD_API_ONLY),true) + GRPC_BACKENDS= +endif + .PHONY: all test build vendor all: help @@ -290,17 +294,17 @@ clean: ## Remove build related file rm -rf ./sources rm -rf $(BINARY_NAME) rm -rf release/ + rm -rf backend-assets $(MAKE) -C backend/cpp/grpc clean $(MAKE) -C backend/cpp/llama clean ## Build: -build: grpcs prepare ## Build the project +build: backend-assets grpcs prepare ## Build the project $(info ${GREEN}I local-ai build info:${RESET}) $(info ${GREEN}I BUILD_TYPE: ${YELLOW}$(BUILD_TYPE)${RESET}) $(info ${GREEN}I GO_TAGS: ${YELLOW}$(GO_TAGS)${RESET}) $(info ${GREEN}I LD_FLAGS: ${YELLOW}$(LD_FLAGS)${RESET}) - CGO_LDFLAGS="$(CGO_LDFLAGS)" $(GOCMD) build -ldflags "$(LD_FLAGS)" -tags "$(GO_TAGS)" -o $(BINARY_NAME) ./ dist: build @@ -441,6 +445,12 @@ test-extra: prepare-test-extra $(MAKE) -C backend/python/transformers test $(MAKE) -C backend/python/diffusers test +backend-assets: + mkdir -p backend-assets +ifeq ($(BUILD_API_ONLY),true) + touch backend-assets/keep +endif + backend-assets/grpc: mkdir -p backend-assets/grpc