This repository was archived by the owner on Feb 2, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
39 lines (34 loc) · 1.51 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
.PHONY: default
default: build
APP=sbanken
VERSION=1.6.0
## build: build binaries and generate checksums
build:
mkdir dist/${VERSION}
GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -a -ldflags '-s -w' -trimpath -installsuffix cgo -o ${APP} cmd/sbanken/main.go
tar -czvf ${APP}_${VERSION}_linux_amd64.tar.gz ${APP}
GOOS=darwin GOARCH=amd64 CGO_ENABLED=0 go build -a -ldflags '-s -w' -trimpath -installsuffix cgo -o ${APP} cmd/sbanken/main.go
tar -czvf ${APP}_${VERSION}_darwin_amd64.tar.gz ${APP}
GOOS=windows GOARCH=amd64 CGO_ENABLED=0 go build -a -ldflags '-s -w' -trimpath -installsuffix cgo -o ${APP}.exe cmd/sbanken/main.go
tar -czvf ${APP}_${VERSION}_windows_amd64.tar.gz ${APP}.exe
md5sum ${APP}_${VERSION}_linux_amd64.tar.gz > ${APP}_${VERSION}_checksums.txt
md5sum ${APP}_${VERSION}_darwin_amd64.tar.gz >> ${APP}_${VERSION}_checksums.txt
md5sum ${APP}_${VERSION}_windows_amd64.tar.gz >> ${APP}_${VERSION}_checksums.txt
mv ${APP}_${VERSION}_linux_amd64.tar.gz dist/${VERSION}/
mv ${APP}_${VERSION}_darwin_amd64.tar.gz dist/${VERSION}/
mv ${APP}_${VERSION}_windows_amd64.tar.gz dist/${VERSION}/
mv ${APP}_${VERSION}_checksums.txt dist/${VERSION}/
rm ${APP} ${APP}.exe
.PHONY: run
## run: Run sbanken (set SBANKEN_CONFIG=path/to/config.yaml)
run:
go run -race cmd/sbanken/main.go --config=$(SBANKEN_CONFIG)
.PHONY: test
## test: Run the tests
test:
go test -race -v ./...
.PHONY: help
## help: Print this help message
help:
@echo "Usage: \n"
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'