forked from cnxysoft/DDBOT-WSa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
32 lines (21 loc) · 755 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
BUILD_TIME := $(shell date --rfc-3339=seconds)
COMMIT_ID := $(shell git rev-parse HEAD)
LDFLAGS = -X "github.com/Sora233/DDBOT/lsp.BuildTime='"$(BUILD_TIME)"'" -X "github.com/Sora233/DDBOT/lsp.CommitId='"$(COMMIT_ID)"'"
SRC := $(shell find . -type f -name '*.go') lsp/template/default/*
PROTO := $(shell find . -type f -name '*.proto')
COV := .coverage.out
TARGET := DDBOT
$(COV): $(SRC)
go test ./... -coverprofile=$(COV)
$(TARGET): $(SRC) go.mod go.sum
go build -ldflags '$(LDFLAGS)' -o $(TARGET) github.com/Sora233/DDBOT/cmd
build: $(TARGET)
proto: $(PROTO)
protoc --go_out=. $(PROTO)
test: $(COV)
coverage: $(COV)
go tool cover -func=$(COV) | grep -v 'pb.go'
report: $(COV)
go tool cover -html=$(COV)
clean:
- rm -rf $(TARGET) $(COV)