Makefile.am 55.2 KB
Newer Older
temporal's avatar
temporal committed
1 2
## Process this file with automake to produce Makefile.in

3 4 5 6
if HAVE_ZLIB
GZCHECKPROGRAMS = zcgzip zcgunzip
GZHEADERS = google/protobuf/io/gzip_stream.h
GZTESTS = google/protobuf/io/gzip_stream_unittest.sh
7
ZLIB_DEF = -DHAVE_ZLIB=1
8 9 10 11
else
GZCHECKPROGRAMS =
GZHEADERS =
GZTESTS =
12 13 14 15 16 17 18
ZLIB_DEF =
endif

if HAVE_PTHREAD
PTHREAD_DEF = -DHAVE_PTHREAD=1
else
PTHREAD_DEF =
19 20
endif

temporal's avatar
temporal committed
21
if GCC
22 23 24
# Turn on all warnings except for sign comparison (we ignore sign comparison
# in Google so our code base have tons of such warnings).
NO_OPT_CXXFLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_DEF) $(ZLIB_DEF) -Wall -Wno-sign-compare
temporal's avatar
temporal committed
25
else
26
NO_OPT_CXXFLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_DEF) $(ZLIB_DEF)
temporal's avatar
temporal committed
27 28
endif

29 30
AM_CXXFLAGS = $(NO_OPT_CXXFLAGS) $(PROTOBUF_OPT_FLAG)

temporal's avatar
temporal committed
31 32 33 34 35
AM_LDFLAGS = $(PTHREAD_CFLAGS)

# If I say "dist_include_DATA", automake complains that $(includedir) is not
# a "legitimate" directory for DATA.  Screw you, automake.
protodir = $(includedir)
36 37 38 39

# If you are adding new files here, also remember to change the build files for
# all other languages, //protoc-artifacts/build-zip.sh and run
# //update_file_list.sh for bazel.
40 41 42 43 44 45 46 47 48 49 50
nobase_dist_proto_DATA = google/protobuf/descriptor.proto      \
                         google/protobuf/any.proto             \
                         google/protobuf/api.proto             \
                         google/protobuf/duration.proto        \
                         google/protobuf/empty.proto           \
                         google/protobuf/field_mask.proto      \
                         google/protobuf/source_context.proto  \
                         google/protobuf/struct.proto          \
                         google/protobuf/timestamp.proto       \
                         google/protobuf/type.proto            \
                         google/protobuf/wrappers.proto        \
51
                         google/protobuf/compiler/plugin.proto
temporal's avatar
temporal committed
52 53 54 55 56

# Not sure why these don't get cleaned automatically.
clean-local:
	rm -f *.loT

57
CLEANFILES = $(protoc_outputs) unittest_proto_middleman \
58
             testzip.jar testzip.list testzip.proto testzip.zip \
59
             no_warning_test.cc \
60 61
             google/protobuf/compiler/js/well_known_types_embed.cc \
             js_embed$(EXEEXT)
temporal's avatar
temporal committed
62 63 64 65

MAINTAINERCLEANFILES =   \
  Makefile.in

66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
nobase_include_HEADERS =                                         \
  google/protobuf/stubs/atomic_sequence_num.h                    \
  google/protobuf/stubs/atomicops.h                              \
  google/protobuf/stubs/atomicops_internals_power.h              \
  google/protobuf/stubs/atomicops_internals_ppc_gcc.h            \
  google/protobuf/stubs/atomicops_internals_arm64_gcc.h          \
  google/protobuf/stubs/atomicops_internals_arm_gcc.h            \
  google/protobuf/stubs/atomicops_internals_arm_qnx.h            \
  google/protobuf/stubs/atomicops_internals_atomicword_compat.h  \
  google/protobuf/stubs/atomicops_internals_generic_c11_atomic.h \
  google/protobuf/stubs/atomicops_internals_generic_gcc.h        \
  google/protobuf/stubs/atomicops_internals_mips_gcc.h           \
  google/protobuf/stubs/atomicops_internals_solaris.h            \
  google/protobuf/stubs/atomicops_internals_tsan.h               \
  google/protobuf/stubs/atomicops_internals_x86_gcc.h            \
  google/protobuf/stubs/atomicops_internals_x86_msvc.h           \
  google/protobuf/stubs/callback.h                               \
  google/protobuf/stubs/bytestream.h                             \
  google/protobuf/stubs/casts.h                                  \
  google/protobuf/stubs/common.h                                 \
  google/protobuf/stubs/fastmem.h                                \
  google/protobuf/stubs/hash.h                                   \
  google/protobuf/stubs/logging.h                                \
  google/protobuf/stubs/macros.h                                 \
  google/protobuf/stubs/mutex.h                                  \
  google/protobuf/stubs/once.h                                   \
  google/protobuf/stubs/platform_macros.h                        \
  google/protobuf/stubs/port.h                                   \
  google/protobuf/stubs/scoped_ptr.h                             \
  google/protobuf/stubs/shared_ptr.h                             \
  google/protobuf/stubs/singleton.h                              \
  google/protobuf/stubs/status.h                                 \
  google/protobuf/stubs/stl_util.h                               \
  google/protobuf/stubs/stringpiece.h                            \
  google/protobuf/stubs/template_util.h                          \
  google/protobuf/stubs/type_traits.h                            \
  google/protobuf/any.pb.h                                       \
  google/protobuf/api.pb.h                                       \
  google/protobuf/any.h                                          \
  google/protobuf/arena.h                                        \
Jisi Liu's avatar
Jisi Liu committed
106
  google/protobuf/arena_impl.h                                   \
107 108 109 110 111 112 113 114 115 116 117 118
  google/protobuf/arenastring.h                                  \
  google/protobuf/descriptor_database.h                          \
  google/protobuf/descriptor.h                                   \
  google/protobuf/descriptor.pb.h                                \
  google/protobuf/duration.pb.h                                  \
  google/protobuf/dynamic_message.h                              \
  google/protobuf/empty.pb.h                                     \
  google/protobuf/extension_set.h                                \
  google/protobuf/field_mask.pb.h                                \
  google/protobuf/generated_enum_reflection.h                    \
  google/protobuf/generated_enum_util.h                          \
  google/protobuf/generated_message_reflection.h                 \
Feng Xiao's avatar
Feng Xiao committed
119
  google/protobuf/generated_message_table_driven.h               \
120 121 122 123 124 125 126 127 128 129 130 131
  google/protobuf/generated_message_util.h                       \
  google/protobuf/has_bits.h                                     \
  google/protobuf/map_entry.h                                    \
  google/protobuf/map_entry_lite.h                               \
  google/protobuf/map_field.h                                    \
  google/protobuf/map_field_inl.h                                \
  google/protobuf/map_field_lite.h                               \
  google/protobuf/map.h                                          \
  google/protobuf/map_type_handler.h                             \
  google/protobuf/message.h                                      \
  google/protobuf/message_lite.h                                 \
  google/protobuf/metadata.h                                     \
Feng Xiao's avatar
Feng Xiao committed
132
  google/protobuf/metadata_lite.h                                \
