-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
53 lines (39 loc) · 974 Bytes
/
Makefile
File metadata and controls
53 lines (39 loc) · 974 Bytes
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
# Makefile for NVCF CLI
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOVET=$(GOCMD) vet
BINARY_NAME=nvcf
GOFILES=$(shell find . -name '*.go' -not -path "./vendor/*")
# Linting
GOLINT=golangci-lint
.PHONY: all build clean test vet lint fmt q
all: build
build:
$(GOBUILD) -o $(BINARY_NAME)
clean:
$(GOCLEAN)
rm -f $(BINARY_NAME)
test:
$(GOTEST) ./...
vet:
$(GOVET) ./...
lint:
$(GOLINT) run
fmt:
gofmt -s -w $(GOFILES)
# Installs golangci-lint
install-lint:
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.54.2
# Runs all checks
check: fmt vet lint test
# Builds for multiple platforms
build-all:
GOOS=linux GOARCH=amd64 $(GOBUILD) -o $(BINARY_NAME)-linux-amd64
GOOS=darwin GOARCH=amd64 $(GOBUILD) -o $(BINARY_NAME)-darwin-amd64
GOOS=windows GOARCH=amd64 $(GOBUILD) -o $(BINARY_NAME)-windows-amd64.exe
q:
make clean
make build