-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
68 lines (48 loc) · 1.54 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
export GO111MODULE := on
export CGO_ENABLED := 0
rwildcard=$(wildcard $1$2) $(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2))
BIN_DIR ?= bin
PROTO_SRCS += $(wildcard proto/controller/v1/*.proto)
PROTO_SRCS += $(wildcard proto/node/v1/*.proto)
PROTO_OUTPUT += proto/gen/controller/v1/controller.pb.go
PROTO_OUTPUT += proto/gen/controller/v1/controller.pb.gw.go
PROTO_OUTPUT += proto/gen/controller/v1/controller_grpc.pb.go
PROTO_OUTPUT += proto/gen/controller/v1/peer.pb.go
PROTO_OUTPUT += proto/gen/controller/v1/auth.pb.go
PROTO_OUTPUT += proto/gen/node/v1/node.pb.go
PROTO_OUTPUT += proto/gen/node/v1/node_grpc.pb.go
all: controller node
tidy:
@go mod tidy
frontend:
@npm i --prefix controller/frontend
@npm run build --prefix controller/frontend
docker-controller:
@docker-compose build controller
@docker-compose up controller
generate:
go generate ./...
controller: buf
go build -o $(BIN_DIR)/controller cmd/controller/main.go
run-controller: controller
$(BIN_DIR)/controller
node: buf
go build -o $(BIN_DIR)/node cmd/node/main.go
buf: $(PROTO_OUTPUT)
$(PROTO_OUTPUT): $(PROTO_SRCS)
@echo Generating proto...
@buf generate
buf-lint:
@buf lint
deps:
@go install github.com/bufbuild/buf/cmd/buf@latest
@go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
@go install connectrpc.com/connect/cmd/protoc-gen-connect-go@latest
clean:
rm -rf $(BIN_DIR)
rm -rf proto/gen
#rm -rf store.db
rm -rf third_party/OpenAPI
clean-db:
@rm -f store.db
.PHONY: all controller docker-controller deps frontend buf-lint clean node all cleandb