From 59c8de0101132c278cca3382112e2a180e2ab857 Mon Sep 17 00:00:00 2001 From: Runxi Yu Date: Mon, 17 Feb 2025 16:36:02 +0800 Subject: [PATCH] Makefile: Compile static Go binary --- Makefile | 2 +- diff --git a/Makefile b/Makefile index bda106dff0128183c7be699824f8e653af87b909..5e4d9f405e2ef5cdeb7e3c5ad511148e132ee885 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,7 @@ CFLAGS = -Wall -Wextra -Werror -pedantic -std=c99 -D_GNU_SOURCE forge: $(filter-out forge,$(wildcard *)) version.go git_hooks_client/*.c git_hooks_client/git_hooks_client go mod vendor - go build -o $@ + CGO_ENABLED=0 go build -o $@ -ldflags '-extldflags "-f no-PIC -static"' -tags 'osusergo netgo static_build' . git_hooks_client/git_hooks_client: -- 2.48.1