-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
46 lines (29 loc) · 952 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
default: clippan
BUILD_TIME=$(shell date +%FT%T%z)
GIT_REVISION=$(shell git rev-parse --short HEAD)
GIT_BRANCH=$(shell git rev-parse --symbolic-full-name --abbrev-ref HEAD)
GIT_DIRTY=$(shell git diff-index --quiet HEAD -- || echo "x-")
# Optionally include RELEASE_TAG, set by github when building
LDFLAGS=-ldflags "-s -X main.BuildStamp=$(BUILD_TIME) -X main.GitHash=$(GIT_DIRTY)$(GIT_REVISION) -X main.gitBranch=$(GIT_BRANCH)"
srcfiles = cmd/clippan/main.go */*.go
testpackages = ./...
default: bin/clippan
bin/clippan: $(srcfiles)
go build -o bin/clippan $(LDFLAGS) cmd/clippan/main.go
build-release: $(srcfiles)
go build -o clippan-release $(LDFLAGS) cmd/clippan/main.go
lint:
golangci-lint run
test-dev: lint test
test:
go test -count=1 $(testpackages)
test-verbose:
go test -v $(testpackages)
run-dev:
CompileDaemon -command=bin/clippan -build="make"
mod-tidy:
go mod tidy
show-deps:
go list -m all
clean:
@rm -f bin/*