Skip to content

Commit

Permalink
Update go build
Browse files Browse the repository at this point in the history
Signed-off-by: Zzde <[email protected]>
  • Loading branch information
zxh326 committed Jul 1, 2023
1 parent 42f2d30 commit 5963f62
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,25 @@ VERSION=$(shell git describe --tags --always)

releases: darwin-amd64 darwin-arm64 linux-amd64 linux-arm64 linux-armv6 linux-armv7

GOBUILD = CGO_ENABLED=0 go build -trimpath -ldflags "-extldflags=-static"

darwin-amd64:
GOOS=darwin GOARCH=amd64 go build -o $(NAME)-${VERSION}-$@
GOOS=darwin GOARCH=amd64 $(GOBUILD) -o $(NAME)-${VERSION}-$@
tar czf $(NAME)-${VERSION}-$@.tar.gz $(NAME)-${VERSION}-$@
darwin-arm64:
GOOS=darwin GOARCH=arm64 go build -o $(NAME)-${VERSION}-$@
GOOS=darwin GOARCH=arm64 $(GOBUILD) -o $(NAME)-${VERSION}-$@
tar czf $(NAME)-${VERSION}-$@.tar.gz $(NAME)-${VERSION}-$@
linux-amd64:
GOOS=linux GOARCH=amd64 go build -o $(NAME)-${VERSION}-$@
GOOS=linux GOARCH=amd64 $(GOBUILD) -o $(NAME)-${VERSION}-$@
tar czf $(NAME)-${VERSION}-$@.tar.gz $(NAME)-${VERSION}-$@
linux-arm64:
GOOS=linux GOARCH=arm64 go build -o $(NAME)-${VERSION}-$@
GOOS=linux GOARCH=arm64 $(GOBUILD) -o $(NAME)-${VERSION}-$@
tar czf $(NAME)-${VERSION}-$@.tar.gz $(NAME)-${VERSION}-$@
linux-armv6:
GOOS=linux GOARCH=arm GOARM=6 go build -o $(NAME)-${VERSION}-$@
GOOS=linux GOARCH=arm GOARM=6 $(GOBUILD) -o $(NAME)-${VERSION}-$@
tar czf $(NAME)-${VERSION}-$@.tar.gz $(NAME)-${VERSION}-$@
linux-armv7:
GOOS=linux GOARCH=arm GOARM=7 go build -o $(NAME)-${VERSION}-$@
GOOS=linux GOARCH=arm GOARM=7 $(GOBUILD) -o $(NAME)-${VERSION}-$@
tar czf $(NAME)-${VERSION}-$@.tar.gz $(NAME)-${VERSION}-$@

clean:
Expand Down

0 comments on commit 5963f62

Please sign in to comment.