forked from cashapp/pivit
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
49 lines (44 loc) · 750 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
38
39
40
41
42
43
44
45
46
47
48
49
.PHONY: all
all: pivit
#
# pivit: build pivit binary locally for development
#
.PHONY: pivit
pivit:
CGO_ENABLED=1 go build ./cmd/pivit
#
# install: install pivit to $GOPATH/bin
#
.PHONY: install
install:
go install ./cmd/pivit
#
# release: build a possibly cross-compiled and compressed release binary
#
.PHONY: release
GOOS ?= $(shell go env GOOS)
GOARCH ?= $(shell go env GOARCH)
EXE = pivit-$(GOOS)-$(GOARCH)
release: pivit
(\
set -e ;\
cp -f pivit $(EXE) ;\
gzip -f -9 $(EXE) ;\
)
#
# test: run tests
#
.PHONY: test
test: pivit
(\
set -e ;\
go test -coverprofile=cover.out ./pkg/... ;\
file pivit ;\
./pivit --help 2> /dev/null ;\
)
#
# clean: remove locally built artifacts
#
.PHONY: clean
clean:
rm -rf ./pivit* ./cover.out