This repository was archived by the owner on Nov 5, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
60 lines (48 loc) · 1.3 KB
/
Makefile
File metadata and controls
60 lines (48 loc) · 1.3 KB
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
60
VERSION = $(shell gobump show -r)
CURRENT_REVISION = $(shell git rev-parse --short HEAD)
BUILD_LDFLAGS = "-X github.com/a-know/pi.revision=$(CURRENT_REVISION)"
ifdef update
u=-u
endif
GO ?= GO111MODULE=on go
.PHONY: deps
deps:
env GO111MODULE=on go mod download
.PHONY: devel-deps
devel-deps: deps
$(GO) get ${u} \
golang.org/x/lint/golint \
github.com/rakyll/gotest \
github.com/x-motemen/gobump \
github.com/Songmu/goxz/cmd/goxz \
github.com/Songmu/ghch/cmd/ghch \
github.com/tcnksm/ghr
.PHONY: test
test: devel-deps
gotest -v -cover .
.PHONY: citest
citest: deps
$(GO) test
.PHONY: lint
lint: devel-deps
$(GO) vet
golint -set_exit_status
.PHONY: build
build: deps
$(GO) build -ldflags=$(BUILD_LDFLAGS) ./cmd/pi
.PHONY: crossbuild
crossbuild: devel-deps
env GO111MODULE=on goxz -pv=v$(shell gobump show -r) -build-ldflags=$(BUILD_LDFLAGS) \
-os=linux,darwin,freebsd -arch=amd64 -d=./dist/v$(shell gobump show -r) \
./cmd/pi
env GO111MODULE=on goxz -pv=v$(shell gobump show -r) -build-ldflags=$(BUILD_LDFLAGS) \
-os=windows -arch=amd64 -d=./dist/v$(shell gobump show -r) \
-o=pi.exe ./cmd/pi
.PHONY: bump
bump: devel-deps
_tools/releng
.PHONY: upload
upload:
ghr v$(VERSION) dist/v$(VERSION)
.PHONY: release
release: bump crossbuild upload