From 5b173095f1a5a7d7754450ba86a029c985f43577 Mon Sep 17 00:00:00 2001 From: Luxferre Date: Mon, 23 Mar 2026 09:42:16 +0200 Subject: [PATCH] Optimized build --- Makefile | 8 +++++--- README.md | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index a4644a9..2504709 100644 --- a/Makefile +++ b/Makefile @@ -8,10 +8,12 @@ TUI_SRC = ./cmd/sidekick-tui MCP_SRC = ./cmd/sidekick-mcp TUI_BIN = $(BIN_DIR)/sidekick-tui MCP_BIN = $(BIN_DIR)/sidekick-mcp +GOFLAGS ?= -a -trimpath -gcflags=all="-l -B -e" +LDFLAGS ?= -s -w .PHONY: all build test clean install uninstall fmt -all: build +all: clean fmt build fmt: @./fmt.sh @@ -19,8 +21,8 @@ fmt: build: @mkdir -p $(BIN_DIR) - go build -o $(TUI_BIN) $(TUI_SRC) - go build -o $(MCP_BIN) $(MCP_SRC) + go build $(GOFLAGS) -ldflags "$(LDFLAGS)" -o $(TUI_BIN) $(TUI_SRC) + go build $(GOFLAGS) -ldflags "$(LDFLAGS)" -o $(MCP_BIN) $(MCP_SRC) test: go test -v ./... diff --git a/README.md b/README.md index c529c0a..c04ce08 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ Or manually: ```bash git clone https://codeberg.org/luxferre/Sidekick.git cd Sidekick -go build -o bin/sidekick-tui ./cmd/sidekick-tui +go build -a -trimpath -gcflags=all="-l -B -e" -ldflags "-s -w" -o bin/sidekick-tui ./cmd/sidekick-tui ``` ## Configuration @@ -165,7 +165,7 @@ user's request and delegate tasks accordingly. ### Running the Sidekick MCP server -Sidekick can also act as an MCP server, allowing other LLM-powered applications to leverage its agentic capabilities. +Sidekick can also act as an MCP server, allowing other LLM-powered applications to leverage its agentic capabilities. It is built alongside the TUI using `make`. 1. Configure the `mcp_listener` in `config.toml`: