summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorTyler Cipriani <tcipriani@wikimedia.org>2018-05-24 11:46:02 -0600
committerTyler Cipriani <tcipriani@wikimedia.org>2018-05-24 12:15:05 -0600
commitb0e3e7d8a55f1fd77625880853c156811ff007dc (patch)
treeefb7955f0bfeaeb30ceba7681aaca3f188591fa8 /Makefile
parent798f96381057f4b2ebf4ba08852da8d976c62502 (diff)
downloadblubber-b0e3e7d8a55f1fd77625880853c156811ff007dc.tar.gz
Cross-compile using gox
Reviewers: dduvall, #release-engineering-team Reviewed By: dduvall, #release-engineering-team Tags: #release-engineering-team Differential Revision: https://phabricator.wikimedia.org/D1059
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile12
1 files changed, 11 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index cb06b90..9a73549 100644
--- a/Makefile
+++ b/Makefile
@@ -1,3 +1,6 @@
+RELEASE_DIR ?= ./_release
+TARGETS ?= darwin/amd64 linux/amd64 linux/386 linux/arm linux/arm64 linux/ppc64le windows/amd64 plan9/amd64
+
PACKAGE := phabricator.wikimedia.org/source/blubber
GO_LDFLAGS := \
@@ -7,4 +10,11 @@ GO_LDFLAGS := \
install:
go install -v -ldflags "$(GO_LDFLAGS)"
-.PHONY: install
+release:
+ gox -output="$(RELEASE_DIR)/{{.OS}}-{{.Arch}}/{{.Dir}}" -osarch='$(TARGETS)' -ldflags '$(GO_LDFLAGS)' $(PACKAGE)
+ cp LICENSE "$(RELEASE_DIR)"
+ for f in "$(RELEASE_DIR)"/*/blubber; do \
+ shasum -a 256 "$${f}" | awk '{print $$1}' > "$${f}.sha256"; \
+ done
+
+.PHONY: install release