forked from SafetyCulture/s12-proto
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
78 lines (64 loc) · 2.53 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
69
70
71
72
73
74
75
76
77
78
.PHONY: generate
generate:
protoc \
-I./protobuf/s12proto/:. \
--gogo_out=Mgoogle/protobuf/descriptor.proto=github.com/gogo/protobuf/protoc-gen-gogo/descriptor,paths=source_relative:./protobuf/s12proto \
protobuf/s12proto/*.proto
CXX = g++
CPPFLAGS += -I/usr/local/include -pthread
CXXFLAGS += -std=c++17
LDFLAGS += -L/usr/local/lib -lprotoc -lprotobuf -lpthread -ldl
protoc-gen-cruxclient: protobuf/protoc-gen-cruxclient/cruxclient_generator.o protobuf/protoc-gen-cruxclient/legacy_generator.o protobuf/protoc-gen-cruxclient/api_generator.o
$(CXX) $^ $(LDFLAGS) -o $@
.PHONY: install-govalidator
install-govalidator:
go install github.com/BuildingRobotics/s12-proto/protobuf/protoc-gen-govalidator
.PHONY: install-logger
go install github.com/BuildingRobotics/s12-proto/protobuf/protoc-gen-logger
.PHONY: install-cruxclient
install-cruxclient: protoc-gen-cruxclient
install protoc-gen-cruxclient /usr/local/bin/protoc-gen-cruxclient
.PHONY: install
install: install-govalidator install-logger
.PHONY: govalidator
govalidator: install-govalidator
protoc \
-I./protobuf/protoc-gen-govalidator/example \
-I$(GOPATH)/src \
-I./protobuf \
--gogo_out=:protobuf/protoc-gen-govalidator/example \
--govalidator_out=:protobuf/protoc-gen-govalidator/example \
protobuf/protoc-gen-govalidator/example/*.proto
.PHONY: govalidator-test
govalidator-test:
go test github.com/BuildingRobotics/s12-proto/protobuf/protoc-gen-govalidator/example -v
.PHONY: logger
logger: install-logger
protoc \
-I./protobuf/protoc-gen-logger/example \
-I$(GOPATH)/src \
--gogo_out=:protobuf/protoc-gen-logger/example \
--logger_out=:protobuf/protoc-gen-logger/example \
protobuf/protoc-gen-logger/example/*.proto
.PHONY: cruxclient
cruxclient: install-cruxclient
protoc \
-I./protobuf/protoc-gen-cruxclient/proto \
--plugin=protoc-gen-grpc=/usr/local/bin/grpc_cpp_plugin \
--cpp_out=:protobuf/protoc-gen-cruxclient/generated \
--grpc_out=:protobuf/protoc-gen-cruxclient/generated \
--cruxclient_out=:protobuf/protoc-gen-cruxclient/generated \
protobuf/protoc-gen-cruxclient/proto/routeguide/v1/route_guide.proto
.PHONY: install-gogrpcmock
install-gogrpcmock:
go install github.com/BuildingRobotics/s12-proto/protobuf/protoc-gen-gogrpcmock
.PHONY: gogrpcmock
gogrpcmock: install-gogrpcmock
protoc \
-I./protobuf/protoc-gen-gogrpcmock/example \
-I./protobuf \
--gogo_out=plugin=grpc=:protobuf/protoc-gen-gogrpcmock/example \
--gogrpcmock_out=:protobuf/protoc-gen-gogrpcmock/example \
protobuf/protoc-gen-gogrpcmock/example/*.proto
.PHONY: example
example: govalidator logger