Skip to content

Commit

Permalink
GOX is dead. Long live GOX
Browse files Browse the repository at this point in the history
  • Loading branch information
ishuah committed May 4, 2024
1 parent 1f336e6 commit c86c420
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
SHELL = bash
OSARCHES := "darwin/amd64 linux/386 linux/amd64 linux/arm linux/arm64 linux/ppc64 linux/ppc64le linux/s390x"
DARWIN_ARCHES = amd64 arm64
LINUX_ARCHES = 386 amd64 arm arm64 ppc64 ppc64le s390x
OUTPUT := "build/bifrost-$(VERSION)-{{.OS}}-{{.Arch}}/bifrost"


Expand Down Expand Up @@ -34,6 +36,16 @@ build_all:
if [ -d "build/" ]; then \
rm -rf build/*; \
fi
gox -osarch=$(OSARCHES) -output=$(OUTPUT) # add -cgo flag when building on MacOS
# Build Darwin first
for arch in $(DARWIN_ARCHES); do \
echo $$arch; \
GOOS=darwin GOARCH=$$arch go build -o "build/bifrost-$(VERSION)-darwin-$$arch/bifrost"; \
done

# Build Linux
for arch in $(LINUX_ARCHES); do \
echo $$arch; \
GOOS=linux GOARCH=$$arch go build -o "build/bifrost-$(VERSION)-linux-$$arch/bifrost"; \
done
echo "compressing build files"
cd build && for d in */; do filepath=$${d%/*}; echo $$filepath; zip "$${filepath##*/}.zip" "$${filepath##*/}/bifrost"; done

0 comments on commit c86c420

Please sign in to comment.