diff --git a/.goreleaser.yml b/.goreleaser.yml index 5f68a1ed..db37208d 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -26,7 +26,7 @@ builds: - goos: freebsd goarch: 386 ldflags: - - -s -w -X github.com/evilmartians/lefthook/internal/version.commit={{.Commit}} + - -s -w -extldflags '-static' -X github.com/evilmartians/lefthook/internal/version.commit={{.Commit}} # Full lefthook binary - id: lefthook @@ -49,7 +49,7 @@ builds: - goos: freebsd goarch: 386 ldflags: - - -s -w -X github.com/evilmartians/lefthook/internal/version.commit={{.Commit}} + - -s -w -extldflags '-static' -X github.com/evilmartians/lefthook/internal/version.commit={{.Commit}} archives: - id: lefthook diff --git a/Makefile b/Makefile index e73c1409..192170d6 100644 --- a/Makefile +++ b/Makefile @@ -1,10 +1,10 @@ COMMIT_HASH = $(shell git rev-parse HEAD) build: - go build -ldflags "-s -w -X github.com/evilmartians/lefthook/internal/version.commit=$(COMMIT_HASH)" -o lefthook + go build -ldflags "-s -w -extldflags '-static' -X github.com/evilmartians/lefthook/internal/version.commit=$(COMMIT_HASH)" -o lefthook build-with-coverage: - go build -cover -ldflags "-s -w -X github.com/evilmartians/lefthook/internal/version.commit=$(COMMIT_HASH)" -o lefthook + go build -cover -ldflags "-s -w extldflags '-static' -X github.com/evilmartians/lefthook/internal/version.commit=$(COMMIT_HASH)" -o lefthook install: build cp lefthook $$(go env GOPATH)/bin