133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167
  google/protobuf/reflection.h                                   \
  google/protobuf/reflection_ops.h                               \
  google/protobuf/repeated_field.h                               \
  google/protobuf/service.h                                      \
  google/protobuf/source_context.pb.h                            \
  google/protobuf/struct.pb.h                                    \
  google/protobuf/text_format.h                                  \
  google/protobuf/timestamp.pb.h                                 \
  google/protobuf/type.pb.h                                      \
  google/protobuf/unknown_field_set.h                            \
  google/protobuf/wire_format.h                                  \
  google/protobuf/wire_format_lite.h                             \
  google/protobuf/wire_format_lite_inl.h                         \
  google/protobuf/wrappers.pb.h                                  \
  google/protobuf/io/coded_stream.h                              \
  $(GZHEADERS)                                                   \
  google/protobuf/io/printer.h                                   \
  google/protobuf/io/strtod.h                                    \
  google/protobuf/io/tokenizer.h                                 \
  google/protobuf/io/zero_copy_stream.h                          \
  google/protobuf/io/zero_copy_stream_impl.h                     \
  google/protobuf/io/zero_copy_stream_impl_lite.h                \
  google/protobuf/compiler/code_generator.h                      \
  google/protobuf/compiler/command_line_interface.h              \
  google/protobuf/compiler/importer.h                            \
  google/protobuf/compiler/parser.h                              \
  google/protobuf/compiler/plugin.h                              \
  google/protobuf/compiler/plugin.pb.h                           \
  google/protobuf/compiler/cpp/cpp_generator.h                   \
  google/protobuf/compiler/csharp/csharp_generator.h             \
  google/protobuf/compiler/csharp/csharp_names.h                 \
  google/protobuf/compiler/java/java_generator.h                 \
  google/protobuf/compiler/java/java_names.h                     \
  google/protobuf/compiler/javanano/javanano_generator.h         \
  google/protobuf/compiler/js/js_generator.h                     \
168
  google/protobuf/compiler/js/well_known_types_embed.h           \
169 170 171 172 173 174
  google/protobuf/compiler/objectivec/objectivec_generator.h     \
  google/protobuf/compiler/objectivec/objectivec_helpers.h       \
  google/protobuf/compiler/php/php_generator.h                   \
  google/protobuf/compiler/python/python_generator.h             \
  google/protobuf/compiler/ruby/ruby_generator.h                 \
  google/protobuf/util/type_resolver.h                           \
175
  google/protobuf/util/delimited_message_util.h                  \
176 177 178 179 180
  google/protobuf/util/field_comparator.h                        \
  google/protobuf/util/field_mask_util.h                         \
  google/protobuf/util/json_util.h                               \
  google/protobuf/util/time_util.h                               \
  google/protobuf/util/type_resolver_util.h                      \
181
  google/protobuf/util/message_differencer.h
temporal's avatar
temporal committed
182

183
lib_LTLIBRARIES = libprotobuf-lite.la libprotobuf.la libprotoc.la
temporal's avatar
temporal committed
184

185
libprotobuf_lite_la_LIBADD = $(PTHREAD_LIBS)
186
libprotobuf_lite_la_LDFLAGS = -version-info 14:0:0 -export-dynamic -no-undefined
187 188 189 190
if HAVE_LD_VERSION_SCRIPT
libprotobuf_lite_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotobuf-lite.map
EXTRA_libprotobuf_lite_la_DEPENDENCIES = libprotobuf-lite.map
endif
191
libprotobuf_lite_la_SOURCES =                                  \
192
  google/protobuf/stubs/atomicops_internals_x86_gcc.cc         \
193
  google/protobuf/stubs/atomicops_internals_x86_msvc.cc        \
194 195
  google/protobuf/stubs/bytestream.cc                          \
  google/protobuf/stubs/bytestream.h                           \
temporal's avatar
temporal committed
196 197
  google/protobuf/stubs/common.cc                              \
  google/protobuf/stubs/hash.h                                 \
198 199
  google/protobuf/stubs/int128.cc                              \
  google/protobuf/stubs/int128.h                               \
Jisi Liu's avatar
Jisi Liu committed
200 201
  google/protobuf/stubs/io_win32.cc                            \
  google/protobuf/stubs/io_win32.h                             \
202
  google/protobuf/stubs/map_util.h                             \
203 204
  google/protobuf/stubs/mathutil.h                             \
  google/protobuf/stubs/once.cc                                \
205
  google/protobuf/stubs/shared_ptr.h                           \
206 207 208 209 210 211 212
  google/protobuf/stubs/status.cc                              \
  google/protobuf/stubs/status.h                               \
  google/protobuf/stubs/status_macros.h                        \
  google/protobuf/stubs/statusor.cc                            \
  google/protobuf/stubs/statusor.h                             \
  google/protobuf/stubs/stringpiece.cc                         \
  google/protobuf/stubs/stringpiece.h                          \
213 214
  google/protobuf/stubs/stringprintf.cc                        \
  google/protobuf/stubs/stringprintf.h                         \
215
  google/protobuf/stubs/structurally_valid.cc                  \
Feng Xiao's avatar
Feng Xiao committed
216 217
  google/protobuf/stubs/strutil.cc                             \
  google/protobuf/stubs/strutil.h                              \
218 219
  google/protobuf/stubs/time.cc                                \
  google/protobuf/stubs/time.h                                 \
220 221
  google/protobuf/arena.cc                                     \
  google/protobuf/arenastring.cc                               \
222 223
  google/protobuf/extension_set.cc                             \
  google/protobuf/generated_message_util.cc                    \
Jisi Liu's avatar
Jisi Liu committed
224 225
  google/protobuf/generated_message_table_driven_lite.h        \
  google/protobuf/generated_message_table_driven_lite.cc       \
226 227 228 229
  google/protobuf/message_lite.cc                              \
  google/protobuf/repeated_field.cc                            \
  google/protobuf/wire_format_lite.cc                          \
  google/protobuf/io/coded_stream.cc                           \
230
  google/protobuf/io/coded_stream_inl.h                        \
231
  google/protobuf/io/zero_copy_stream.cc                       \
232
  google/protobuf/io/zero_copy_stream_impl_lite.cc
233 234

libprotobuf_la_LIBADD = $(PTHREAD_LIBS)
235
libprotobuf_la_LDFLAGS = -version-info 14:0:0 -export-dynamic -no-undefined
236 237 238 239
if HAVE_LD_VERSION_SCRIPT
libprotobuf_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotobuf.map
EXTRA_libprotobuf_la_DEPENDENCIES = libprotobuf.map
endif
240 241
libprotobuf_la_SOURCES =                                       \
  $(libprotobuf_lite_la_SOURCES)                               \
242 243
  google/protobuf/any.pb.cc                                    \
  google/protobuf/api.pb.cc                                    \
244
  google/protobuf/stubs/mathlimits.cc                          \
245
  google/protobuf/stubs/mathlimits.h                           \
246
  google/protobuf/any.cc                                       \
temporal's avatar
temporal committed
247 248
  google/protobuf/descriptor.cc                                \
  google/protobuf/descriptor_database.cc                       \
249
  google/protobuf/descriptor.pb.cc                             \
250
  google/protobuf/duration.pb.cc                               \
temporal's avatar
temporal committed
251
  google/protobuf/dynamic_message.cc                           \
252
  google/protobuf/empty.pb.cc                                  \
253
  google/protobuf/extension_set_heavy.cc                       \
254
  google/protobuf/field_mask.pb.cc                             \
temporal's avatar
temporal committed
255
  google/protobuf/generated_message_reflection.cc              \
Jisi Liu's avatar
Jisi Liu committed
256
  google/protobuf/generated_message_table_driven_lite.h        \
Jisi Liu's avatar
Jisi Liu committed
257
  google/protobuf/generated_message_table_driven.cc            \
258
  google/protobuf/map_field.cc                                 \
temporal's avatar
temporal committed
259
  google/protobuf/message.cc                                   \
260
  google/protobuf/reflection_internal.h                        \
temporal's avatar
temporal committed
261 262
  google/protobuf/reflection_ops.cc                            \
  google/protobuf/service.cc                                   \
263 264 265 266
  google/protobuf/source_context.pb.cc                         \
  google/protobuf/struct.pb.cc                                 \
  google/protobuf/stubs/substitute.cc                          \
  google/protobuf/stubs/substitute.h                           \
