-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
60 lines (46 loc) · 1.21 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
.PHONY: build-arm build-linux build-mac clean cov fmt help vet test
## build-arm: build binary for ARM
build-arm:
export GO111MODULE=on
chmod u+x ./scripts/build
./scripts/build linux arm
## build-linux: build binary for Linux
build-linux:
export GO111MODULE=on
chmod u+x ./scripts/build
./scripts/build linux amd64
## build-mac: build binary for Mac
build-mac:
export GO111MODULE=on
chmod u+x ./scripts/build
./scripts/build darwin amd64
## clean: cleans the binary
clean:
@echo "Cleaning..."
@go clean
## cov: generates coverage report
cov:
@echo "Coverage..."
go test -cover ./...
## fmt: Go Format
fmt:
@echo "Gofmt..."
@if [ -n "$(gofmt -l .)" ]; then echo "Go code is not formatted"; exit 1; fi
## help: prints this help message
help:
@echo "Usage: \n"
@sed -n 's/^##//p' ${MAKEFILE_LIST} | column -t -s ':' | sed -e 's/^/ /'
## run-linux: Run locally with default configuration
run-linux: clean build-linux
./build/feederd-linux-amd64
## run-mac: Run locally with default configuration
run-mac: clean build-mac
./build/feederd-darwin-amd64
## vet: code analysis
vet:
@echo "Vet..."
@go vet ./...
## test: runs go unit test with default values
test: fmt
chmod u+x ./scripts/test
./scripts/test