make: set CGO_ENABLED=0

Make loop and loopd binaries static, more portable.
This commit is contained in:
Boris Nagaev 2025-07-12 01:05:50 -03:00
parent 6b7158201a
commit b0051382cf
No known key found for this signature in database
2 changed files with 5 additions and 4 deletions

View file

@ -11,8 +11,8 @@ GOIMPORTS_PKG := github.com/rinchsan/gosimports/cmd/gosimports
GO_BIN := ${GOPATH}/bin
GOIMPORTS_BIN := $(GO_BIN)/gosimports
GOBUILD := GO111MODULE=on go build -v
GOINSTALL := GO111MODULE=on go install -v
GOBUILD := CGO_ENABLED=0 GO111MODULE=on go build -v
GOINSTALL := CGO_ENABLED=0 GO111MODULE=on go install -v
GOMOD := GO111MODULE=on go mod
COMMIT := $(shell git describe --abbrev=40 --dirty --tags)

View file

@ -98,8 +98,9 @@ for i in $SYS; do
cd $PACKAGE-$i-$TAG
echo "Building:" $OS $ARCH $ARM
env GOOS=$OS GOARCH=$ARCH GOARM=$ARM go build -v -ldflags "$COMMITFLAGS" github.com/lightninglabs/loop/cmd/loop
env GOOS=$OS GOARCH=$ARCH GOARM=$ARM go build -v -ldflags "$COMMITFLAGS" github.com/lightninglabs/loop/cmd/loopd
for bin in loop loopd; do
env CGO_ENABLED=0 GOOS=$OS GOARCH=$ARCH GOARM=$ARM go build -v -ldflags "$COMMITFLAGS" "github.com/lightninglabs/loop/cmd/$bin"
done
cd ..
if [[ $OS = "windows" ]]; then