-
Notifications
You must be signed in to change notification settings - Fork 385
/
Makefile
45 lines (32 loc) · 815 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
BINARY="comcast"
VERSION=1.0.0
BUILD=`date +%FT%T%z`
DIR=bin
PACKAGES=`go list ./... | grep -v /vendor/`
VETPACKAGES=`go list ./... | grep -v /vendor/ | grep -v /examples/`
GOFILES=`find . -name "*.go" -type f -not -path "./vendor/*"`
default:
@mkdir ${DIR}
@go build -o ${DIR}/${BINARY} -tags=jsoniter
list:
@echo ${PACKAGES}
@echo ${VETPACKAGES}
@echo ${GOFILES}
fmt:
@gofmt -s -w ${GOFILES}
fmt-check:
@diff=?(gofmt -s -d $(GOFILES)); \
if [ -n "$$diff" ]; then \
echo "Please run 'make fmt' and commit the result:"; \
echo "$${diff}"; \
exit 1; \
fi;
install:
@govendor sync -v
test:
@go test -cpu=1,2,4 -v -tags integration ./...
vet:
@go vet $(VETPACKAGES)
clean:
@if [ -f${DIR}/${BINARY} ] ; then rm -rf ${DIR} ; fi
.PHONY: default fmt fmt-check install test vet docker clean