-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
52 lines (37 loc) · 1.1 KB
/
Makefile
File metadata and controls
52 lines (37 loc) · 1.1 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
LOCAL_PKG := github.com/vmkteam/vfs
MAIN := $(LOCAL_PKG)/cmd/vfssrv
PKG := `go list -f {{.Dir}} ./...`
LINT_VERSION := v2.1.5
ifeq ($(RACE),1)
GOFLAGS=-race
endif
tools:
@go install github.com/vmkteam/mfd-generator@latest
@go install github.com/vmkteam/zenrpc/v2/zenrpc@latest
@curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${LINT_VERSION}
fmt:
@golangci-lint fmt
lint:
@golangci-lint version
@golangci-lint config verify
@golangci-lint run
build:
@CGO_ENABLED=0 go build $(GOFLAGS) -o vfssrv $(MAIN)
run:
@echo "Compiling"
@go run $(GOFLAGS) $(MAIN) -dev $(fl)
test:
@go test $(GOFLAGS) ./...
test-short:
@go test $(GOFLAGS) -test.short -test.run="Test[^D][^B]" ./...
generate:
@go generate
mod:
@go mod tidy
@go mod vendor
mfd-xml:
@mfd-generator xml -c "postgres://postgres:postgres@localhost:5432/vfs?sslmode=disable" -m ./docs/model/vfs.mfd -n "vfs:vfsFiles,vfsFolders,vfsHashes"
mfd-model:
@mfd-generator model -m ./docs/model/vfs.mfd -p db -o ./db
mfd-repo:
@mfd-generator repo -m ./docs/model/vfs.mfd -p db -o ./db