temporal's avatar
temporal committed
267
  google/protobuf/text_format.cc                               \
268 269
  google/protobuf/timestamp.pb.cc                              \
  google/protobuf/type.pb.cc                                   \
temporal's avatar
temporal committed
270 271
  google/protobuf/unknown_field_set.cc                         \
  google/protobuf/wire_format.cc                               \
272
  google/protobuf/wrappers.pb.cc                               \
273
  google/protobuf/io/gzip_stream.cc                            \
temporal's avatar
temporal committed
274
  google/protobuf/io/printer.cc                                \
275
  google/protobuf/io/strtod.cc                                 \
temporal's avatar
temporal committed
276 277 278
  google/protobuf/io/tokenizer.cc                              \
  google/protobuf/io/zero_copy_stream_impl.cc                  \
  google/protobuf/compiler/importer.cc                         \
279
  google/protobuf/compiler/parser.cc                           \
280
  google/protobuf/util/delimited_message_util.cc               \
281
  google/protobuf/util/field_comparator.cc                     \
282
  google/protobuf/util/field_mask_util.cc                      \
283 284 285 286 287 288 289
  google/protobuf/util/internal/constants.h                    \
  google/protobuf/util/internal/datapiece.cc                   \
  google/protobuf/util/internal/datapiece.h                    \
  google/protobuf/util/internal/default_value_objectwriter.cc  \
  google/protobuf/util/internal/default_value_objectwriter.h   \
  google/protobuf/util/internal/error_listener.cc              \
  google/protobuf/util/internal/error_listener.h               \
Feng Xiao's avatar
Feng Xiao committed
290
  google/protobuf/util/internal/expecting_objectwriter.h       \
291 292 293 294 295 296 297 298 299
  google/protobuf/util/internal/field_mask_utility.cc          \
  google/protobuf/util/internal/field_mask_utility.h           \
  google/protobuf/util/internal/json_escaping.cc               \
  google/protobuf/util/internal/json_escaping.h                \
  google/protobuf/util/internal/json_objectwriter.cc           \
  google/protobuf/util/internal/json_objectwriter.h            \
  google/protobuf/util/internal/json_stream_parser.cc          \
  google/protobuf/util/internal/json_stream_parser.h           \
  google/protobuf/util/internal/location_tracker.h             \
Feng Xiao's avatar
Feng Xiao committed
300 301
  google/protobuf/util/internal/mock_error_listener.h          \
  google/protobuf/util/internal/object_location_tracker.h      \
302 303 304 305 306 307 308
  google/protobuf/util/internal/object_source.h                \
  google/protobuf/util/internal/object_writer.cc               \
  google/protobuf/util/internal/object_writer.h                \
  google/protobuf/util/internal/protostream_objectsource.cc    \
  google/protobuf/util/internal/protostream_objectsource.h     \
  google/protobuf/util/internal/protostream_objectwriter.cc    \
  google/protobuf/util/internal/protostream_objectwriter.h     \
309 310
  google/protobuf/util/internal/proto_writer.cc                \
  google/protobuf/util/internal/proto_writer.h                 \
Feng Xiao's avatar
Feng Xiao committed
311
  google/protobuf/util/internal/structured_objectwriter.h      \
312 313
  google/protobuf/util/internal/type_info.cc                   \
  google/protobuf/util/internal/type_info.h                    \
Feng Xiao's avatar
Feng Xiao committed
314 315
  google/protobuf/util/internal/type_info_test_helper.cc       \
  google/protobuf/util/internal/type_info_test_helper.h        \
316 317 318
  google/protobuf/util/internal/utility.cc                     \
  google/protobuf/util/internal/utility.h                      \
  google/protobuf/util/json_util.cc                            \
319 320 321 322
  google/protobuf/util/message_differencer.cc                  \
  google/protobuf/util/time_util.cc                            \
  google/protobuf/util/type_resolver_util.cc

323
nodist_libprotobuf_la_SOURCES = $(nodist_libprotobuf_lite_la_SOURCES)
temporal's avatar
temporal committed
324 325

libprotoc_la_LIBADD = $(PTHREAD_LIBS) libprotobuf.la
326
libprotoc_la_LDFLAGS = -version-info 14:0:0 -export-dynamic -no-undefined
327 328 329 330
if HAVE_LD_VERSION_SCRIPT
libprotoc_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libprotoc.map
EXTRA_libprotoc_la_DEPENDENCIES = libprotoc.map
endif
temporal's avatar
temporal committed
331 332 333
libprotoc_la_SOURCES =                                         \
  google/protobuf/compiler/code_generator.cc                   \
  google/protobuf/compiler/command_line_interface.cc           \
334 335 336 337
  google/protobuf/compiler/plugin.cc                           \
  google/protobuf/compiler/plugin.pb.cc                        \
  google/protobuf/compiler/subprocess.cc                       \
  google/protobuf/compiler/subprocess.h                        \
338 339
  google/protobuf/compiler/zip_writer.cc                       \
  google/protobuf/compiler/zip_writer.h                        \
temporal's avatar
temporal committed
340 341 342 343 344 345 346 347 348 349 350 351 352
  google/protobuf/compiler/cpp/cpp_enum.cc                     \
  google/protobuf/compiler/cpp/cpp_enum.h                      \
  google/protobuf/compiler/cpp/cpp_enum_field.cc               \
  google/protobuf/compiler/cpp/cpp_enum_field.h                \
  google/protobuf/compiler/cpp/cpp_extension.cc                \
  google/protobuf/compiler/cpp/cpp_extension.h                 \
  google/protobuf/compiler/cpp/cpp_field.cc                    \
  google/protobuf/compiler/cpp/cpp_field.h                     \
  google/protobuf/compiler/cpp/cpp_file.cc                     \
  google/protobuf/compiler/cpp/cpp_file.h                      \
  google/protobuf/compiler/cpp/cpp_generator.cc                \
  google/protobuf/compiler/cpp/cpp_helpers.cc                  \
  google/protobuf/compiler/cpp/cpp_helpers.h                   \
353 354
  google/protobuf/compiler/cpp/cpp_map_field.cc                \
  google/protobuf/compiler/cpp/cpp_map_field.h                 \
temporal's avatar
temporal committed
355 356 357 358
  google/protobuf/compiler/cpp/cpp_message.cc                  \
  google/protobuf/compiler/cpp/cpp_message.h                   \
  google/protobuf/compiler/cpp/cpp_message_field.cc            \
  google/protobuf/compiler/cpp/cpp_message_field.h             \
359
  google/protobuf/compiler/cpp/cpp_message_layout_helper.h     \
360
  google/protobuf/compiler/cpp/cpp_options.h                   \
361 362
  google/protobuf/compiler/cpp/cpp_padding_optimizer.cc        \
  google/protobuf/compiler/cpp/cpp_padding_optimizer.h         \
temporal's avatar
temporal committed
363 364 365 366 367 368
  google/protobuf/compiler/cpp/cpp_primitive_field.cc          \
  google/protobuf/compiler/cpp/cpp_primitive_field.h           \
  google/protobuf/compiler/cpp/cpp_service.cc                  \
  google/protobuf/compiler/cpp/cpp_service.h                   \
  google/protobuf/compiler/cpp/cpp_string_field.cc             \
  google/protobuf/compiler/cpp/cpp_string_field.h              \
369 370
  google/protobuf/compiler/java/java_context.cc                \
  google/protobuf/compiler/java/java_context.h                 \
temporal's avatar
temporal committed
371
  google/protobuf/compiler/java/java_enum.cc                   \
372
  google/protobuf/compiler/java/java_enum_lite.cc              \
