Skip to content

Commit

Permalink
Move binaries to bin/ dir, and use local xgo docker for linux/amd64 b…
Browse files Browse the repository at this point in the history
…uilds
  • Loading branch information
rcowham committed Mar 28, 2024
1 parent 522d2c2 commit b7119ca
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions cmd/log2sql/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,15 @@ build:
# go install github.com/crazy-max/xgo@latest
# Note that this will download and build the latest version of package from github - it won't build the local go
# repo. So you need to have published everything (and ensure tags are as desired) before doing this.
# Temp workaround for problem with xgo docker on M3 not building Linux amd64 - use local version.
# For details see: https://github.com/crazy-max/xgo/issues/124
dist:
~/go/bin/xgo -docker-image xgo:local -go latest --targets=linux/amd64 ${LINUX_LDFLAGS} github.com/rcowham/go-libp4dlog/cmd/log2sql
~/go/bin/xgo -go latest --targets=windows/amd64,darwin/amd64 ${LDFLAGS} github.com/rcowham/go-libp4dlog/cmd/log2sql
rm -f log2sql*amd64*.gz
-chmod +x log2sql*amd64*
gzip log2sql*amd64*
~/go/bin/xgo -docker-image xgo:local -go latest --targets=linux/amd64,linux/arm64 -out bin/log2sql ${LINUX_LDFLAGS} github.com/rcowham/go-libp4dlog/cmd/log2sql
# ~/go/bin/xgo -docker-image xgo:local -go latest --targets=darwin/arm64 -out bin/log2sql ${LINUX_LDFLAGS} github.com/rcowham/go-libp4dlog/cmd/log2sql
~/go/bin/xgo -go latest --targets=windows/amd64,windows/arm64,darwin/arm64,darwin/amd64 -out bin/log2sql ${LDFLAGS} github.com/rcowham/go-libp4dlog/cmd/log2sql
rm -f bin/log2sql*amd64*.gz bin/log2sql*arm64*.gz
-chmod +x bin/log2sql*amd64* bin/log2sql*arm64*
gzip bin/log2sql*amd64* bin/log2sql*arm64*

# Installs our project: copies binaries
install:
Expand Down

0 comments on commit b7119ca

Please sign in to comment.