1
0
Fork 0

add rudimentary go project template makefile

This commit is contained in:
ssube 2020-04-05 23:02:32 -05:00
parent f23f58a7a3
commit 4d19546c95
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
1 changed files with 30 additions and 0 deletions

30
Makefile Normal file
View File

@ -0,0 +1,30 @@
GOOS ?= linux
GOARCH ?= amd64
go-build:
go build ${BUILD_OPTS} -o bin/togo-${GOOS}-${GOARCH}
go-clean:
go clean -x
go-test: go-build
go test ${BUILD_OPTS} -cover ./...
git-push:
git push github
git push gitlab
bundle-all:
# generate hash file
echo "path bytes sha256" | tee ./bin/hashes
find ./bin/ -name "togo-*" -type f -printf '%p %s ' -exec sh -c 'sha256sum $$1 | cut -d " " -f 1;' find-exec {} \; \
| tee -a ./bin/hashes
# compress
tar -cvf bin/togo-all.tgz ./bin/*
gzip ./bin/togo-darwin-* || true
gzip ./bin/togo-linux-* || true
# do not gzip windows binaries
bundle-clean:
rm -v ./bin/hashes || true
rm -v ./bin/togo-* || true