-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
46 lines (33 loc) · 1.05 KB
/
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
FILES := $(shell find . -type f -name '*.go' ! -path '*/proto/*' )
PACKAGES := $(foreach path,$(shell go list ./...),$(if $(findstring /proto/,$(path)),,$(path)))
RELEASE_DIR := $(shell pwd)
STATICCHECK := $(shell go env GOPATH)/bin/staticcheck
$(info $$FILES = $(FILES))
$(info $$PACKAGES = $(PACKAGES))
$(info $$RELEASE_DIR = $(RELEASE_DIR))
.PHONY: all
all: test fmt lint proto build
proto:
$(MAKE) -C pkg/proto
$(MAKE) -C plugins/auth_nebius/proto
test:
go test -v ./... -short -race
fmt:
go fmt $(PACKAGES)
goimports -w $(FILES)
$(STATICCHECK):
go install honnef.co/go/tools/cmd/staticcheck@latest
lint: | $(STATICCHECK)
$(STATICCHECK) $(PACKAGES)
go vet $(PACKAGES)
build: build-plugins build-ydbcp
build-ydbcp:
go build -C cmd/ydbcp -o ydbcp
build-plugins: build-auth_nebius
build-auth_nebius:
go build -C plugins/auth_nebius -buildmode=plugin -o auth_nebius.so
clean:
rm -f plugins/auth_nebius/auth_nebius.so cmd/ydbcp/ydbcp
clean-proto:
find pkg/proto -type f -name '*.go' -delete
find plugins/auth_nebius/proto -type f -name '*.go' -delete