-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
43 lines (32 loc) · 834 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
go ?= go
bazel ?= bazel-4.2.1
protoc ?= protoc
define tips
$(info )
$(info *************** $(1) ***************)
$(info )
endef
.PHONY: protocol
protocol:
$(call tips,Gen Protocol)
$(protoc) -I ./proto --go_out=./protocol repo.proto sync_file.proto
$(protoc) -I ./proto --go-grpc_out=./protocol repo.proto sync_file.proto
.PHONY: load-lib
load-lib:
$(call tips,Load Lib)
$(go) mod tidy
$(bazel) run //:gazelle -- update-repos -from_file=go.mod
.PHONY: gen-bzl
gen-bzl:
$(call tips,Generate bazel File)
$(bazel) run //:gazelle
.PHONY: build
build: protocol load-lib gen-bzl
$(call tips,Start Build)
$(bazel) build //grpc/server:go_default_library
$(bazel) build //grpc/client:go_default_library
$(bazel) build //repo-file-cache:go_default_library
$(bazel) build //server
.PHONY: clean
clean:
$(bazel) clean