-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
38 lines (28 loc) · 726 Bytes
/
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
GOPATH := $(shell go env GOPATH)
GOBIN ?= $(GOPATH)/bin
BUILD_DIR := ./build
INSTALL_DIR := ~/.local/bin
GOLANGCILINT := $(GOBIN)/golangci-lint
$(GOLANGCILINT):
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(shell go env GOPATH)/bin v1.43.0
RICHGO := $(GOBIN)/richgo
$(RICHGO):
@go install github.com/kyoh86/[email protected]
fmt:
@goimports -w .
@gofmt -w .
lint: $(GOLANGCILINT)
@golangci-lint run
test: $(RICHGO)
@$(RICHGO) test ./...
check: fmt lint test
build:
mkdir -p ${BUILD_DIR}
go build -o ${BUILD_DIR}/xctl
clean:
rm -r ${BUILD_DIR}
install:
mkdir -p ${INSTALL_DIR}
cp ${BUILD_DIR}/xctl ${INSTALL_DIR}/xctl
uninstall:
rm ${INSTALL_DIR}/xctl