• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1## Process this file with automake to produce Makefile.in
2
3if HAVE_ZLIB
4GZCHECKPROGRAMS = zcgzip zcgunzip
5GZHEADERS = google/protobuf/io/gzip_stream.h
6GZTESTS = google/protobuf/io/gzip_stream_unittest.sh
7ZLIB_DEF = -DHAVE_ZLIB=1
8else
9GZCHECKPROGRAMS =
10GZHEADERS =
11GZTESTS =
12ZLIB_DEF =
13endif
14
15if HAVE_PTHREAD
16PTHREAD_DEF = -DHAVE_PTHREAD=1
17else
18PTHREAD_DEF =
19endif
20
21PROTOBUF_VERSION = 24:0:0
22
23if GCC
24# Turn on all warnings except for sign comparison (we ignore sign comparison
25# in Google so our code base have tons of such warnings).
26NO_OPT_CXXFLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_DEF) $(ZLIB_DEF) -Wall -Wno-sign-compare
27else
28NO_OPT_CXXFLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_DEF) $(ZLIB_DEF)
29endif
30
31AM_CXXFLAGS = $(NO_OPT_CXXFLAGS) $(PROTOBUF_OPT_FLAG)
32
33AM_LDFLAGS = $(PTHREAD_CFLAGS)
34
35# If I say "dist_include_DATA", automake complains that $(includedir) is not
36# a "legitimate" directory for DATA.  Screw you, automake.
37protodir = $(includedir)
38
39# If you are adding new files here, also remember to change the build files for
40# all other languages, //protoc-artifacts/build-zip.sh and run
41# //update_file_list.sh for bazel.
42nobase_dist_proto_DATA = google/protobuf/descriptor.proto      \
43                         google/protobuf/any.proto             \
44                         google/protobuf/api.proto             \
45                         google/protobuf/duration.proto        \
46                         google/protobuf/empty.proto           \
47                         google/protobuf/field_mask.proto      \
48                         google/protobuf/source_context.proto  \
49                         google/protobuf/struct.proto          \
50                         google/protobuf/timestamp.proto       \
51                         google/protobuf/type.proto            \
52                         google/protobuf/wrappers.proto        \
53                         google/protobuf/compiler/plugin.proto
54
55# Not sure why these don't get cleaned automatically.
56clean-local:
57	rm -f *.loT
58
59CLEANFILES = $(protoc_outputs) unittest_proto_middleman \
60             testzip.jar testzip.list testzip.proto testzip.zip \
61             no_warning_test.cc
62
63MAINTAINERCLEANFILES =   \
64  Makefile.in
65
66nobase_include_HEADERS =                                         \
67  google/protobuf/stubs/callback.h                               \
68  google/protobuf/stubs/bytestream.h                             \
69  google/protobuf/stubs/casts.h                                  \
70  google/protobuf/stubs/common.h                                 \
71  google/protobuf/stubs/fastmem.h                                \
72  google/protobuf/stubs/hash.h                                   \
73  google/protobuf/stubs/logging.h                                \
74  google/protobuf/stubs/macros.h                                 \
75  google/protobuf/stubs/map_util.h                               \
76  google/protobuf/stubs/mutex.h                                  \
77  google/protobuf/stubs/once.h                                   \
78  google/protobuf/stubs/platform_macros.h                        \
79  google/protobuf/stubs/port.h                                   \
80  google/protobuf/stubs/status.h                                 \
81  google/protobuf/stubs/stl_util.h                               \
82  google/protobuf/stubs/stringpiece.h                            \
83  google/protobuf/stubs/strutil.h                                \
84  google/protobuf/stubs/template_util.h                          \
85  google/protobuf/any.pb.h                                       \
86  google/protobuf/api.pb.h                                       \
87  google/protobuf/any.h                                          \
88  google/protobuf/arena.h                                        \
89  google/protobuf/arena_impl.h                                   \
90  google/protobuf/arenastring.h                                  \
91  google/protobuf/descriptor_database.h                          \
92  google/protobuf/descriptor.h                                   \
93  google/protobuf/descriptor.pb.h                                \
94  google/protobuf/duration.pb.h                                  \
95  google/protobuf/dynamic_message.h                              \
96  google/protobuf/empty.pb.h                                     \
97  google/protobuf/extension_set.h                                \
98  google/protobuf/extension_set_inl.h                            \
99  google/protobuf/field_mask.pb.h                                \
100  google/protobuf/generated_enum_reflection.h                    \
101  google/protobuf/generated_enum_util.h                          \
102  google/protobuf/generated_message_reflection.h                 \
103  google/protobuf/generated_message_table_driven.h               \
104  google/protobuf/generated_message_util.h                       \
105  google/protobuf/has_bits.h                                     \
106  google/protobuf/implicit_weak_message.h                        \
107  google/protobuf/inlined_string_field.h                         \
108  google/protobuf/io/io_win32.h                                \
109  google/protobuf/map_entry.h                                    \
110  google/protobuf/map_entry_lite.h                               \
111  google/protobuf/map_field.h                                    \
112  google/protobuf/map_field_inl.h                                \
113  google/protobuf/map_field_lite.h                               \
114  google/protobuf/map.h                                          \
115  google/protobuf/map_type_handler.h                             \
116  google/protobuf/message.h                                      \
117  google/protobuf/message_lite.h                                 \
118  google/protobuf/metadata.h                                     \
119  google/protobuf/metadata_lite.h                                \
120  google/protobuf/parse_context.h                                \
121  google/protobuf/port.h                                         \
122  google/protobuf/port_def.inc                                   \
123  google/protobuf/port_undef.inc                                 \
124  google/protobuf/reflection.h                                   \
125  google/protobuf/reflection_ops.h                               \
126  google/protobuf/repeated_field.h                               \
127  google/protobuf/service.h                                      \
128  google/protobuf/source_context.pb.h                            \
129  google/protobuf/struct.pb.h                                    \
130  google/protobuf/text_format.h                                  \
131  google/protobuf/timestamp.pb.h                                 \
132  google/protobuf/type.pb.h                                      \
133  google/protobuf/unknown_field_set.h                            \
134  google/protobuf/wire_format.h                                  \
135  google/protobuf/wire_format_lite.h                             \
136  google/protobuf/wrappers.pb.h                                  \
137  google/protobuf/io/coded_stream.h                              \
138  $(GZHEADERS)                                                   \
139  google/protobuf/io/printer.h                                   \
140  google/protobuf/io/strtod.h                                    \
141  google/protobuf/io/tokenizer.h                                 \
142  google/protobuf/io/zero_copy_stream.h                          \
143  google/protobuf/io/zero_copy_stream_impl.h                     \
144  google/protobuf/io/zero_copy_stream_impl_lite.h                \
145  google/protobuf/compiler/code_generator.h                      \
146  google/protobuf/compiler/command_line_interface.h              \
147  google/protobuf/compiler/importer.h                            \
148  google/protobuf/compiler/parser.h                              \
149  google/protobuf/compiler/plugin.h                              \
150  google/protobuf/compiler/plugin.pb.h                           \
151  google/protobuf/compiler/cpp/cpp_generator.h                   \
152  google/protobuf/compiler/csharp/csharp_generator.h             \
153  google/protobuf/compiler/csharp/csharp_names.h                 \
154  google/protobuf/compiler/java/java_generator.h                 \
155  google/protobuf/compiler/java/java_names.h                     \
156  google/protobuf/compiler/js/js_generator.h                     \
157  google/protobuf/compiler/js/well_known_types_embed.h           \
158  google/protobuf/compiler/objectivec/objectivec_generator.h     \
159  google/protobuf/compiler/objectivec/objectivec_helpers.h       \
160  google/protobuf/compiler/php/php_generator.h                   \
161  google/protobuf/compiler/python/python_generator.h             \
162  google/protobuf/compiler/ruby/ruby_generator.h                 \
163  google/protobuf/util/type_resolver.h                           \
164  google/protobuf/util/delimited_message_util.h                  \
165  google/protobuf/util/field_comparator.h                        \
166  google/protobuf/util/field_mask_util.h                         \
167  google/protobuf/util/json_util.h                               \
168  google/protobuf/util/time_util.h                               \
169  google/protobuf/util/type_resolver_util.h                      \
170  google/protobuf/util/message_differencer.h
171
172lib_LTLIBRARIES = libprotobuf-lite.la libprotobuf.la libprotoc.la
173
174libprotobuf_lite_la_LIBADD = $(PTHREAD_LIBS) $(LIBATOMIC_LIBS)
175libprotobuf_lite_la_LDFLAGS = -version-info $(PROTOBUF_VERSION) -export-dynamic -no-undefined
176if HAVE_LD_VERSION_SCRIPT
177libprotobuf_lite_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotobuf-lite.map
178EXTRA_libprotobuf_lite_la_DEPENDENCIES = libprotobuf-lite.map
179endif
180libprotobuf_lite_la_SOURCES =                                  \
181  google/protobuf/stubs/bytestream.cc                          \
182  google/protobuf/stubs/bytestream.h                           \
183  google/protobuf/stubs/common.cc                              \
184  google/protobuf/stubs/hash.h                                 \
185  google/protobuf/stubs/int128.cc                              \
186  google/protobuf/stubs/int128.h                               \
187  google/protobuf/io/io_win32.cc                               \
188  google/protobuf/stubs/map_util.h                             \
189  google/protobuf/stubs/mathutil.h                             \
190  google/protobuf/stubs/status.cc                              \
191  google/protobuf/stubs/status.h                               \
192  google/protobuf/stubs/status_macros.h                        \
193  google/protobuf/stubs/statusor.cc                            \
194  google/protobuf/stubs/statusor.h                             \
195  google/protobuf/stubs/stringpiece.cc                         \
196  google/protobuf/stubs/stringpiece.h                          \
197  google/protobuf/stubs/stringprintf.cc                        \
198  google/protobuf/stubs/stringprintf.h                         \
199  google/protobuf/stubs/structurally_valid.cc                  \
200  google/protobuf/stubs/strutil.cc                             \
201  google/protobuf/stubs/time.cc                                \
202  google/protobuf/stubs/time.h                                 \
203  google/protobuf/any_lite.cc                                  \
204  google/protobuf/arena.cc                                     \
205  google/protobuf/extension_set.cc                             \
206  google/protobuf/generated_enum_util.cc                       \
207  google/protobuf/generated_message_util.cc                    \
208  google/protobuf/generated_message_table_driven_lite.h        \
209  google/protobuf/generated_message_table_driven_lite.cc       \
210  google/protobuf/implicit_weak_message.cc                     \
211  google/protobuf/message_lite.cc                              \
212  google/protobuf/parse_context.cc                             \
213  google/protobuf/repeated_field.cc                            \
214  google/protobuf/wire_format_lite.cc                          \
215  google/protobuf/io/coded_stream.cc                           \
216  google/protobuf/io/strtod.cc                                 \
217  google/protobuf/io/zero_copy_stream.cc                       \
218  google/protobuf/io/zero_copy_stream_impl.cc                  \
219  google/protobuf/io/zero_copy_stream_impl_lite.cc
220
221libprotobuf_la_LIBADD = $(PTHREAD_LIBS) $(LIBATOMIC_LIBS)
222libprotobuf_la_LDFLAGS = -version-info $(PROTOBUF_VERSION) -export-dynamic -no-undefined
223if HAVE_LD_VERSION_SCRIPT
224libprotobuf_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotobuf.map
225EXTRA_libprotobuf_la_DEPENDENCIES = libprotobuf.map
226endif
227libprotobuf_la_SOURCES =                                       \
228  $(libprotobuf_lite_la_SOURCES)                               \
229  google/protobuf/any.pb.cc                                    \
230  google/protobuf/api.pb.cc                                    \
231  google/protobuf/any.cc                                       \
232  google/protobuf/descriptor.cc                                \
233  google/protobuf/descriptor_database.cc                       \
234  google/protobuf/descriptor.pb.cc                             \
235  google/protobuf/duration.pb.cc                               \
236  google/protobuf/dynamic_message.cc                           \
237  google/protobuf/empty.pb.cc                                  \
238  google/protobuf/extension_set_heavy.cc                       \
239  google/protobuf/field_mask.pb.cc                             \
240  google/protobuf/generated_message_reflection.cc              \
241  google/protobuf/generated_message_table_driven_lite.h        \
242  google/protobuf/generated_message_table_driven.cc            \
243  google/protobuf/map_field.cc                                 \
244  google/protobuf/message.cc                                   \
245  google/protobuf/reflection_internal.h                        \
246  google/protobuf/reflection_ops.cc                            \
247  google/protobuf/service.cc                                   \
248  google/protobuf/source_context.pb.cc                         \
249  google/protobuf/struct.pb.cc                                 \
250  google/protobuf/stubs/substitute.cc                          \
251  google/protobuf/stubs/substitute.h                           \
252  google/protobuf/text_format.cc                               \
253  google/protobuf/timestamp.pb.cc                              \
254  google/protobuf/type.pb.cc                                   \
255  google/protobuf/unknown_field_set.cc                         \
256  google/protobuf/wire_format.cc                               \
257  google/protobuf/wrappers.pb.cc                               \
258  google/protobuf/io/gzip_stream.cc                            \
259  google/protobuf/io/printer.cc                                \
260  google/protobuf/io/tokenizer.cc                              \
261  google/protobuf/compiler/importer.cc                         \
262  google/protobuf/compiler/parser.cc                           \
263  google/protobuf/util/delimited_message_util.cc               \
264  google/protobuf/util/field_comparator.cc                     \
265  google/protobuf/util/field_mask_util.cc                      \
266  google/protobuf/util/internal/constants.h                    \
267  google/protobuf/util/internal/datapiece.cc                   \
268  google/protobuf/util/internal/datapiece.h                    \
269  google/protobuf/util/internal/default_value_objectwriter.cc  \
270  google/protobuf/util/internal/default_value_objectwriter.h   \
271  google/protobuf/util/internal/error_listener.cc              \
272  google/protobuf/util/internal/error_listener.h               \
273  google/protobuf/util/internal/expecting_objectwriter.h       \
274  google/protobuf/util/internal/field_mask_utility.cc          \
275  google/protobuf/util/internal/field_mask_utility.h           \
276  google/protobuf/util/internal/json_escaping.cc               \
277  google/protobuf/util/internal/json_escaping.h                \
278  google/protobuf/util/internal/json_objectwriter.cc           \
279  google/protobuf/util/internal/json_objectwriter.h            \
280  google/protobuf/util/internal/json_stream_parser.cc          \
281  google/protobuf/util/internal/json_stream_parser.h           \
282  google/protobuf/util/internal/location_tracker.h             \
283  google/protobuf/util/internal/mock_error_listener.h          \
284  google/protobuf/util/internal/object_location_tracker.h      \
285  google/protobuf/util/internal/object_source.h                \
286  google/protobuf/util/internal/object_writer.cc               \
287  google/protobuf/util/internal/object_writer.h                \
288  google/protobuf/util/internal/protostream_objectsource.cc    \
289  google/protobuf/util/internal/protostream_objectsource.h     \
290  google/protobuf/util/internal/protostream_objectwriter.cc    \
291  google/protobuf/util/internal/protostream_objectwriter.h     \
292  google/protobuf/util/internal/proto_writer.cc                \
293  google/protobuf/util/internal/proto_writer.h                 \
294  google/protobuf/util/internal/structured_objectwriter.h      \
295  google/protobuf/util/internal/type_info.cc                   \
296  google/protobuf/util/internal/type_info.h                    \
297  google/protobuf/util/internal/type_info_test_helper.cc       \
298  google/protobuf/util/internal/type_info_test_helper.h        \
299  google/protobuf/util/internal/utility.cc                     \
300  google/protobuf/util/internal/utility.h                      \
301  google/protobuf/util/json_util.cc                            \
302  google/protobuf/util/message_differencer.cc                  \
303  google/protobuf/util/time_util.cc                            \
304  google/protobuf/util/type_resolver_util.cc
305
306nodist_libprotobuf_la_SOURCES = $(nodist_libprotobuf_lite_la_SOURCES)
307
308libprotoc_la_LIBADD = $(PTHREAD_LIBS) libprotobuf.la
309libprotoc_la_LDFLAGS = -version-info $(PROTOBUF_VERSION) -export-dynamic -no-undefined
310if HAVE_LD_VERSION_SCRIPT
311libprotoc_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotoc.map
312EXTRA_libprotoc_la_DEPENDENCIES = libprotoc.map
313endif
314libprotoc_la_SOURCES =                                         \
315  google/protobuf/compiler/code_generator.cc                   \
316  google/protobuf/compiler/command_line_interface.cc           \
317  google/protobuf/compiler/plugin.cc                           \
318  google/protobuf/compiler/plugin.pb.cc                        \
319  google/protobuf/compiler/scc.h                               \
320  google/protobuf/compiler/subprocess.cc                       \
321  google/protobuf/compiler/subprocess.h                        \
322  google/protobuf/compiler/zip_writer.cc                       \
323  google/protobuf/compiler/zip_writer.h                        \
324  google/protobuf/compiler/cpp/cpp_enum.cc                     \
325  google/protobuf/compiler/cpp/cpp_enum.h                      \
326  google/protobuf/compiler/cpp/cpp_enum_field.cc               \
327  google/protobuf/compiler/cpp/cpp_enum_field.h                \
328  google/protobuf/compiler/cpp/cpp_extension.cc                \
329  google/protobuf/compiler/cpp/cpp_extension.h                 \
330  google/protobuf/compiler/cpp/cpp_field.cc                    \
331  google/protobuf/compiler/cpp/cpp_field.h                     \
332  google/protobuf/compiler/cpp/cpp_file.cc                     \
333  google/protobuf/compiler/cpp/cpp_file.h                      \
334  google/protobuf/compiler/cpp/cpp_generator.cc                \
335  google/protobuf/compiler/cpp/cpp_helpers.cc                  \
336  google/protobuf/compiler/cpp/cpp_helpers.h                   \
337  google/protobuf/compiler/cpp/cpp_map_field.cc                \
338  google/protobuf/compiler/cpp/cpp_map_field.h                 \
339  google/protobuf/compiler/cpp/cpp_message.cc                  \
340  google/protobuf/compiler/cpp/cpp_message.h                   \
341  google/protobuf/compiler/cpp/cpp_message_field.cc            \
342  google/protobuf/compiler/cpp/cpp_message_field.h             \
343  google/protobuf/compiler/cpp/cpp_message_layout_helper.h     \
344  google/protobuf/compiler/cpp/cpp_options.h                   \
345  google/protobuf/compiler/cpp/cpp_padding_optimizer.cc        \
346  google/protobuf/compiler/cpp/cpp_padding_optimizer.h         \
347  google/protobuf/compiler/cpp/cpp_primitive_field.cc          \
348  google/protobuf/compiler/cpp/cpp_primitive_field.h           \
349  google/protobuf/compiler/cpp/cpp_service.cc                  \
350  google/protobuf/compiler/cpp/cpp_service.h                   \
351  google/protobuf/compiler/cpp/cpp_string_field.cc             \
352  google/protobuf/compiler/cpp/cpp_string_field.h              \
353  google/protobuf/compiler/java/java_context.cc                \
354  google/protobuf/compiler/java/java_context.h                 \
355  google/protobuf/compiler/java/java_enum.cc                   \
356  google/protobuf/compiler/java/java_enum_lite.cc              \
357  google/protobuf/compiler/java/java_enum_field.cc             \
358  google/protobuf/compiler/java/java_enum_field.h              \
359  google/protobuf/compiler/java/java_enum_field_lite.cc        \
360  google/protobuf/compiler/java/java_enum_field_lite.h         \
361  google/protobuf/compiler/java/java_enum.h                    \
362  google/protobuf/compiler/java/java_enum_lite.h               \
363  google/protobuf/compiler/java/java_extension.cc              \
364  google/protobuf/compiler/java/java_extension.h               \
365  google/protobuf/compiler/java/java_extension_lite.cc         \
366  google/protobuf/compiler/java/java_extension_lite.h          \
367  google/protobuf/compiler/java/java_field.cc                  \
368  google/protobuf/compiler/java/java_field.h                   \
369  google/protobuf/compiler/java/java_file.cc                   \
370  google/protobuf/compiler/java/java_file.h                    \
371  google/protobuf/compiler/java/java_generator.cc              \
372  google/protobuf/compiler/java/java_generator_factory.cc      \
373  google/protobuf/compiler/java/java_generator_factory.h       \
374  google/protobuf/compiler/java/java_helpers.cc                \
375  google/protobuf/compiler/java/java_helpers.h                 \
376  google/protobuf/compiler/java/java_map_field.cc              \
377  google/protobuf/compiler/java/java_map_field.h               \
378  google/protobuf/compiler/java/java_map_field_lite.cc         \
379  google/protobuf/compiler/java/java_map_field_lite.h          \
380  google/protobuf/compiler/java/java_message.cc                \
381  google/protobuf/compiler/java/java_message_lite.cc           \
382  google/protobuf/compiler/java/java_message_builder.cc        \
383  google/protobuf/compiler/java/java_message_builder_lite.cc   \
384  google/protobuf/compiler/java/java_message_field.cc          \
385  google/protobuf/compiler/java/java_message_field.h           \
386  google/protobuf/compiler/java/java_message_field_lite.cc     \
387  google/protobuf/compiler/java/java_message_field_lite.h      \
388  google/protobuf/compiler/java/java_message.h                 \
389  google/protobuf/compiler/java/java_message_lite.h            \
390  google/protobuf/compiler/java/java_message_builder.h         \
391  google/protobuf/compiler/java/java_message_builder_lite.h    \
392  google/protobuf/compiler/java/java_name_resolver.cc          \
393  google/protobuf/compiler/java/java_name_resolver.h           \
394  google/protobuf/compiler/java/java_options.h                 \
395  google/protobuf/compiler/java/java_primitive_field.cc        \
396  google/protobuf/compiler/java/java_primitive_field.h         \
397  google/protobuf/compiler/java/java_primitive_field_lite.cc   \
398  google/protobuf/compiler/java/java_primitive_field_lite.h    \
399  google/protobuf/compiler/java/java_shared_code_generator.cc  \
400  google/protobuf/compiler/java/java_shared_code_generator.h   \
401  google/protobuf/compiler/java/java_service.cc                \
402  google/protobuf/compiler/java/java_service.h                 \
403  google/protobuf/compiler/java/java_string_field.cc           \
404  google/protobuf/compiler/java/java_string_field.h            \
405  google/protobuf/compiler/java/java_string_field_lite.cc      \
406  google/protobuf/compiler/java/java_string_field_lite.h       \
407  google/protobuf/compiler/java/java_doc_comment.cc            \
408  google/protobuf/compiler/java/java_doc_comment.h             \
409  google/protobuf/compiler/js/js_generator.cc                  \
410  google/protobuf/compiler/js/well_known_types_embed.cc        \
411  google/protobuf/compiler/objectivec/objectivec_enum.cc       \
412  google/protobuf/compiler/objectivec/objectivec_enum.h        \
413  google/protobuf/compiler/objectivec/objectivec_enum_field.cc \
414  google/protobuf/compiler/objectivec/objectivec_enum_field.h  \
415  google/protobuf/compiler/objectivec/objectivec_extension.cc  \
416  google/protobuf/compiler/objectivec/objectivec_extension.h   \
417  google/protobuf/compiler/objectivec/objectivec_field.cc      \
418  google/protobuf/compiler/objectivec/objectivec_field.h       \
419  google/protobuf/compiler/objectivec/objectivec_file.cc       \
420  google/protobuf/compiler/objectivec/objectivec_file.h        \
421  google/protobuf/compiler/objectivec/objectivec_generator.cc  \
422  google/protobuf/compiler/objectivec/objectivec_helpers.cc    \
423  google/protobuf/compiler/objectivec/objectivec_helpers.h     \
424  google/protobuf/compiler/objectivec/objectivec_map_field.cc  \
425  google/protobuf/compiler/objectivec/objectivec_map_field.h   \
426  google/protobuf/compiler/objectivec/objectivec_message.cc    \
427  google/protobuf/compiler/objectivec/objectivec_message.h     \
428  google/protobuf/compiler/objectivec/objectivec_message_field.cc \
429  google/protobuf/compiler/objectivec/objectivec_message_field.h \
430  google/protobuf/compiler/objectivec/objectivec_nsobject_methods.h  \
431  google/protobuf/compiler/objectivec/objectivec_oneof.cc      \
432  google/protobuf/compiler/objectivec/objectivec_oneof.h       \
433  google/protobuf/compiler/objectivec/objectivec_primitive_field.cc \
434  google/protobuf/compiler/objectivec/objectivec_primitive_field.h \
435  google/protobuf/compiler/php/php_generator.cc                \
436  google/protobuf/compiler/python/python_generator.cc          \
437  google/protobuf/compiler/ruby/ruby_generator.cc              \
438  google/protobuf/compiler/csharp/csharp_doc_comment.cc        \
439  google/protobuf/compiler/csharp/csharp_doc_comment.h         \
440  google/protobuf/compiler/csharp/csharp_enum.cc               \
441  google/protobuf/compiler/csharp/csharp_enum.h                \
442  google/protobuf/compiler/csharp/csharp_enum_field.cc         \
443  google/protobuf/compiler/csharp/csharp_enum_field.h          \
444  google/protobuf/compiler/csharp/csharp_field_base.cc         \
445  google/protobuf/compiler/csharp/csharp_field_base.h          \
446  google/protobuf/compiler/csharp/csharp_generator.cc          \
447  google/protobuf/compiler/csharp/csharp_helpers.cc            \
448  google/protobuf/compiler/csharp/csharp_helpers.h             \
449  google/protobuf/compiler/csharp/csharp_map_field.cc          \
450  google/protobuf/compiler/csharp/csharp_map_field.h           \
451  google/protobuf/compiler/csharp/csharp_message.cc            \
452  google/protobuf/compiler/csharp/csharp_message.h             \
453  google/protobuf/compiler/csharp/csharp_message_field.cc      \
454  google/protobuf/compiler/csharp/csharp_message_field.h       \
455  google/protobuf/compiler/csharp/csharp_options.h             \
456  google/protobuf/compiler/csharp/csharp_primitive_field.cc    \
457  google/protobuf/compiler/csharp/csharp_primitive_field.h     \
458  google/protobuf/compiler/csharp/csharp_reflection_class.cc     \
459  google/protobuf/compiler/csharp/csharp_reflection_class.h      \
460  google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc \
461  google/protobuf/compiler/csharp/csharp_repeated_enum_field.h \
462  google/protobuf/compiler/csharp/csharp_repeated_message_field.cc \
463  google/protobuf/compiler/csharp/csharp_repeated_message_field.h \
464  google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc \
465  google/protobuf/compiler/csharp/csharp_repeated_primitive_field.h \
466  google/protobuf/compiler/csharp/csharp_source_generator_base.cc \
467  google/protobuf/compiler/csharp/csharp_source_generator_base.h \
468  google/protobuf/compiler/csharp/csharp_wrapper_field.cc      \
469  google/protobuf/compiler/csharp/csharp_wrapper_field.h
470
471bin_PROGRAMS = protoc
472protoc_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la
473protoc_SOURCES = google/protobuf/compiler/main.cc
474
475# Tests ==============================================================
476
477protoc_inputs =                                                   \
478  google/protobuf/any_test.proto                                  \
479  google/protobuf/compiler/cpp/cpp_test_bad_identifiers.proto     \
480  google/protobuf/map_lite_unittest.proto                         \
481  google/protobuf/map_proto2_unittest.proto                       \
482  google/protobuf/map_unittest.proto                              \
483  google/protobuf/unittest_arena.proto                            \
484  google/protobuf/unittest_custom_options.proto                   \
485  google/protobuf/unittest_drop_unknown_fields.proto              \
486  google/protobuf/unittest_embed_optimize_for.proto               \
487  google/protobuf/unittest_empty.proto                            \
488  google/protobuf/unittest_enormous_descriptor.proto              \
489  google/protobuf/unittest_import_lite.proto                      \
490  google/protobuf/unittest_import.proto                           \
491  google/protobuf/unittest_import_public_lite.proto               \
492  google/protobuf/unittest_import_public.proto                    \
493  google/protobuf/unittest_lazy_dependencies.proto                \
494  google/protobuf/unittest_lazy_dependencies_custom_option.proto  \
495  google/protobuf/unittest_lazy_dependencies_enum.proto           \
496  google/protobuf/unittest_lite_imports_nonlite.proto             \
497  google/protobuf/unittest_lite.proto                             \
498  google/protobuf/unittest_mset.proto                             \
499  google/protobuf/unittest_mset_wire_format.proto                 \
500  google/protobuf/unittest_no_field_presence.proto                \
501  google/protobuf/unittest_no_generic_services.proto              \
502  google/protobuf/unittest_optimize_for.proto                     \
503  google/protobuf/unittest_preserve_unknown_enum2.proto           \
504  google/protobuf/unittest_preserve_unknown_enum.proto            \
505  google/protobuf/unittest.proto                                  \
506  google/protobuf/unittest_proto3.proto                           \
507  google/protobuf/unittest_proto3_arena.proto                     \
508  google/protobuf/unittest_proto3_arena_lite.proto                \
509  google/protobuf/unittest_proto3_lite.proto                      \
510  google/protobuf/unittest_proto3_optional.proto                  \
511  google/protobuf/unittest_well_known_types.proto                 \
512  google/protobuf/util/internal/testdata/anys.proto               \
513  google/protobuf/util/internal/testdata/books.proto              \
514  google/protobuf/util/internal/testdata/default_value.proto      \
515  google/protobuf/util/internal/testdata/default_value_test.proto \
516  google/protobuf/util/internal/testdata/field_mask.proto         \
517  google/protobuf/util/internal/testdata/maps.proto               \
518  google/protobuf/util/internal/testdata/oneofs.proto             \
519  google/protobuf/util/internal/testdata/proto3.proto             \
520  google/protobuf/util/internal/testdata/struct.proto             \
521  google/protobuf/util/internal/testdata/timestamp_duration.proto \
522  google/protobuf/util/internal/testdata/wrappers.proto           \
523  google/protobuf/util/json_format.proto                          \
524  google/protobuf/util/json_format_proto3.proto                   \
525  google/protobuf/util/message_differencer_unittest.proto         \
526  google/protobuf/compiler/cpp/cpp_test_large_enum_value.proto
527
528EXTRA_DIST =                                                   \
529  $(protoc_inputs)                                             \
530  solaris/libstdc++.la                                         \
531  google/protobuf/test_messages_proto3.proto                   \
532  google/protobuf/test_messages_proto2.proto                   \
533  google/protobuf/io/gzip_stream.h                             \
534  google/protobuf/io/gzip_stream_unittest.sh                   \
535  google/protobuf/testdata/golden_message                      \
536  google/protobuf/testdata/golden_message_maps                 \
537  google/protobuf/testdata/golden_message_oneof_implemented    \
538  google/protobuf/testdata/golden_message_proto3               \
539  google/protobuf/testdata/golden_packed_fields_message        \
540  google/protobuf/testdata/bad_utf8_string                     \
541  google/protobuf/testdata/map_test_data.txt                   \
542  google/protobuf/testdata/text_format_unittest_data.txt       \
543  google/protobuf/testdata/text_format_unittest_data_oneof_implemented.txt  \
544  google/protobuf/testdata/text_format_unittest_data_pointy.txt             \
545  google/protobuf/testdata/text_format_unittest_data_pointy_oneof.txt       \
546  google/protobuf/testdata/text_format_unittest_extensions_data.txt         \
547  google/protobuf/testdata/text_format_unittest_extensions_data_pointy.txt  \
548  google/protobuf/package_info.h                               \
549  google/protobuf/io/package_info.h                            \
550  google/protobuf/util/package_info.h                          \
551  google/protobuf/compiler/ruby/ruby_generated_code.proto      \
552  google/protobuf/compiler/ruby/ruby_generated_code_pb.rb      \
553  google/protobuf/compiler/ruby/ruby_generated_code_proto2.proto         \
554  google/protobuf/compiler/ruby/ruby_generated_code_proto2_pb.rb         \
555  google/protobuf/compiler/ruby/ruby_generated_pkg_explicit.proto        \
556  google/protobuf/compiler/ruby/ruby_generated_pkg_explicit_legacy.proto \
557  google/protobuf/compiler/ruby/ruby_generated_pkg_explicit_legacy_pb.rb \
558  google/protobuf/compiler/ruby/ruby_generated_pkg_explicit_pb.rb        \
559  google/protobuf/compiler/ruby/ruby_generated_pkg_implicit.proto        \
560  google/protobuf/compiler/ruby/ruby_generated_pkg_implicit_pb.rb        \
561  google/protobuf/compiler/package_info.h                      \
562  google/protobuf/compiler/zip_output_unittest.sh              \
563  libprotobuf-lite.map                                         \
564  libprotobuf.map                                              \
565  libprotoc.map                                                \
566  README.md
567
568protoc_lite_outputs =                                          \
569  google/protobuf/map_lite_unittest.pb.cc                      \
570  google/protobuf/map_lite_unittest.pb.h                       \
571  google/protobuf/unittest_lite.pb.cc                          \
572  google/protobuf/unittest_lite.pb.h                           \
573  google/protobuf/unittest_import_lite.pb.cc                   \
574  google/protobuf/unittest_import_lite.pb.h                    \
575  google/protobuf/unittest_import_public_lite.pb.cc            \
576  google/protobuf/unittest_import_public_lite.pb.h
577
578protoc_outputs =                                                  \
579  $(protoc_lite_outputs)                                          \
580  google/protobuf/any_test.pb.cc                                  \
581  google/protobuf/any_test.pb.h                                   \
582  google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc     \
583  google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.h      \
584  google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc    \
585  google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.h     \
586  google/protobuf/map_proto2_unittest.pb.cc                       \
587  google/protobuf/map_proto2_unittest.pb.h                        \
588  google/protobuf/map_unittest.pb.cc                              \
589  google/protobuf/map_unittest.pb.h                               \
590  google/protobuf/unittest_arena.pb.cc                            \
591  google/protobuf/unittest_arena.pb.h                             \
592  google/protobuf/unittest_custom_options.pb.cc                   \
593  google/protobuf/unittest_custom_options.pb.h                    \
594  google/protobuf/unittest_drop_unknown_fields.pb.cc              \
595  google/protobuf/unittest_drop_unknown_fields.pb.h               \
596  google/protobuf/unittest_embed_optimize_for.pb.cc               \
597  google/protobuf/unittest_embed_optimize_for.pb.h                \
598  google/protobuf/unittest_empty.pb.cc                            \
599  google/protobuf/unittest_empty.pb.h                             \
600  google/protobuf/unittest_enormous_descriptor.pb.cc              \
601  google/protobuf/unittest_enormous_descriptor.pb.h               \
602  google/protobuf/unittest_import.pb.cc                           \
603  google/protobuf/unittest_import.pb.h                            \
604  google/protobuf/unittest_import_public.pb.cc                    \
605  google/protobuf/unittest_import_public.pb.h                     \
606  google/protobuf/unittest_lazy_dependencies.pb.cc                \
607  google/protobuf/unittest_lazy_dependencies.pb.h                 \
608  google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc  \
609  google/protobuf/unittest_lazy_dependencies_custom_option.pb.h   \
610  google/protobuf/unittest_lazy_dependencies_enum.pb.cc           \
611  google/protobuf/unittest_lazy_dependencies_enum.pb.h            \
612  google/protobuf/unittest_lite_imports_nonlite.pb.cc             \
613  google/protobuf/unittest_lite_imports_nonlite.pb.h              \
614  google/protobuf/unittest_mset.pb.cc                             \
615  google/protobuf/unittest_mset.pb.h                              \
616  google/protobuf/unittest_mset_wire_format.pb.cc                 \
617  google/protobuf/unittest_mset_wire_format.pb.h                  \
618  google/protobuf/unittest_no_field_presence.pb.cc                \
619  google/protobuf/unittest_no_field_presence.pb.h                 \
620  google/protobuf/unittest_no_generic_services.pb.cc              \
621  google/protobuf/unittest_no_generic_services.pb.h               \
622  google/protobuf/unittest_optimize_for.pb.cc                     \
623  google/protobuf/unittest_optimize_for.pb.h                      \
624  google/protobuf/unittest.pb.cc                                  \
625  google/protobuf/unittest.pb.h                                   \
626  google/protobuf/unittest_preserve_unknown_enum2.pb.cc           \
627  google/protobuf/unittest_preserve_unknown_enum2.pb.h            \
628  google/protobuf/unittest_preserve_unknown_enum.pb.cc            \
629  google/protobuf/unittest_preserve_unknown_enum.pb.h             \
630  google/protobuf/unittest_proto3.pb.cc                           \
631  google/protobuf/unittest_proto3.pb.h                            \
632  google/protobuf/unittest_proto3_arena.pb.cc                     \
633  google/protobuf/unittest_proto3_arena.pb.h                      \
634  google/protobuf/unittest_proto3_arena_lite.pb.cc                \
635  google/protobuf/unittest_proto3_arena_lite.pb.h                 \
636  google/protobuf/unittest_proto3_lite.pb.cc                      \
637  google/protobuf/unittest_proto3_lite.pb.h                       \
638  google/protobuf/unittest_proto3_optional.pb.cc                  \
639  google/protobuf/unittest_proto3_optional.pb.h                   \
640  google/protobuf/unittest_well_known_types.pb.cc                 \
641  google/protobuf/unittest_well_known_types.pb.h                  \
642  google/protobuf/util/internal/testdata/anys.pb.cc               \
643  google/protobuf/util/internal/testdata/anys.pb.h                \
644  google/protobuf/util/internal/testdata/books.pb.cc              \
645  google/protobuf/util/internal/testdata/books.pb.h               \
646  google/protobuf/util/internal/testdata/default_value.pb.cc      \
647  google/protobuf/util/internal/testdata/default_value.pb.h       \
648  google/protobuf/util/internal/testdata/default_value_test.pb.cc \
649  google/protobuf/util/internal/testdata/default_value_test.pb.h  \
650  google/protobuf/util/internal/testdata/field_mask.pb.cc         \
651  google/protobuf/util/internal/testdata/field_mask.pb.h          \
652  google/protobuf/util/internal/testdata/maps.pb.cc               \
653  google/protobuf/util/internal/testdata/maps.pb.h                \
654  google/protobuf/util/internal/testdata/oneofs.pb.cc             \
655  google/protobuf/util/internal/testdata/oneofs.pb.h              \
656  google/protobuf/util/internal/testdata/proto3.pb.cc             \
657  google/protobuf/util/internal/testdata/proto3.pb.h              \
658  google/protobuf/util/internal/testdata/struct.pb.cc             \
659  google/protobuf/util/internal/testdata/struct.pb.h              \
660  google/protobuf/util/internal/testdata/timestamp_duration.pb.cc \
661  google/protobuf/util/internal/testdata/timestamp_duration.pb.h  \
662  google/protobuf/util/internal/testdata/wrappers.pb.cc           \
663  google/protobuf/util/internal/testdata/wrappers.pb.h            \
664  google/protobuf/util/json_format.pb.cc                          \
665  google/protobuf/util/json_format.pb.h                           \
666  google/protobuf/util/json_format_proto3.pb.cc                   \
667  google/protobuf/util/json_format_proto3.pb.h                    \
668  google/protobuf/util/message_differencer_unittest.pb.cc         \
669  google/protobuf/util/message_differencer_unittest.pb.h
670
671if USE_EXTERNAL_PROTOC
672
673unittest_proto_middleman: $(protoc_inputs)
674	$(PROTOC) -I$(srcdir) --cpp_out=. $^
675	touch unittest_proto_middleman
676
677else
678
679# We have to cd to $(srcdir) before executing protoc because $(protoc_inputs) is
680# relative to srcdir, which may not be the same as the current directory when
681# building out-of-tree.
682unittest_proto_middleman: protoc$(EXEEXT) $(protoc_inputs)
683	oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/protoc$(EXEEXT) -I. --cpp_out=$$oldpwd $(protoc_inputs) --experimental_allow_proto3_optional )
684	touch unittest_proto_middleman
685
686endif
687
688$(protoc_outputs): unittest_proto_middleman
689
690COMMON_TEST_SOURCES =                                          \
691  google/protobuf/arena_test_util.cc                           \
692  google/protobuf/arena_test_util.h                            \
693  google/protobuf/map_test_util.inc                            \
694  google/protobuf/map_test_util.h                              \
695  google/protobuf/map_test_util_impl.h                         \
696  google/protobuf/test_util.cc                                 \
697  google/protobuf/test_util.h                                  \
698  google/protobuf/test_util.inc                                \
699  google/protobuf/test_util2.h                                 \
700  google/protobuf/testing/googletest.cc                        \
701  google/protobuf/testing/googletest.h                         \
702  google/protobuf/testing/file.cc                              \
703  google/protobuf/testing/file.h
704
705GOOGLETEST_BUILD_DIR=../third_party/googletest/googletest
706GOOGLEMOCK_BUILD_DIR=../third_party/googletest/googlemock
707GOOGLETEST_SRC_DIR=$(srcdir)/../third_party/googletest/googletest
708GOOGLEMOCK_SRC_DIR=$(srcdir)/../third_party/googletest/googlemock
709check_PROGRAMS = protoc protobuf-test protobuf-lazy-descriptor-test \
710                 protobuf-lite-test test_plugin protobuf-lite-arena-test \
711                 no-warning-test $(GZCHECKPROGRAMS)
712protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
713                      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la     \
714                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la     \
715                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
716protobuf_test_CPPFLAGS = -I$(GOOGLETEST_SRC_DIR)/include \
717                         -I$(GOOGLEMOCK_SRC_DIR)/include
718# Disable optimization for tests unless the user explicitly asked for it,
719# since test_util.cc takes forever to compile with optimization (with GCC).
720# See configure.ac for more info.
721protobuf_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
722# Doesn't pass on Windows with MSVC
723NON_MSVC_TEST_SOURCES =                                        \
724  google/protobuf/compiler/command_line_interface_unittest.cc
725protobuf_test_SOURCES =                                        \
726  google/protobuf/stubs/bytestream_unittest.cc                 \
727  google/protobuf/stubs/common_unittest.cc                     \
728  google/protobuf/stubs/int128_unittest.cc                     \
729  google/protobuf/io/io_win32_unittest.cc                      \
730  google/protobuf/stubs/statusor_test.cc                       \
731  google/protobuf/stubs/status_test.cc                         \
732  google/protobuf/stubs/stringpiece_unittest.cc                \
733  google/protobuf/stubs/stringprintf_unittest.cc               \
734  google/protobuf/stubs/structurally_valid_unittest.cc         \
735  google/protobuf/stubs/strutil_unittest.cc                    \
736  google/protobuf/stubs/template_util_unittest.cc              \
737  google/protobuf/stubs/time_test.cc                           \
738  google/protobuf/any_test.cc                                  \
739  google/protobuf/arenastring_unittest.cc                      \
740  google/protobuf/arena_unittest.cc                            \
741  google/protobuf/descriptor_database_unittest.cc              \
742  google/protobuf/descriptor_unittest.cc                       \
743  google/protobuf/drop_unknown_fields_test.cc                  \
744  google/protobuf/dynamic_message_unittest.cc                  \
745  google/protobuf/extension_set_unittest.cc                    \
746  google/protobuf/generated_message_reflection_unittest.cc     \
747  google/protobuf/map_field_test.cc                            \
748  google/protobuf/map_test.cc                                  \
749  google/protobuf/message_unittest.cc                          \
750  google/protobuf/message_unittest.inc                         \
751  google/protobuf/no_field_presence_test.cc                    \
752  google/protobuf/preserve_unknown_enum_test.cc                \
753  google/protobuf/proto3_arena_lite_unittest.cc                \
754  google/protobuf/proto3_arena_unittest.cc                     \
755  google/protobuf/proto3_lite_unittest.cc                      \
756  google/protobuf/proto3_lite_unittest.inc                     \
757  google/protobuf/reflection_ops_unittest.cc                   \
758  google/protobuf/repeated_field_reflection_unittest.cc        \
759  google/protobuf/repeated_field_unittest.cc                   \
760  google/protobuf/text_format_unittest.cc                      \
761  google/protobuf/unknown_field_set_unittest.cc                \
762  google/protobuf/well_known_types_unittest.cc                 \
763  google/protobuf/wire_format_unittest.cc                      \
764  google/protobuf/io/coded_stream_unittest.cc                  \
765  google/protobuf/io/printer_unittest.cc                       \
766  google/protobuf/io/tokenizer_unittest.cc                     \
767  google/protobuf/io/zero_copy_stream_unittest.cc              \
768  google/protobuf/compiler/annotation_test_util.h              \
769  google/protobuf/compiler/annotation_test_util.cc             \
770  google/protobuf/compiler/importer_unittest.cc                \
771  google/protobuf/compiler/mock_code_generator.cc              \
772  google/protobuf/compiler/mock_code_generator.h               \
773  google/protobuf/compiler/parser_unittest.cc                  \
774  google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc       \
775  google/protobuf/compiler/cpp/cpp_move_unittest.cc            \
776  google/protobuf/compiler/cpp/cpp_unittest.h                  \
777  google/protobuf/compiler/cpp/cpp_unittest.cc                 \
778  google/protobuf/compiler/cpp/cpp_unittest.inc                \
779  google/protobuf/compiler/cpp/cpp_plugin_unittest.cc          \
780  google/protobuf/compiler/cpp/metadata_test.cc                \
781  google/protobuf/compiler/java/java_plugin_unittest.cc        \
782  google/protobuf/compiler/java/java_doc_comment_unittest.cc   \
783  google/protobuf/compiler/objectivec/objectivec_helpers_unittest.cc \
784  google/protobuf/compiler/python/python_plugin_unittest.cc    \
785  google/protobuf/compiler/ruby/ruby_generator_unittest.cc     \
786  google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc \
787  google/protobuf/compiler/csharp/csharp_generator_unittest.cc \
788  google/protobuf/util/delimited_message_util_test.cc          \
789  google/protobuf/util/field_comparator_test.cc                \
790  google/protobuf/util/field_mask_util_test.cc                 \
791  google/protobuf/util/internal/default_value_objectwriter_test.cc \
792  google/protobuf/util/internal/json_objectwriter_test.cc      \
793  google/protobuf/util/internal/json_stream_parser_test.cc     \
794  google/protobuf/util/internal/protostream_objectsource_test.cc \
795  google/protobuf/util/internal/protostream_objectwriter_test.cc \
796  google/protobuf/util/internal/type_info_test_helper.cc       \
797  google/protobuf/util/json_util_test.cc                       \
798  google/protobuf/util/message_differencer_unittest.cc         \
799  google/protobuf/util/time_util_test.cc                       \
800  google/protobuf/util/type_resolver_util_test.cc              \
801  $(NON_MSVC_TEST_SOURCES)                                     \
802  $(COMMON_TEST_SOURCES)
803nodist_protobuf_test_SOURCES = $(protoc_outputs)
804$(am_protobuf_test_OBJECTS): unittest_proto_middleman
805
806# Run cpp_unittest again with PROTOBUF_TEST_NO_DESCRIPTORS defined.
807protobuf_lazy_descriptor_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la \
808                      libprotoc.la                                   \
809                      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la        \
810                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la        \
811                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
812protobuf_lazy_descriptor_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include \
813                                         -I$(GOOGLETEST_SRC_DIR)/include \
814                                         -DPROTOBUF_TEST_NO_DESCRIPTORS
815protobuf_lazy_descriptor_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
816protobuf_lazy_descriptor_test_SOURCES =                        \
817  google/protobuf/compiler/cpp/cpp_unittest.cc                 \
818  $(COMMON_TEST_SOURCES)
819nodist_protobuf_lazy_descriptor_test_SOURCES = $(protoc_outputs)
820$(am_protobuf_lazy_descriptor_test_OBJECTS): unittest_proto_middleman
821
822COMMON_LITE_TEST_SOURCES =                                             \
823  google/protobuf/arena_test_util.cc                                   \
824  google/protobuf/arena_test_util.h                                    \
825  google/protobuf/map_lite_test_util.cc                                \
826  google/protobuf/map_lite_test_util.h                                 \
827  google/protobuf/test_util_lite.cc                                    \
828  google/protobuf/test_util_lite.h
829
830# Build lite_unittest separately, since it doesn't use gtest. It can't
831# depend on gtest because our internal version of gtest depend on proto
832# full runtime and we want to make sure this test builds without full
833# runtime.
834protobuf_lite_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la     \
835                           $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la \
836                           $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la \
837                           $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
838protobuf_lite_test_CPPFLAGS= -I$(GOOGLEMOCK_SRC_DIR)/include \
839                             -I$(GOOGLETEST_SRC_DIR)/include
840protobuf_lite_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
841protobuf_lite_test_SOURCES =                                           \
842  google/protobuf/lite_unittest.cc                                     \
843  $(COMMON_LITE_TEST_SOURCES)
844nodist_protobuf_lite_test_SOURCES = $(protoc_lite_outputs)
845$(am_protobuf_lite_test_OBJECTS): unittest_proto_middleman
846
847# lite_arena_unittest depends on gtest because teboring@ found that without
848# gtest when building the test internally our memory sanitizer doesn't detect
849# memory leaks (don't know why).
850protobuf_lite_arena_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \
851                      $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la        \
852                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock.la        \
853                      $(GOOGLEMOCK_BUILD_DIR)/lib/libgmock_main.la
854protobuf_lite_arena_test_CPPFLAGS = -I$(GOOGLEMOCK_SRC_DIR)/include  \
855                                    -I$(GOOGLETEST_SRC_DIR)/include
856protobuf_lite_arena_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
857protobuf_lite_arena_test_SOURCES =       \
858  google/protobuf/lite_arena_unittest.cc \
859  $(COMMON_LITE_TEST_SOURCES)
860nodist_protobuf_lite_arena_test_SOURCES = $(protoc_lite_outputs)
861$(am_protobuf_lite_arena_test_OBJECTS): unittest_proto_middleman
862
863# Test plugin binary.
864test_plugin_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
865                    $(GOOGLETEST_BUILD_DIR)/lib/libgtest.la
866test_plugin_CPPFLAGS = -I$(GOOGLETEST_SRC_DIR)/include
867test_plugin_SOURCES =                                          \
868  google/protobuf/compiler/mock_code_generator.cc              \
869  google/protobuf/testing/file.cc                              \
870  google/protobuf/testing/file.h                               \
871  google/protobuf/compiler/test_plugin.cc
872
873if HAVE_ZLIB
874zcgzip_LDADD = $(PTHREAD_LIBS) libprotobuf.la
875zcgzip_SOURCES = google/protobuf/testing/zcgzip.cc
876
877zcgunzip_LDADD = $(PTHREAD_LIBS) libprotobuf.la
878zcgunzip_SOURCES = google/protobuf/testing/zcgunzip.cc
879endif
880
881# This test target is to ensure all our public header files and generated
882# code is free from warnings. We have to be more pedantic about these
883# files because they are compiled by users with different compiler flags.
884no_warning_test.cc:
885	echo "// Generated from Makefile.am" > no_warning_test.cc
886	for FILE in $(nobase_include_HEADERS); do \
887    echo "#include <$${FILE}>" >> no_warning_test.cc; \
888	done
889	echo "int main(int, char**) { return 0; }" >> no_warning_test.cc
890
891no_warning_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la
892no_warning_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_DEF) $(ZLIB_DEF) \
893                           -Wall -Wextra -Werror -Wno-unused-parameter
894nodist_no_warning_test_SOURCES = no_warning_test.cc $(protoc_outputs)
895
896TESTS = protobuf-test protobuf-lazy-descriptor-test protobuf-lite-test \
897        google/protobuf/compiler/zip_output_unittest.sh $(GZTESTS)     \
898        protobuf-lite-arena-test no-warning-test
899