-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
64 lines (53 loc) · 1.24 KB
/
Makefile
File metadata and controls
64 lines (53 loc) · 1.24 KB
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
60
61
62
63
64
VERSION=$(shell date -u '+%y.%m.%d-%H.%M')
GO := go
GO111MODULE := on
CGO_ENABLED := 0
GOBUILD := CGO_ENABLED=$(CGO_ENABLED) GO111MODULE=$(GO111MODULE) $(GO) build
GOTEST := $(GO) test -gcflags='-l' -p 3
GOLANGCI_LINT := golangci-lint
BIN := bin/tfctl
.PHONY: all
all: build
.PHONY: build
build:
$(GOBUILD) -o $(BIN) ./
.PHONY: install
install:
$(GO) install ./
.PHONY: test
test:
$(GOTEST) ./...
.PHONY: test-race
test-race:
$(GO) test ./... -race
.PHONY: fmt
fmt:
$(GO) fmt ./...
gofmt -s -w .
.PHONY: lint
lint:
$(GOLANGCI_LINT) run --timeout 4m --config .golangci.yaml
.PHONY: clean
clean:
rm -f $(BIN)
rm -rf bin/
rm -f coverage.out
rm -f *.test
.PHONY: update
update:
$(GO) get -u -v ./...
$(GO) mod verify
$(GO) mod tidy
.PHONY: help
help:
@echo "Available targets:"
@echo " all - build the project (default)"
@echo " build - build the project"
@echo " install - install the project"
@echo " test - run tests"
@echo " test-race - run tests with race detector"
@echo " fmt - format code"
@echo " lint - run linter"
@echo " clean - clean build artifacts"
@echo " update - update dependencies"
@echo " help - show this help message"