temporal's avatar
temporal committed
373 374
  google/protobuf/compiler/java/java_enum_field.cc             \
  google/protobuf/compiler/java/java_enum_field.h              \
375 376
  google/protobuf/compiler/java/java_enum_field_lite.cc        \
  google/protobuf/compiler/java/java_enum_field_lite.h         \
377
  google/protobuf/compiler/java/java_enum.h                    \
378
  google/protobuf/compiler/java/java_enum_lite.h               \
temporal's avatar
temporal committed
379 380
  google/protobuf/compiler/java/java_extension.cc              \
  google/protobuf/compiler/java/java_extension.h               \
381 382
  google/protobuf/compiler/java/java_extension_lite.cc         \
  google/protobuf/compiler/java/java_extension_lite.h          \
temporal's avatar
temporal committed
383 384 385 386 387
  google/protobuf/compiler/java/java_field.cc                  \
  google/protobuf/compiler/java/java_field.h                   \
  google/protobuf/compiler/java/java_file.cc                   \
  google/protobuf/compiler/java/java_file.h                    \
  google/protobuf/compiler/java/java_generator.cc              \
388 389
  google/protobuf/compiler/java/java_generator_factory.cc      \
  google/protobuf/compiler/java/java_generator_factory.h       \
temporal's avatar
temporal committed
390 391
  google/protobuf/compiler/java/java_helpers.cc                \
  google/protobuf/compiler/java/java_helpers.h                 \
392 393
  google/protobuf/compiler/java/java_lazy_message_field.cc     \
  google/protobuf/compiler/java/java_lazy_message_field.h      \
394 395
  google/protobuf/compiler/java/java_lazy_message_field_lite.cc\
  google/protobuf/compiler/java/java_lazy_message_field_lite.h \
396 397
  google/protobuf/compiler/java/java_map_field.cc              \
  google/protobuf/compiler/java/java_map_field.h               \
398 399
  google/protobuf/compiler/java/java_map_field_lite.cc         \
  google/protobuf/compiler/java/java_map_field_lite.h          \
temporal's avatar
temporal committed
400
  google/protobuf/compiler/java/java_message.cc                \
401 402 403
  google/protobuf/compiler/java/java_message_lite.cc           \
  google/protobuf/compiler/java/java_message_builder.cc        \
  google/protobuf/compiler/java/java_message_builder_lite.cc   \
temporal's avatar
temporal committed
404 405
  google/protobuf/compiler/java/java_message_field.cc          \
  google/protobuf/compiler/java/java_message_field.h           \
406 407
  google/protobuf/compiler/java/java_message_field_lite.cc     \
  google/protobuf/compiler/java/java_message_field_lite.h      \
408
  google/protobuf/compiler/java/java_message.h                 \
409 410 411
  google/protobuf/compiler/java/java_message_lite.h            \
  google/protobuf/compiler/java/java_message_builder.h         \
  google/protobuf/compiler/java/java_message_builder_lite.h    \
412 413
  google/protobuf/compiler/java/java_name_resolver.cc          \
  google/protobuf/compiler/java/java_name_resolver.h           \
414
  google/protobuf/compiler/java/java_options.h                 \
temporal's avatar
temporal committed
415 416
  google/protobuf/compiler/java/java_primitive_field.cc        \
  google/protobuf/compiler/java/java_primitive_field.h         \
417 418
  google/protobuf/compiler/java/java_primitive_field_lite.cc   \
  google/protobuf/compiler/java/java_primitive_field_lite.h    \
419 420
  google/protobuf/compiler/java/java_shared_code_generator.cc  \
  google/protobuf/compiler/java/java_shared_code_generator.h   \
temporal's avatar
temporal committed
421 422
  google/protobuf/compiler/java/java_service.cc                \
  google/protobuf/compiler/java/java_service.h                 \
423 424
  google/protobuf/compiler/java/java_string_field.cc           \
  google/protobuf/compiler/java/java_string_field.h            \
425 426
  google/protobuf/compiler/java/java_string_field_lite.cc      \
  google/protobuf/compiler/java/java_string_field_lite.h       \
427 428
  google/protobuf/compiler/java/java_doc_comment.cc            \
  google/protobuf/compiler/java/java_doc_comment.h             \
429
  google/protobuf/compiler/js/js_generator.cc                  \
430
  google/protobuf/compiler/js/well_known_types_embed.cc        \
431
  google/protobuf/compiler/javanano/javanano_enum.cc           \
432 433
  google/protobuf/compiler/javanano/javanano_enum.h            \
  google/protobuf/compiler/javanano/javanano_enum_field.cc     \
434 435
  google/protobuf/compiler/javanano/javanano_enum_field.h      \
  google/protobuf/compiler/javanano/javanano_extension.cc      \
436
  google/protobuf/compiler/javanano/javanano_extension.h       \
437
  google/protobuf/compiler/javanano/javanano_field.cc          \
438
  google/protobuf/compiler/javanano/javanano_field.h           \
439
  google/protobuf/compiler/javanano/javanano_file.cc           \
440
  google/protobuf/compiler/javanano/javanano_file.h            \
441
  google/protobuf/compiler/javanano/javanano_generator.cc      \
442
  google/protobuf/compiler/javanano/javanano_generator.h       \
443
  google/protobuf/compiler/javanano/javanano_helpers.cc        \
444 445 446
  google/protobuf/compiler/javanano/javanano_helpers.h         \
  google/protobuf/compiler/javanano/javanano_map_field.cc      \
  google/protobuf/compiler/javanano/javanano_map_field.h       \
447
  google/protobuf/compiler/javanano/javanano_message.cc        \
448 449
  google/protobuf/compiler/javanano/javanano_message.h         \
  google/protobuf/compiler/javanano/javanano_message_field.cc  \
450 451 452
  google/protobuf/compiler/javanano/javanano_message_field.h   \
  google/protobuf/compiler/javanano/javanano_params.h          \
  google/protobuf/compiler/javanano/javanano_primitive_field.cc \
453
  google/protobuf/compiler/javanano/javanano_primitive_field.h \
454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476
  google/protobuf/compiler/objectivec/objectivec_enum.cc       \
  google/protobuf/compiler/objectivec/objectivec_enum.h        \
  google/protobuf/compiler/objectivec/objectivec_enum_field.cc \
  google/protobuf/compiler/objectivec/objectivec_enum_field.h  \
  google/protobuf/compiler/objectivec/objectivec_extension.cc  \
  google/protobuf/compiler/objectivec/objectivec_extension.h   \
  google/protobuf/compiler/objectivec/objectivec_field.cc      \
  google/protobuf/compiler/objectivec/objectivec_field.h       \
  google/protobuf/compiler/objectivec/objectivec_file.cc       \
  google/protobuf/compiler/objectivec/objectivec_file.h        \
  google/protobuf/compiler/objectivec/objectivec_generator.cc  \
  google/protobuf/compiler/objectivec/objectivec_helpers.cc    \
  google/protobuf/compiler/objectivec/objectivec_helpers.h     \
  google/protobuf/compiler/objectivec/objectivec_map_field.cc  \
  google/protobuf/compiler/objectivec/objectivec_map_field.h   \
  google/protobuf/compiler/objectivec/objectivec_message.cc    \
  google/protobuf/compiler/objectivec/objectivec_message.h     \
  google/protobuf/compiler/objectivec/objectivec_message_field.cc \
  google/protobuf/compiler/objectivec/objectivec_message_field.h \
  google/protobuf/compiler/objectivec/objectivec_oneof.cc      \
  google/protobuf/compiler/objectivec/objectivec_oneof.h       \
  google/protobuf/compiler/objectivec/objectivec_primitive_field.cc \
  google/protobuf/compiler/objectivec/objectivec_primitive_field.h \
