Skip to content

Commit

Permalink
chore: added -s -w to ldflags to generate stripped binaries without d…
Browse files Browse the repository at this point in the history
…ebug info
  • Loading branch information
MassiGy committed Jul 3, 2024
1 parent 795aa1f commit 6f61a35
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ ifeq ($(MACHINE),Windows_NT)
else
GOOS=${MACHINE} GOARCH=${ARCH} \
go build -ldflags \
"-X main.version=${VERSION} -X main.binary_name=${BINARY_NAME} -extldflags=-static"\
"-X main.version=${VERSION} -X main.binary_name=${BINARY_NAME} -extldflags=-static -s -w"\
-o bin/${BINARY_NAME} \
cmd/*.go
endif
Expand All @@ -75,7 +75,7 @@ win32_x86_release:

GOOS=windows GOARCH=386 \
go build -ldflags \
"-X main.version=${VERSION} -X main.binary_name=${BINARY_NAME}.exe -extldflags=-static" \
"-X main.version=${VERSION} -X main.binary_name=${BINARY_NAME}.exe -extldflags=-static -s -w" \
-o releases/win32_x86/${BINARY_NAME}.exe \
cmd/*.go

Expand All @@ -87,7 +87,7 @@ win32_amd64_release:

GOOS=windows GOARCH=amd64 \
go build -ldflags \
"-X main.version=${VERSION} -X main.binary_name=${BINARY_NAME}.exe -extldflags=-static" \
"-X main.version=${VERSION} -X main.binary_name=${BINARY_NAME}.exe -extldflags=-static -s -w" \
-o releases/win32_amd64/${BINARY_NAME}.exe \
cmd/*.go

Expand All @@ -99,7 +99,7 @@ linux_x86_release:

GOOS=linux GOARCH=386 \
go build -ldflags \
"-X main.version=${VERSION} -X main.binary_name=${BINARY_NAME} -extldflags=-static" \
"-X main.version=${VERSION} -X main.binary_name=${BINARY_NAME} -extldflags=-static -s -w" \
-o releases/linux_x86/${BINARY_NAME} \
cmd/*.go

Expand All @@ -110,7 +110,7 @@ linux_amd64_release:

GOOS=linux GOARCH=amd64 \
go build -ldflags \
"-X main.version=${VERSION} -X main.binary_name=${BINARY_NAME} -extldflags=-static" \
"-X main.version=${VERSION} -X main.binary_name=${BINARY_NAME} -extldflags=-static -s -w" \
-o releases/linux_amd64/${BINARY_NAME} \
cmd/*.go

Expand All @@ -123,7 +123,7 @@ osx_x86_release:

GOOS=darwin GOARCH=386 \
go build -ldflags \
"-X main.version=${VERSION} -X main.binary_name=${BINARY_NAME} -extldflags=-static"\
"-X main.version=${VERSION} -X main.binary_name=${BINARY_NAME} -extldflags=-static -s -w"\
-o releases/osx_x86/${BINARY_NAME} \
cmd/*.go

Expand All @@ -134,7 +134,7 @@ osx_amd64_release:

GOOS=darwin GOARCH=amd64 \
go build -ldflags \
"-X main.version=${VERSION} -X main.binary_name=${BINARY_NAME} -extldflags=-static" \
"-X main.version=${VERSION} -X main.binary_name=${BINARY_NAME} -extldflags=-static -s -w" \
-o releases/osx_amd64/${BINARY_NAME} \
cmd/*.go

Expand Down

0 comments on commit 6f61a35

Please sign in to comment.