From 81d47887ae82d46f1f1e5c9ca88209974c24c254 Mon Sep 17 00:00:00 2001 From: Andy Goldstein Date: Thu, 26 Oct 2017 10:45:06 -0400 Subject: [PATCH] Add 'make release' Add 'make release' that automatically creates tarballs for all CLI platforms in _output/release. It also creates a CHECKSUM file using sha256 sums. Finally, it displays the contents of the CHECKSUM file as well as the sha256sum of the CHECKSUM file. Signed-off-by: Andy Goldstein --- Makefile | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/Makefile b/Makefile index 19026dbd5..be76290ac 100644 --- a/Makefile +++ b/Makefile @@ -147,6 +147,29 @@ endif update: fmt @$(MAKE) shell CMD="-c 'hack/update-all.sh'" +release: all-tar-bin checksum + +checksum: + @cd _output/release; \ + sha256sum *.tar.gz > CHECKSUM; \ + cat CHECKSUM; \ + sha256sum CHECKSUM + +all-tar-bin: $(addprefix tar-bin-, $(CLI_PLATFORMS)) + +tar-bin-%: + @$(MAKE) ARCH=$* tar-bin + +tar-bin: build + mkdir -p _output/release + +# We do the subshell & wildcard ls so we can pick up $(BIN).exe for windows + (cd _output/bin/$(GOOS)/$(GOARCH) && ls $(BIN)*) | \ + tar \ + -C _output/bin/$(GOOS)/$(GOARCH) \ + --files-from=- \ + -zcf _output/release/$(BIN)-$(GOOS)-$(GOARCH).tar.gz + build-dirs: @mkdir -p _output/bin/$(GOOS)/$(GOARCH) @mkdir -p .go/src/$(PKG) .go/pkg .go/bin .go/std/$(GOOS)/$(GOARCH)