477
  google/protobuf/compiler/php/php_generator.cc                \
Chris Fallin's avatar
Chris Fallin committed
478
  google/protobuf/compiler/python/python_generator.cc          \
479
  google/protobuf/compiler/ruby/ruby_generator.cc              \
480 481
  google/protobuf/compiler/csharp/csharp_doc_comment.cc        \
  google/protobuf/compiler/csharp/csharp_doc_comment.h         \
482
  google/protobuf/compiler/csharp/csharp_enum.cc               \
483
  google/protobuf/compiler/csharp/csharp_enum.h                \
484
  google/protobuf/compiler/csharp/csharp_enum_field.cc         \
485
  google/protobuf/compiler/csharp/csharp_enum_field.h          \
486
  google/protobuf/compiler/csharp/csharp_field_base.cc         \
487
  google/protobuf/compiler/csharp/csharp_field_base.h          \
488 489
  google/protobuf/compiler/csharp/csharp_generator.cc          \
  google/protobuf/compiler/csharp/csharp_helpers.cc            \
490
  google/protobuf/compiler/csharp/csharp_helpers.h             \
Jon Skeet's avatar
Jon Skeet committed
491 492
  google/protobuf/compiler/csharp/csharp_map_field.cc          \
  google/protobuf/compiler/csharp/csharp_map_field.h           \
493
  google/protobuf/compiler/csharp/csharp_message.cc            \
494
  google/protobuf/compiler/csharp/csharp_message.h             \
495
  google/protobuf/compiler/csharp/csharp_message_field.cc      \
496
  google/protobuf/compiler/csharp/csharp_message_field.h       \
497
  google/protobuf/compiler/csharp/csharp_options.h             \
498
  google/protobuf/compiler/csharp/csharp_primitive_field.cc    \
499
  google/protobuf/compiler/csharp/csharp_primitive_field.h     \
500 501
  google/protobuf/compiler/csharp/csharp_reflection_class.cc     \
  google/protobuf/compiler/csharp/csharp_reflection_class.h      \
502
  google/protobuf/compiler/csharp/csharp_repeated_enum_field.cc \
503
  google/protobuf/compiler/csharp/csharp_repeated_enum_field.h \
504
  google/protobuf/compiler/csharp/csharp_repeated_message_field.cc \
505
  google/protobuf/compiler/csharp/csharp_repeated_message_field.h \
506
  google/protobuf/compiler/csharp/csharp_repeated_primitive_field.cc \
507
  google/protobuf/compiler/csharp/csharp_repeated_primitive_field.h \
508
  google/protobuf/compiler/csharp/csharp_source_generator_base.cc \
509
  google/protobuf/compiler/csharp/csharp_source_generator_base.h \
510 511
  google/protobuf/compiler/csharp/csharp_wrapper_field.cc      \
  google/protobuf/compiler/csharp/csharp_wrapper_field.h
temporal's avatar
temporal committed
512

513
bin_PROGRAMS = protoc
temporal's avatar
temporal committed
514 515 516
protoc_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la
protoc_SOURCES = google/protobuf/compiler/main.cc

517
# The special JS code for the well-known types is linked into the compiler via
518 519 520
# well_known_types_embed.cc, which is generated from .js source files. We have
# to build the js_embed binary using $(CXX_FOR_BUILD) so that it is executable
# on the build machine in a cross-compilation setup.
521
js_embed$(EXEEXT): $(srcdir)/google/protobuf/compiler/js/embed.cc
522
	$(CXX_FOR_BUILD) -o $@ $<
523 524 525 526
js_well_known_types_sources =                                  \
	google/protobuf/compiler/js/well_known_types/any.js          \
	google/protobuf/compiler/js/well_known_types/struct.js       \
	google/protobuf/compiler/js/well_known_types/timestamp.js
527
# We have to cd to $(srcdir) so that out-of-tree builds work properly.
528
google/protobuf/compiler/js/well_known_types_embed.cc: js_embed$(EXEEXT) $(js_well_known_types_sources)
529 530
	oldpwd=`pwd` && cd $(srcdir) && \
	$$oldpwd/js_embed$(EXEEXT) $(js_well_known_types_sources) > $$oldpwd/$@
531

temporal's avatar
temporal committed
532 533
# Tests ==============================================================

534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549
protoc_inputs =                                                   \
  google/protobuf/any_test.proto                                  \
  google/protobuf/compiler/cpp/cpp_test_bad_identifiers.proto     \
  google/protobuf/map_lite_unittest.proto                         \
  google/protobuf/map_proto2_unittest.proto                       \
  google/protobuf/map_unittest.proto                              \
  google/protobuf/unittest_arena.proto                            \
  google/protobuf/unittest_custom_options.proto                   \
  google/protobuf/unittest_drop_unknown_fields.proto              \
  google/protobuf/unittest_embed_optimize_for.proto               \
  google/protobuf/unittest_empty.proto                            \
  google/protobuf/unittest_enormous_descriptor.proto              \
  google/protobuf/unittest_import_lite.proto                      \
  google/protobuf/unittest_import.proto                           \
  google/protobuf/unittest_import_public_lite.proto               \
  google/protobuf/unittest_import_public.proto                    \
550 551 552
  google/protobuf/unittest_lazy_dependencies.proto                \
  google/protobuf/unittest_lazy_dependencies_custom_option.proto  \
  google/protobuf/unittest_lazy_dependencies_enum.proto           \
553 554 555
  google/protobuf/unittest_lite_imports_nonlite.proto             \
  google/protobuf/unittest_lite.proto                             \
  google/protobuf/unittest_mset.proto                             \
556 557
  google/protobuf/unittest_mset_wire_format.proto                 \
  google/protobuf/unittest_no_arena_lite.proto                    \
558 559 560 561 562 563 564 565 566
  google/protobuf/unittest_no_arena_import.proto                  \
  google/protobuf/unittest_no_arena.proto                         \
  google/protobuf/unittest_no_field_presence.proto                \
  google/protobuf/unittest_no_generic_services.proto              \
  google/protobuf/unittest_optimize_for.proto                     \
  google/protobuf/unittest_preserve_unknown_enum2.proto           \
  google/protobuf/unittest_preserve_unknown_enum.proto            \
  google/protobuf/unittest.proto                                  \
  google/protobuf/unittest_proto3_arena.proto                     \
567 568
  google/protobuf/unittest_proto3_arena_lite.proto                \
  google/protobuf/unittest_proto3_lite.proto                      \
569 570 571 572 573 574 575
  google/protobuf/unittest_well_known_types.proto                 \
  google/protobuf/util/internal/testdata/anys.proto               \
  google/protobuf/util/internal/testdata/books.proto              \
  google/protobuf/util/internal/testdata/default_value.proto      \
  google/protobuf/util/internal/testdata/default_value_test.proto \
  google/protobuf/util/internal/testdata/field_mask.proto         \
  google/protobuf/util/internal/testdata/maps.proto               \
576
  google/protobuf/util/internal/testdata/oneofs.proto             \
Bo Yang's avatar
Bo Yang committed
577
  google/protobuf/util/internal/testdata/proto3.proto             \
578 579
  google/protobuf/util/internal/testdata/struct.proto             \
  google/protobuf/util/internal/testdata/timestamp_duration.proto \
Bo Yang's avatar
Bo Yang committed
580
  google/protobuf/util/internal/testdata/wrappers.proto           \
581
  google/protobuf/util/json_format_proto3.proto                   \
582
  google/protobuf/util/message_differencer_unittest.proto         \
583
  google/protobuf/compiler/cpp/cpp_test_large_enum_value.proto
