summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
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