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" )