-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathMakefile
37 lines (31 loc) · 892 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
PKG = github.com/yuuki/lsconntrack
COMMIT = $$(git describe --tags --always)
DATE = $$(date --utc '+%Y-%m-%d_%H:%M:%S')
BUILD_LDFLAGS = -X $(PKG).commit=$(COMMIT) -X $(PKG).date=$(DATE)
RELEASE_BUILD_LDFLAGS = -s -w $(BUILD_LDFLAGS)
.PHONY: build
build:
go build -ldflags="$(BUILD_LDFLAGS)"
.PHONY: test
test:
go test -v ./...
.PHONY: cover
cover: devel-deps
goveralls -service=travis-ci
.PHONY: devel-deps
devel-deps:
go get golang.org/x/tools/cmd/cover
go get github.com/mattn/goveralls
go get github.com/motemen/gobump
go get github.com/Songmu/ghch
go get github.com/Songmu/goxz
go get github.com/tcnksm/ghr
.PHONY: crossbuild
crossbuild: devel-deps
$(eval ver = $(shell gobump show -r))
goxz -pv=v$(ver) -os=linux -arch=386,amd64 -build-ldflags="$(RELEASE_BUILD_LDFLAGS)" \
-d=./dist/v$(ver)
.PHONY: release
release: devel-deps
_tools/release
_tools/upload_artifacts