-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
59 lines (48 loc) · 1.77 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# PKG := github.com/wtsi-hgi/go-farmer
# VERSION := $(shell git describe --tags --always --long --dirty)
# TAG := $(shell git describe --abbrev=0 --tags)
# LDFLAGS = -ldflags "-X ${PKG}/cmd.Version=${VERSION}"
export GOPATH := $(shell go env GOPATH)
PATH := ${PATH}:${GOPATH}/bin
default: install
build: export CGO_ENABLED = 0
build:
go build -o farmer -tags netgo ${LDFLAGS}
install: export CGO_ENABLED = 0
install:
@rm -f ${GOPATH}/bin/farmer
@go build -o ${GOPATH}/bin/farmer -tags netgo ${LDFLAGS}
@echo installed to ${GOPATH}/bin/farmer
test: export CGO_ENABLED = 0
test: export GOFARMER_SLOWTESTS = 0
test:
@go test -tags netgo --count 1 .
@go test -tags netgo --count 1 $(shell go list ./... | tail -n+2)
testslow: export CGO_ENABLED = 0
testslow: export GOFARMER_SLOWTESTS = 1
testslow:
@go test -tags netgo --count 1 .
@go test -tags netgo --count 1 $(shell go list ./... | tail -n+2)
race: export CGO_ENABLED = 1
race: export GOFARMER_SLOWTESTS = 1
race:
@go test -tags netgo -race --count 1 .
@go test -tags netgo -race --count 1 $(shell go list ./... | tail -n+2)
bench: export CGO_ENABLED = 1
bench:
go test -tags netgo --count 1 -run Bench -bench=. ./...
# curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.59.1
lint:
@golangci-lint run
clean:
@rm -f ./farmer
@rm -f ./dist.zip
# dist: export CGO_ENABLED = 0
# # go get -u github.com/gobuild/gopack
# # go get -u github.com/aktau/github-release
# dist:
# gopack pack --os linux --arch amd64 -o linux-dist.zip
# github-release release --tag ${TAG} --pre-release
# github-release upload --tag ${TAG} --name farmer-linux-x86-64.zip --file linux-dist.zip
# @rm -f farmer linux-dist.zip
.PHONY: test testslow race bench lint build install clean dist