-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add script for building
majokko
binaries for multiple platforms.
- Loading branch information
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
dist/ | ||
majokko | ||
test.png | ||
test.zng | ||
test.jpg | ||
test.ppm | ||
test.bmp | ||
test.tif | ||
test.tga |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
GO="${GO:-go}" | ||
LDFLAGS="${LDFLAGS:--w -s}" | ||
|
||
echo "Using:" | ||
echo "GO='$GO'" | ||
echo "LDFLAGS='$LDFLAGS'" | ||
echo "" | ||
|
||
mkdir -p dist/ | ||
for cpu in amd64 386 arm arm64; do | ||
for os in windows linux darwin; do | ||
DISTFILE="dist/majokko-${os}-${cpu}" | ||
CMD="GOOS='${os}' GOARCH='${cpu}' ${GO} build -o '$DISTFILE' -ldflags '$LDFLAGS' -trimpath ." | ||
echo "= $CMD" | ||
eval "$CMD" && echo "+ $(du -hs "$DISTFILE")" || echo "- Error: ${os} on ${cpu}" | ||
done | ||
done |