-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
41 lines (31 loc) · 1.28 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
VERSION := v0.3.6
ldflags := $(LDFLAGS)
ldflags += -X main.version=$(VERSION)
ldflags := $(strip $(ldflags))
BUILD_FLAGS := -ldflags '$(ldflags)'
.PHONY: format lint build
all: format lint build
###############################################################################
### Build ###
###############################################################################
build:
@echo "🤖 Building supervysor..."
@go build $(BUILD_FLAGS) -mod=readonly -o "$(PWD)/build/" ./cmd/supervysor
@echo "✅ Completed build!"
install:
@echo "🤖 Installing supervysor..."
@go install -mod=readonly $(BUILD_FLAGS) ./cmd/supervysor
@echo "✅ Completed installation!"
###############################################################################
### Formatting & Linting ###
###############################################################################
gofumpt_cmd=mvdan.cc/gofumpt
golangci_lint_cmd=github.com/golangci/golangci-lint/cmd/golangci-lint
format:
@echo "🤖 Running formatter..."
@go run $(gofumpt_cmd) -l -w .
@echo "✅ Completed formatting!"
lint:
@echo "🤖 Running linter..."
@go run $(golangci_lint_cmd) run --timeout=10m
@echo "✅ Completed linting!"