-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
49 lines (39 loc) · 915 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
39
40
41
42
43
44
45
46
47
48
49
all: fmt vet lint test build
build:
mkdir -p bin
go build -o bin/kbuild ./cmd/kbuild.go
fmt:
go fmt ./pkg/... ./cmd/...
vet:
go vet ./pkg/... ./cmd/...
imports:
go get golang.org/x/tools/cmd/goimports
goimports -w ./pkg/* ./cmd/*
lint: require-gopath
bash scripts/install_golangci-lint.sh
golangci-lint run --no-config \
-E goconst \
-E goimports \
-E gocritic \
-E golint \
-E interfacer \
-E maligned \
-E misspell \
-E unconvert \
-E unparam \
-D errcheck \
--skip-dirs vendor
gox:
go get github.com/mitchellh/gox
test:
go test ./...
install: all
sudo cp bin/kbuild /usr/local/bin/kbuild-dev
build-all:
mkdir -p out && cd out
which gox || make gox
gox -arch="amd64" -os="darwin linux windows" --output "out/kbuild_{{.OS}}_{{.Arch}}" github.com/cedrickring/kbuild/cmd
require-gopath:
ifndef GOPATH
$(error GOPATH is not set)
endif