temporal's avatar
temporal committed
584 585 586

EXTRA_DIST =                                                   \
  $(protoc_inputs)                                             \
587
  $(js_well_known_types_sources)                               \
temporal's avatar
temporal committed
588
  solaris/libstdc++.la                                         \
589 590 591 592 593 594
  google/protobuf/unittest_proto3.proto                        \
  google/protobuf/unittest_import_public_proto3.proto          \
  google/protobuf/unittest_import_proto3.proto                 \
  google/protobuf/test_messages_proto3.proto                   \
  google/protobuf/test_messages_proto2.proto                   \
  google/protobuf/map_unittest_proto3.proto                    \
595 596
  google/protobuf/io/gzip_stream.h                             \
  google/protobuf/io/gzip_stream_unittest.sh                   \
temporal's avatar
temporal committed
597
  google/protobuf/testdata/golden_message                      \
598
  google/protobuf/testdata/golden_message_maps                 \
599
  google/protobuf/testdata/golden_message_oneof_implemented    \
600
  google/protobuf/testdata/golden_message_proto3               \
601
  google/protobuf/testdata/golden_packed_fields_message        \
602
  google/protobuf/testdata/bad_utf8_string                     \
603
  google/protobuf/testdata/map_test_data.txt                   \
604
  google/protobuf/testdata/text_format_unittest_data.txt       \
605
  google/protobuf/testdata/text_format_unittest_data_oneof_implemented.txt  \
606
  google/protobuf/testdata/text_format_unittest_data_pointy.txt             \
607
  google/protobuf/testdata/text_format_unittest_data_pointy_oneof.txt       \
608
  google/protobuf/testdata/text_format_unittest_extensions_data.txt         \
609
  google/protobuf/testdata/text_format_unittest_extensions_data_pointy.txt  \
temporal's avatar
temporal committed
610 611
  google/protobuf/package_info.h                               \
  google/protobuf/io/package_info.h                            \
612
  google/protobuf/util/package_info.h                          \
613
  google/protobuf/compiler/js/embed.cc                         \
614
  google/protobuf/compiler/ruby/ruby_generated_code.proto      \
615
  google/protobuf/compiler/ruby/ruby_generated_code_pb.rb      \
616
  google/protobuf/compiler/package_info.h                      \
617
  google/protobuf/compiler/zip_output_unittest.sh              \
618 619 620
  libprotobuf-lite.map                                         \
  libprotobuf.map                                              \
  libprotoc.map                                                \
621
  README.md
temporal's avatar
temporal committed
622

623
protoc_lite_outputs =                                          \
624 625
  google/protobuf/map_lite_unittest.pb.cc                      \
  google/protobuf/map_lite_unittest.pb.h                       \
626 627
  google/protobuf/unittest_lite.pb.cc                          \
  google/protobuf/unittest_lite.pb.h                           \
628 629
  google/protobuf/unittest_no_arena_lite.pb.cc                 \
  google/protobuf/unittest_no_arena_lite.pb.h                  \
630
  google/protobuf/unittest_import_lite.pb.cc                   \
631 632 633
  google/protobuf/unittest_import_lite.pb.h                    \
  google/protobuf/unittest_import_public_lite.pb.cc            \
  google/protobuf/unittest_import_public_lite.pb.h
634

635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662
protoc_outputs =                                                  \
  $(protoc_lite_outputs)                                          \
  google/protobuf/any_test.pb.cc                                  \
  google/protobuf/any_test.pb.h                                   \
  google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc     \
  google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.h      \
  google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.cc    \
  google/protobuf/compiler/cpp/cpp_test_large_enum_value.pb.h     \
  google/protobuf/map_proto2_unittest.pb.cc                       \
  google/protobuf/map_proto2_unittest.pb.h                        \
  google/protobuf/map_unittest.pb.cc                              \
  google/protobuf/map_unittest.pb.h                               \
  google/protobuf/unittest_arena.pb.cc                            \
  google/protobuf/unittest_arena.pb.h                             \
  google/protobuf/unittest_custom_options.pb.cc                   \
  google/protobuf/unittest_custom_options.pb.h                    \
  google/protobuf/unittest_drop_unknown_fields.pb.cc              \
  google/protobuf/unittest_drop_unknown_fields.pb.h               \
  google/protobuf/unittest_embed_optimize_for.pb.cc               \
  google/protobuf/unittest_embed_optimize_for.pb.h                \
  google/protobuf/unittest_empty.pb.cc                            \
  google/protobuf/unittest_empty.pb.h                             \
  google/protobuf/unittest_enormous_descriptor.pb.cc              \
  google/protobuf/unittest_enormous_descriptor.pb.h               \
  google/protobuf/unittest_import.pb.cc                           \
  google/protobuf/unittest_import.pb.h                            \
  google/protobuf/unittest_import_public.pb.cc                    \
  google/protobuf/unittest_import_public.pb.h                     \
663 664 665 666 667 668
  google/protobuf/unittest_lazy_dependencies.pb.cc                \
  google/protobuf/unittest_lazy_dependencies.pb.h                 \
  google/protobuf/unittest_lazy_dependencies_custom_option.pb.cc  \
  google/protobuf/unittest_lazy_dependencies_custom_option.pb.h   \
  google/protobuf/unittest_lazy_dependencies_enum.pb.cc           \
  google/protobuf/unittest_lazy_dependencies_enum.pb.h            \
669 670 671 672
  google/protobuf/unittest_lite_imports_nonlite.pb.cc             \
  google/protobuf/unittest_lite_imports_nonlite.pb.h              \
  google/protobuf/unittest_mset.pb.cc                             \
  google/protobuf/unittest_mset.pb.h                              \
673 674
  google/protobuf/unittest_mset_wire_format.pb.cc                 \
  google/protobuf/unittest_mset_wire_format.pb.h                  \
675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692
  google/protobuf/unittest_no_arena_import.pb.cc                  \
  google/protobuf/unittest_no_arena_import.pb.h                   \
  google/protobuf/unittest_no_arena.pb.cc                         \
  google/protobuf/unittest_no_arena.pb.h                          \
  google/protobuf/unittest_no_field_presence.pb.cc                \
  google/protobuf/unittest_no_field_presence.pb.h                 \
  google/protobuf/unittest_no_generic_services.pb.cc              \
  google/protobuf/unittest_no_generic_services.pb.h               \
  google/protobuf/unittest_optimize_for.pb.cc                     \
  google/protobuf/unittest_optimize_for.pb.h                      \
  google/protobuf/unittest.pb.cc                                  \
  google/protobuf/unittest.pb.h                                   \
  google/protobuf/unittest_preserve_unknown_enum2.pb.cc           \
  google/protobuf/unittest_preserve_unknown_enum2.pb.h            \
  google/protobuf/unittest_preserve_unknown_enum.pb.cc            \
  google/protobuf/unittest_preserve_unknown_enum.pb.h             \
  google/protobuf/unittest_proto3_arena.pb.cc                     \
  google/protobuf/unittest_proto3_arena.pb.h                      \
693 694 695 696
  google/protobuf/unittest_proto3_arena_lite.pb.cc                \
  google/protobuf/unittest_proto3_arena_lite.pb.h                 \
  google/protobuf/unittest_proto3_lite.pb.cc                      \
  google/protobuf/unittest_proto3_lite.pb.h                       \
