From eefa64e2d4e785cfd5662a99dc299f2be5072ebf Mon Sep 17 00:00:00 2001 From: 6543 <6543@obermui.de> Date: Wed, 27 Dec 2023 13:01:56 +0100 Subject: [PATCH] Add build option to Makefile for removing static compile flags (#3026) this make it possible to remove one patch file from https://gitlab.alpinelinux.org/alpine/aports/-/tree/master/testing/woodpecker --- Makefile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6e8114790..008166ba1 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,11 @@ else endif endif -LDFLAGS := -s -w -extldflags "-static" -X go.woodpecker-ci.org/woodpecker/v2/version.Version=${VERSION} +LDFLAGS := -X go.woodpecker-ci.org/woodpecker/v2/version.Version=${VERSION} +STATIC_BUILD ?= true +ifeq ($(STATIC_BUILD),true) + LDFLAGS := -s -w -extldflags "-static" $(LDFLAGS) +endif CGO_ENABLED ?= 1 # only used to compile server HAS_GO = $(shell hash go > /dev/null 2>&1 && echo "GO" || echo "NOGO" )