-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (38 loc) · 968 Bytes
/
Copy pathMakefile
File metadata and controls
49 lines (38 loc) · 968 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
# Go parameters
GOCMD=go
GOBUILD=$(GOCMD) build
GOCLEAN=$(GOCMD) clean
GOTEST=$(GOCMD) test
GOGET=$(GOCMD) get
GOMOD=$(GOCMD) mod
BINARY_NAME=ectolinq
# Linter
GOLINT=golangci-lint
.PHONY: all build clean test coverage lint fmt mod-tidy help
all: build
build:
$(GOBUILD) -o $(BINARY_NAME) -v
clean:
$(GOCLEAN)
rm -f $(BINARY_NAME)
test:
$(GOTEST) -v ./...
coverage:
$(GOTEST) -v -coverprofile=coverage.out ./...
$(GOCMD) tool cover -html=coverage.out -o coverage.html
lint:
$(GOLINT) run
fmt:
$(GOCMD) fmt ./...
mod-tidy:
$(GOMOD) tidy
help:
@echo "Available commands:"
@echo " make build - Build the binary"
@echo " make clean - Remove binary and clean project"
@echo " make test - Run tests"
@echo " make coverage - Run tests with coverage"
@echo " make lint - Run linter"
@echo " make fmt - Format code"
@echo " make mod-tidy - Tidy go modules"
@echo " make help - Print this help message"