697 698 699 700 701 702 703 704 705 706 707 708 709 710
  google/protobuf/unittest_well_known_types.pb.cc                 \
  google/protobuf/unittest_well_known_types.pb.h                  \
  google/protobuf/util/internal/testdata/anys.pb.cc               \
  google/protobuf/util/internal/testdata/anys.pb.h                \
  google/protobuf/util/internal/testdata/books.pb.cc              \
  google/protobuf/util/internal/testdata/books.pb.h               \
  google/protobuf/util/internal/testdata/default_value.pb.cc      \
  google/protobuf/util/internal/testdata/default_value.pb.h       \
  google/protobuf/util/internal/testdata/default_value_test.pb.cc \
  google/protobuf/util/internal/testdata/default_value_test.pb.h  \
  google/protobuf/util/internal/testdata/field_mask.pb.cc         \
  google/protobuf/util/internal/testdata/field_mask.pb.h          \
  google/protobuf/util/internal/testdata/maps.pb.cc               \
  google/protobuf/util/internal/testdata/maps.pb.h                \
711 712
  google/protobuf/util/internal/testdata/oneofs.pb.cc             \
  google/protobuf/util/internal/testdata/oneofs.pb.h              \
Bo Yang's avatar
Bo Yang committed
713 714
  google/protobuf/util/internal/testdata/proto3.pb.cc             \
  google/protobuf/util/internal/testdata/proto3.pb.h              \
715 716 717 718
  google/protobuf/util/internal/testdata/struct.pb.cc             \
  google/protobuf/util/internal/testdata/struct.pb.h              \
  google/protobuf/util/internal/testdata/timestamp_duration.pb.cc \
  google/protobuf/util/internal/testdata/timestamp_duration.pb.h  \
Bo Yang's avatar
Bo Yang committed
719 720
  google/protobuf/util/internal/testdata/wrappers.pb.cc           \
  google/protobuf/util/internal/testdata/wrappers.pb.h            \
721
  google/protobuf/util/json_format_proto3.pb.cc                   \
722 723 724
  google/protobuf/util/json_format_proto3.pb.h                    \
  google/protobuf/util/message_differencer_unittest.pb.cc         \
  google/protobuf/util/message_differencer_unittest.pb.h
temporal's avatar
temporal committed
725

726
BUILT_SOURCES = $(protoc_outputs) google/protobuf/compiler/js/well_known_types_embed.cc
temporal's avatar
temporal committed
727

728 729 730
if USE_EXTERNAL_PROTOC

unittest_proto_middleman: $(protoc_inputs)
731
	$(PROTOC) -I$(srcdir) --cpp_out=. $^
732 733 734 735
	touch unittest_proto_middleman

else

736 737 738
# We have to cd to $(srcdir) before executing protoc because $(protoc_inputs) is
# relative to srcdir, which may not be the same as the current directory when
# building out-of-tree.
temporal's avatar
temporal committed
739
unittest_proto_middleman: protoc$(EXEEXT) $(protoc_inputs)
740
	oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/protoc$(EXEEXT) -I. --cpp_out=$$oldpwd $(protoc_inputs) )
temporal's avatar
temporal committed
741 742
	touch unittest_proto_middleman

743 744
endif

temporal's avatar
temporal committed
745 746
$(protoc_outputs): unittest_proto_middleman

747
COMMON_TEST_SOURCES =                                          \
748 749
  google/protobuf/arena_test_util.cc                           \
  google/protobuf/arena_test_util.h                            \
750 751
  google/protobuf/map_test_util.cc                             \
  google/protobuf/map_test_util.h                              \
752
  google/protobuf/map_test_util_impl.h                         \
753 754 755 756 757 758 759
  google/protobuf/test_util.cc                                 \
  google/protobuf/test_util.h                                  \
  google/protobuf/testing/googletest.cc                        \
  google/protobuf/testing/googletest.h                         \
  google/protobuf/testing/file.cc                              \
  google/protobuf/testing/file.h

760
check_PROGRAMS = protoc protobuf-test protobuf-lazy-descriptor-test \
761
                 protobuf-lite-test test_plugin protobuf-lite-arena-test \
762
                 no-warning-test $(GZCHECKPROGRAMS)
763
protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
Feng Xiao's avatar
Feng Xiao committed
764 765 766 767 768
                      ../gmock/gtest/lib/libgtest.la              \
                      ../gmock/lib/libgmock.la                    \
                      ../gmock/lib/libgmock_main.la
protobuf_test_CPPFLAGS = -I$(srcdir)/../gmock/gtest/include \
                         -I$(srcdir)/../gmock/include
769 770 771 772
# Disable optimization for tests unless the user explicitly asked for it,
# since test_util.cc takes forever to compile with optimization (with GCC).
# See configure.ac for more info.
protobuf_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
temporal's avatar
temporal committed
773
protobuf_test_SOURCES =                                        \
774
  google/protobuf/stubs/bytestream_unittest.cc                 \
temporal's avatar
temporal committed
775
  google/protobuf/stubs/common_unittest.cc                     \
776
  google/protobuf/stubs/int128_unittest.cc                     \
Jisi Liu's avatar
Jisi Liu committed
777
  google/protobuf/stubs/io_win32_unittest.cc                   \
778
  google/protobuf/stubs/once_unittest.cc                       \
779 780 781
  google/protobuf/stubs/statusor_test.cc                       \
  google/protobuf/stubs/status_test.cc                         \
  google/protobuf/stubs/stringpiece_unittest.cc                \
782
  google/protobuf/stubs/stringprintf_unittest.cc               \
783 784
  google/protobuf/stubs/structurally_valid_unittest.cc         \
  google/protobuf/stubs/strutil_unittest.cc                    \
785
  google/protobuf/stubs/template_util_unittest.cc              \
786
  google/protobuf/stubs/time_test.cc                           \
787
  google/protobuf/stubs/type_traits_unittest.cc                \
788
  google/protobuf/any_test.cc                                  \
789 790
  google/protobuf/arenastring_unittest.cc                      \
  google/protobuf/arena_unittest.cc                            \
temporal's avatar
temporal committed
791 792
  google/protobuf/descriptor_database_unittest.cc              \
  google/protobuf/descriptor_unittest.cc                       \
793
  google/protobuf/drop_unknown_fields_test.cc                  \
temporal's avatar
temporal committed
794 795 796
  google/protobuf/dynamic_message_unittest.cc                  \
  google/protobuf/extension_set_unittest.cc                    \
  google/protobuf/generated_message_reflection_unittest.cc     \
797 798
  google/protobuf/map_field_test.cc                            \
  google/protobuf/map_test.cc                                  \
temporal's avatar
temporal committed
799
  google/protobuf/message_unittest.cc                          \
800 801 802
  google/protobuf/no_field_presence_test.cc                    \
  google/protobuf/preserve_unknown_enum_test.cc                \
  google/protobuf/proto3_arena_unittest.cc                     \
803 804
  google/protobuf/proto3_arena_lite_unittest.cc                \
  google/protobuf/proto3_lite_unittest.cc                      \
temporal's avatar
temporal committed
805
  google/protobuf/reflection_ops_unittest.cc                   \
806
  google/protobuf/repeated_field_reflection_unittest.cc        \
807
  google/protobuf/repeated_field_unittest.cc                   \
temporal's avatar
temporal committed
808 809
  google/protobuf/text_format_unittest.cc                      \
  google/protobuf/unknown_field_set_unittest.cc                \
810
  google/protobuf/well_known_types_unittest.cc                 \
temporal's avatar
temporal committed
811 812 813 814 815 816 817
  google/protobuf/wire_format_unittest.cc                      \
  google/protobuf/io/coded_stream_unittest.cc                  \
  google/protobuf/io/printer_unittest.cc                       \
  google/protobuf/io/tokenizer_unittest.cc                     \
  google/protobuf/io/zero_copy_stream_unittest.cc              \
  google/protobuf/compiler/command_line_interface_unittest.cc  \
  google/protobuf/compiler/importer_unittest.cc                \
