From eeb60ba0dfdb17b9445442c12307496c6fcd5289 Mon Sep 17 00:00:00 2001 From: Holger Obermaier <40787752+ho-ob@users.noreply.github.com> Date: Thu, 12 Mar 2026 11:39:43 +0100 Subject: [PATCH] Add target to build stripped executable --- Makefile | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Makefile b/Makefile index bae5fcf..412d72f 100644 --- a/Makefile +++ b/Makefile @@ -27,6 +27,17 @@ $(APP): $(GOSRC) go.mod $(GOBIN) get $(GOBIN) build -o $(APP) $(GOSRC_APP) +# -ldflags: +# -s : drops the OS symbol table +# -w : drops DWARF +# -> Panic stack traces still show function names and file:line +.PHONY: build-stripped +build-stripped: + make -C collectors + $(GOBIN) get + $(GOBIN) build -ldflags "-s -w" -trimpath -o $(APP) $(GOSRC_APP) + +.PHONY: install install: $(APP) @WORKSPACE=$(PREFIX) @if [ -z "$${WORKSPACE}" ]; then exit 1; fi