From 503e857fac2194e6f67528a8de3c487337922b44 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Sat, 5 Apr 2025 10:23:39 +0800 Subject: Makefile: Statically build Go --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5518d63..05e072c 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ VERSION = $(shell git describe --tags --always --dirty) SOURCE_FILES = $(shell git ls-files) forge: source.tar.gz hookc/hookc git2d/git2d $(MAN_PAGES:%=man/%.html) $(MAN_PAGES:%=man/%.txt) $(SOURCE_FILES) - go build -o forge -ldflags="-X 'main.VERSION=$(VERSION)'" . + CGO_ENABLED=0 go build -o forge -ldflags '-extldflags "-f no-PIC -static" -X "main.VERSION=$(VERSION)"' -tags 'osusergo netgo static_build' man/%.html: man/% mandoc -Thtml -O style=./mandoc.css $< > $@ -- cgit v1.2.3