-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
37 lines (25 loc) · 1.09 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
export GO111MODULE=on
VERSION=$(shell git describe --tags --always --dirty)
SOURCE_DIRS = cmd pkg internal
.PHONY: vendor vetcheck fmtcheck clean build gotest mod-clean
all: vendor vetcheck fmtcheck build gotest mod-clean
vendor:
go mod vendor
vetcheck:
go vet ./...
golangci-lint run -c .golangci.yml
fmtcheck:
@gofmt -l -s $(SOURCE_DIRS) | grep ".*\.go"; if [ "$$?" = "0" ]; then exit 1; fi
clean:
rm -r build/
build:
@go build -o build/nodemon -ldflags="-X 'nodemon/internal.version=$(VERSION)'" ./cmd/nodemon
gotest:
go test -cover -race -covermode=atomic ./...
mod-clean:
go mod tidy
build-bots-linux-amd64:
@CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o build/linux-amd64/nodemon-telegram -ldflags="-X 'nodemon/internal.version=$(VERSION)'" ./cmd/bots/telegram
@CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o build/linux-amd64/nodemon-discord -ldflags="-X 'nodemon/internal.version=$(VERSION)'" ./cmd/bots/discord
build-nodemon-linux-amd64:
@CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o build/linux-amd64/nodemon -ldflags="-X 'nodemon/internal.version=$(VERSION)'" ./cmd/nodemon