diff options
author | Runxi Yu <me@runxiyu.org> | 2025-04-05 10:23:39 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-04-05 10:23:39 +0800 |
commit | 503e857fac2194e6f67528a8de3c487337922b44 (patch) | |
tree | 4fe4aa2237ee0bcb1dae26f257cd581adc1e32d9 | |
parent | Makefile: Note on GNUisms (diff) | |
download | forge-503e857fac2194e6f67528a8de3c487337922b44.tar.gz forge-503e857fac2194e6f67528a8de3c487337922b44.tar.zst forge-503e857fac2194e6f67528a8de3c487337922b44.zip |
Makefile: Statically build Go
-rw-r--r-- | Makefile | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 $< > $@ |