-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
56 lines (44 loc) · 1.32 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
#
PROTOC = protoc
PROTO = protobuf/metastore.proto
SWAGGER_DIR = swagger
SWAGGER = $(SWAGGER_DIR)/metastore.swagger.json
GOMETASTORE = gometastore
GOPROTO = $(GOMETASTORE)/protobuf
GITHUB = github.com
THIS = $(GITHUB)/akolb1/hmsv2api
GO_ALL = $(THIS)/$(GOMETASTORE)/...
INCLUDES = -I protobuf
INCLUDES += -I $(GOPATH)/src/$(GITHUB)/grpc-ecosystem/grpc-gateway/third_party/googleapis
INCLUDES += -I $(GOPATH)/src/$(GITHUB)/grpc-ecosystem/grpc-gateway
all: build
build:
cd $(GOMETASTORE)/hmsv2server && go build
cd $(GOMETASTORE)/hmsproxy && go build
stats:
@cloc --no-autogen --git master
api: $(SWAGGER)
@$(PROTOC) $(INCLUDES) \
--swagger_out=logtostderr=true:$(SWAGGER_DIR) \
$(PROTO)
$(SWAGGER): $(PROTO)
docs: $(PROTO)
$(PROTOC) $(INCLUDES) \
--doc_out=docs --doc_opt=markdown,README_proto.md \
$(PROTO)
$(PROTOC) ${INCLUDES} \
--doc_out=docs --doc_opt=html,proto_index.html \
$(PROTO)
deps:
go get $(GITHUB)/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc
go get $(GITHUB)/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
go get $(GITHUB)/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
go get $(GITHUB)/golang/protobuf/protoc-gen-go
proto:
@ if ! which protoc > /dev/null; then \
echo "error: protoc not installed" >&2; \
exit 1; \
fi
go generate $(GO_ALL)
install:
go get $(GOALL)