Skip to content

Commit adbcd6e

Browse files
nikicatclaude
andcommitted
build: add GO_LDFLAGS variable to Makefile
Allows passing extra Go linker flags (e.g. -linkmode=external -s -w for distro packaging). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent cd1504a commit adbcd6e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,12 @@ embed-frontend: frontend
2020
# Version from git (fallback for untagged repos)
2121
VERSION := $(shell git describe --tags --always --dirty 2>/dev/null || echo "v0.0.0-g$$(git rev-parse --short HEAD)")
2222

23+
# Extra flags passed to the Go linker (e.g. "-linkmode=external -s -w")
24+
GO_LDFLAGS ?=
25+
2326
# Build the Go binary (includes embedded frontend)
2427
backend: embed-frontend
25-
go build -ldflags "-X main.version=$(VERSION)" -o secrets-dispatcher .
28+
go build -ldflags "-X main.version=$(VERSION) $(GO_LDFLAGS)" -o secrets-dispatcher .
2629

2730
# Build Go binary without embedded frontend (for dev/testing)
2831
# Outputs to .build/ to avoid overwriting ./secrets-dispatcher used by local service

0 commit comments

Comments
 (0)