-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
39 lines (30 loc) · 1022 Bytes
/
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
VERSION=`git describe --tags`
BUILDTIME=`date -u +%a,\ %d\ %b\ %Y\ %H:%M:%S\ GMT`
BINARY=s3sync
all:
go build ${LDFLAGS} -o ${BINARY} .
dev:
go fmt .
go vet .
install: dev
go install .
release: dev
GOOS=linux GOARCH=amd64 go build -o ${BINARY}_linux ${LDFLAGS} .
GOOS=windows GOARCH=amd64 go build -o ${BINARY}_windows ${LDFLAGS} .
GOOS=darwin GOARCH=amd64 go build -o ${BINARY}_darwin ${LDFLAGS} .
clean:
if [ -f ${BINARY} ] ; then rm ${BINARY} ; fi
if [ -f ${BINARY}_linux ] ; then rm ${BINARY}_linux ; fi
if [ -f ${BINARY}_windows ] ; then rm ${BINARY}_windows ; fi
if [ -f ${BINARY}_darwin ] ; then rm ${BINARY}_darwin ; fi
test: dev
go test -v -race .
# install errcheck with `go get -u github.com/kisielk/errcheck`
errcheck -ignoretests .
# install golint with `go get -u github.com/golang/lint/golint`
golint .
# install varcheck with `go get -u github.com/opennota/check/cmd/varcheck`
varcheck .
cover: dev
go test -covermode=count -coverprofile=cover.out .
go tool cover -html=cover.out