@@ -9,7 +9,7 @@ PROTOC = @PROTOC@
9
9
# Lightstep Collector reporting:
10
10
COLLECTOR_SRC = $(top_srcdir ) /lightstep-tracer-common
11
11
ENVOY_SRC = ./envoy
12
- PROTO_DIR = proto
12
+ PROTO_DIR = ./ proto
13
13
14
14
PROTO_SRC = \
15
15
$(COLLECTOR_SRC ) /collector.proto \
@@ -18,14 +18,17 @@ PROTO_SRC = \
18
18
PROTO_GEN = \
19
19
lightstep/collector.pb.h \
20
20
lightstep/envoy_carrier.pb.h \
21
- proto /collector.pb.cc \
22
- proto /envoy_carrier.pb.cc
21
+ $( PROTO_DIR ) /collector.pb.cc \
22
+ $( PROTO_DIR ) /envoy_carrier.pb.cc
23
23
24
- $(PROTO_GEN ) : $(PROTO_SRC ) $( PROTOC )
24
+ $(PROTO_DIR ) .stamp : $(PROTO_SRC )
25
25
mkdir -p $(PROTO_DIR )
26
26
$(PROTOC ) --proto_path=$(COLLECTOR_SRC ) --cpp_out=$(PROTO_DIR ) $(COLLECTOR_SRC ) /collector.proto
27
27
$(PROTOC ) --proto_path=$(ENVOY_SRC ) --cpp_out=$(PROTO_DIR ) $(ENVOY_SRC ) /envoy_carrier.proto
28
- mv proto/* .h lightstep
28
+ mv $(PROTO_DIR ) /* .h lightstep
29
+ touch $(PROTO_DIR ) .stamp
30
+
31
+ $(PROTO_GEN ) : $(PROTO_DIR ) .stamp
29
32
30
33
# Tell Automake that these files have to be generated first (also cleaned)
31
34
BUILT_SOURCES = $(PROTO_GEN )
@@ -58,8 +61,8 @@ nobase_nodist_include_HEADERS = \
58
61
lightstep/envoy_carrier.pb.h
59
62
60
63
nodist_liblightstep_core_cxx11_la_SOURCES = \
61
- proto /collector.pb.cc \
62
- proto /envoy_carrier.pb.cc
64
+ $( PROTO_DIR ) /collector.pb.cc \
65
+ $( PROTO_DIR ) /envoy_carrier.pb.cc
63
66
64
67
# Note: To set the protobuf library include and library flags, e.g.,
65
68
#
@@ -81,20 +84,25 @@ EXTRA_DIST = \
81
84
# ./configure --disable-grpc
82
85
if ENABLE_GRPC
83
86
84
- BUILT_SOURCES += $(GRPC_PROTO_GEN )
85
- CLEANFILES += $(GRPC_PROTO_GEN )
86
-
87
87
GRPC_PROTO_SRC = \
88
88
$(COLLECTOR_SRC ) /collector.proto
89
89
90
90
GRPC_PROTO_GEN = \
91
91
lightstep/collector.grpc.pb.h \
92
- proto /collector.grpc.pb.cc
92
+ $( PROTO_DIR ) /collector.grpc.pb.cc
93
93
94
- $(GRPC_PROTO_GEN ) : $(GRPC_PROTO_SRC ) $(PROTOC )
94
+ BUILT_SOURCES += $(GRPC_PROTO_GEN )
95
+ CLEANFILES += $(GRPC_PROTO_GEN )
96
+
97
+ # TODO make grpc_cpp_plugin a configure option
98
+ #
99
+ $(PROTO_DIR ) .grpc.stamp : $(GRPC_PROTO_SRC )
95
100
mkdir -p $(PROTO_DIR )
96
101
$(PROTOC ) --proto_path=$(COLLECTOR_SRC ) --grpc_out=$(PROTO_DIR ) --plugin=protoc-gen-grpc=` which grpc_cpp_plugin` $(COLLECTOR_SRC ) /collector.proto
97
- mv proto/* .h lightstep
102
+ mv $(PROTO_DIR ) /* .h lightstep
103
+ touch $(PROTO_DIR ) .grpc.stamp
104
+
105
+ $(GRPC_PROTO_GEN ) : $(PROTO_DIR ) .grpc.stamp
98
106
99
107
# LightStep gRPC recorder library
100
108
lib_LTLIBRARIES += liblightstep_grpc_cxx11.la
@@ -106,7 +114,7 @@ nobase_nodist_include_HEADERS += \
106
114
lightstep/collector.grpc.pb.h
107
115
108
116
nodist_liblightstep_grpc_cxx11_la_SOURCES = \
109
- proto /collector.grpc.pb.cc
117
+ $( PROTO_DIR ) /collector.grpc.pb.cc
110
118
111
119
# Note $(grpc_LIBS)++ shenanigans. The grpc C++ pkg-config input (grpc++.pc) uses
112
120
# characters that are invalid to autoconf, so we can't find it. Instead, we locate
0 commit comments