818 819
  google/protobuf/compiler/mock_code_generator.cc              \
  google/protobuf/compiler/mock_code_generator.h               \
temporal's avatar
temporal committed
820 821
  google/protobuf/compiler/parser_unittest.cc                  \
  google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc       \
822
  google/protobuf/compiler/cpp/cpp_move_unittest.cc            \
823
  google/protobuf/compiler/cpp/cpp_unittest.h                  \
temporal's avatar
temporal committed
824
  google/protobuf/compiler/cpp/cpp_unittest.cc                 \
825
  google/protobuf/compiler/cpp/cpp_plugin_unittest.cc          \
826
  google/protobuf/compiler/cpp/metadata_test.cc                \
827
  google/protobuf/compiler/java/java_plugin_unittest.cc        \
828
  google/protobuf/compiler/java/java_doc_comment_unittest.cc   \
829
  google/protobuf/compiler/objectivec/objectivec_helpers_unittest.cc \
830
  google/protobuf/compiler/python/python_plugin_unittest.cc    \
831
  google/protobuf/compiler/ruby/ruby_generator_unittest.cc     \
832
  google/protobuf/compiler/csharp/csharp_bootstrap_unittest.cc \
833
  google/protobuf/compiler/csharp/csharp_generator_unittest.cc \
834
  google/protobuf/util/delimited_message_util_test.cc          \
835
  google/protobuf/util/field_comparator_test.cc                \
836
  google/protobuf/util/field_mask_util_test.cc                 \
837 838 839 840 841 842 843
  google/protobuf/util/internal/default_value_objectwriter_test.cc \
  google/protobuf/util/internal/json_objectwriter_test.cc      \
  google/protobuf/util/internal/json_stream_parser_test.cc     \
  google/protobuf/util/internal/protostream_objectsource_test.cc \
  google/protobuf/util/internal/protostream_objectwriter_test.cc \
  google/protobuf/util/internal/type_info_test_helper.cc       \
  google/protobuf/util/json_util_test.cc                       \
844
  google/protobuf/util/message_differencer_unittest.cc         \
845
  google/protobuf/util/time_util_test.cc                       \
846
  google/protobuf/util/type_resolver_util_test.cc              \
847
  $(COMMON_TEST_SOURCES)
848 849


850 851 852 853
nodist_protobuf_test_SOURCES = $(protoc_outputs)

# Run cpp_unittest again with PROTOBUF_TEST_NO_DESCRIPTORS defined.
protobuf_lazy_descriptor_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la \
854
                      libprotoc.la                                   \
Feng Xiao's avatar
Feng Xiao committed
855 856 857 858 859
                      ../gmock/gtest/lib/libgtest.la                 \
                      ../gmock/lib/libgmock.la                       \
                      ../gmock/lib/libgmock_main.la
protobuf_lazy_descriptor_test_CPPFLAGS = -I$(srcdir)/../gmock/include       \
                                         -I$(srcdir)/../gmock/gtest/include \
860
                                         -DPROTOBUF_TEST_NO_DESCRIPTORS
861
protobuf_lazy_descriptor_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
862 863 864 865
protobuf_lazy_descriptor_test_SOURCES =                        \
  google/protobuf/compiler/cpp/cpp_unittest.cc                 \
  $(COMMON_TEST_SOURCES)
nodist_protobuf_lazy_descriptor_test_SOURCES = $(protoc_outputs)
temporal's avatar
temporal committed
866

867
COMMON_LITE_TEST_SOURCES =                                             \
868 869
  google/protobuf/arena_test_util.cc                                   \
  google/protobuf/arena_test_util.h                                    \
870 871
  google/protobuf/map_lite_test_util.cc                                \
  google/protobuf/map_lite_test_util.h                                 \
872 873
  google/protobuf/test_util_lite.cc                                    \
  google/protobuf/test_util_lite.h
874 875 876 877 878

# Build lite_unittest separately, since it doesn't use gtest. It can't
# depend on gtest because our internal version of gtest depend on proto
# full runtime and we want to make sure this test builds without full
# runtime.
879 880 881 882 883 884
protobuf_lite_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \
                           ../gmock/gtest/lib/libgtest.la      \
                           ../gmock/lib/libgmock.la            \
                           ../gmock/lib/libgmock_main.la
protobuf_lite_test_CPPFLAGS= -I$(srcdir)/../gmock/include \
                             -I$(srcdir)/../gmock/gtest/include
885 886 887 888
protobuf_lite_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
protobuf_lite_test_SOURCES =                                           \
  google/protobuf/lite_unittest.cc                                     \
  $(COMMON_LITE_TEST_SOURCES)
889 890
nodist_protobuf_lite_test_SOURCES = $(protoc_lite_outputs)

891 892 893 894 895 896 897 898 899 900 901 902 903 904 905
# lite_arena_unittest depends on gtest because teboring@ found that without
# gtest when building the test internally our memory sanitizer doesn't detect
# memory leaks (don't know why).
protobuf_lite_arena_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la \
                      ../gmock/gtest/lib/libgtest.la                 \
                      ../gmock/lib/libgmock.la                       \
                      ../gmock/lib/libgmock_main.la
protobuf_lite_arena_test_CPPFLAGS = -I$(srcdir)/../gmock/include       \
                                    -I$(srcdir)/../gmock/gtest/include
protobuf_lite_arena_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
protobuf_lite_arena_test_SOURCES =       \
  google/protobuf/lite_arena_unittest.cc \
  $(COMMON_LITE_TEST_SOURCES)
nodist_protobuf_lite_arena_test_SOURCES = $(protoc_lite_outputs)

906 907
# Test plugin binary.
test_plugin_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
Feng Xiao's avatar
Feng Xiao committed
908 909
                    ../gmock/gtest/lib/libgtest.la
test_plugin_CPPFLAGS = -I$(srcdir)/../gmock/gtest/include
910 911 912 913 914 915
test_plugin_SOURCES =                                          \
  google/protobuf/compiler/mock_code_generator.cc              \
  google/protobuf/testing/file.cc                              \
  google/protobuf/testing/file.h                               \
  google/protobuf/compiler/test_plugin.cc

916 917 918 919 920 921 922 923
if HAVE_ZLIB
zcgzip_LDADD = $(PTHREAD_LIBS) libprotobuf.la
zcgzip_SOURCES = google/protobuf/testing/zcgzip.cc

zcgunzip_LDADD = $(PTHREAD_LIBS) libprotobuf.la
zcgunzip_SOURCES = google/protobuf/testing/zcgunzip.cc
endif

924 925 926 927 928 929 930 931 932 933
# This test target is to ensure all our public header files and generated
# code is free from warnings. We have to be more pedantic about these
# files because they are compiled by users with different compiler flags.
no_warning_test.cc:
	echo "// Generated from Makefile.am" > no_warning_test.cc
	for FILE in $(nobase_include_HEADERS); do \
	  if ! echo $${FILE} | grep "atomicops"; then \
	    echo "#include <$${FILE}>" >> no_warning_test.cc; \
	  fi \
	done
934
	echo "int main(int, char**) { return 0; }" >> no_warning_test.cc
935

936
no_warning_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la
937
no_warning_test_CXXFLAGS = $(PTHREAD_CFLAGS) $(PTHREAD_DEF) $(ZLIB_DEF) \
938
                           -Wall -Wextra -Werror -Wno-unused-parameter
939 940
nodist_no_warning_test_SOURCES = no_warning_test.cc $(protoc_outputs)

941
TESTS = protobuf-test protobuf-lazy-descriptor-test protobuf-lite-test \
942
        google/protobuf/compiler/zip_output_unittest.sh $(GZTESTS)     \
943
        protobuf-lite-arena-test no-warning-test