Makefile.am 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418
  1. ## Process this file with automake to produce Makefile.in
  2. if HAVE_ZLIB
  3. GZCHECKPROGRAMS = zcgzip zcgunzip
  4. GZHEADERS = google/protobuf/io/gzip_stream.h
  5. GZTESTS = google/protobuf/io/gzip_stream_unittest.sh
  6. else
  7. GZCHECKPROGRAMS =
  8. GZHEADERS =
  9. GZTESTS =
  10. endif
  11. if GCC
  12. # These are good warnings to turn on by default
  13. NO_OPT_CXXFLAGS = $(PTHREAD_CFLAGS) -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare
  14. else
  15. NO_OPT_CXXFLAGS = $(PTHREAD_CFLAGS)
  16. endif
  17. AM_CXXFLAGS = $(NO_OPT_CXXFLAGS) $(PROTOBUF_OPT_FLAG)
  18. AM_LDFLAGS = $(PTHREAD_CFLAGS)
  19. # If I say "dist_include_DATA", automake complains that $(includedir) is not
  20. # a "legitimate" directory for DATA. Screw you, automake.
  21. protodir = $(includedir)
  22. nobase_dist_proto_DATA = google/protobuf/descriptor.proto \
  23. google/protobuf/compiler/plugin.proto
  24. # Not sure why these don't get cleaned automatically.
  25. clean-local:
  26. rm -f *.loT
  27. CLEANFILES = $(protoc_outputs) unittest_proto_middleman \
  28. testzip.jar testzip.list testzip.proto testzip.zip
  29. MAINTAINERCLEANFILES = \
  30. Makefile.in
  31. nobase_include_HEADERS = \
  32. google/protobuf/stubs/atomicops.h \
  33. google/protobuf/stubs/atomicops_internals_arm_gcc.h \
  34. google/protobuf/stubs/atomicops_internals_arm64_gcc.h \
  35. google/protobuf/stubs/atomicops_internals_arm_qnx.h \
  36. google/protobuf/stubs/atomicops_internals_atomicword_compat.h \
  37. google/protobuf/stubs/atomicops_internals_generic_gcc.h \
  38. google/protobuf/stubs/atomicops_internals_macosx.h \
  39. google/protobuf/stubs/atomicops_internals_mips_gcc.h \
  40. google/protobuf/stubs/atomicops_internals_pnacl.h \
  41. google/protobuf/stubs/atomicops_internals_tsan.h \
  42. google/protobuf/stubs/atomicops_internals_x86_gcc.h \
  43. google/protobuf/stubs/atomicops_internals_x86_msvc.h \
  44. google/protobuf/stubs/common.h \
  45. google/protobuf/stubs/platform_macros.h \
  46. google/protobuf/stubs/once.h \
  47. google/protobuf/stubs/stl_util.h \
  48. google/protobuf/stubs/template_util.h \
  49. google/protobuf/stubs/type_traits.h \
  50. google/protobuf/descriptor.h \
  51. google/protobuf/descriptor.pb.h \
  52. google/protobuf/descriptor_database.h \
  53. google/protobuf/dynamic_message.h \
  54. google/protobuf/extension_set.h \
  55. google/protobuf/generated_enum_reflection.h \
  56. google/protobuf/generated_message_util.h \
  57. google/protobuf/generated_message_reflection.h \
  58. google/protobuf/message.h \
  59. google/protobuf/message_lite.h \
  60. google/protobuf/reflection_ops.h \
  61. google/protobuf/repeated_field.h \
  62. google/protobuf/service.h \
  63. google/protobuf/text_format.h \
  64. google/protobuf/unknown_field_set.h \
  65. google/protobuf/wire_format.h \
  66. google/protobuf/wire_format_lite.h \
  67. google/protobuf/wire_format_lite_inl.h \
  68. google/protobuf/io/coded_stream.h \
  69. $(GZHEADERS) \
  70. google/protobuf/io/printer.h \
  71. google/protobuf/io/strtod.h \
  72. google/protobuf/io/tokenizer.h \
  73. google/protobuf/io/zero_copy_stream.h \
  74. google/protobuf/io/zero_copy_stream_impl.h \
  75. google/protobuf/io/zero_copy_stream_impl_lite.h \
  76. google/protobuf/compiler/code_generator.h \
  77. google/protobuf/compiler/command_line_interface.h \
  78. google/protobuf/compiler/importer.h \
  79. google/protobuf/compiler/parser.h \
  80. google/protobuf/compiler/plugin.h \
  81. google/protobuf/compiler/plugin.pb.h \
  82. google/protobuf/compiler/cpp/cpp_generator.h \
  83. google/protobuf/compiler/java/java_generator.h \
  84. google/protobuf/compiler/python/python_generator.h
  85. lib_LTLIBRARIES = libprotobuf-lite.la libprotobuf.la libprotoc.la
  86. libprotobuf_lite_la_LIBADD = $(PTHREAD_LIBS)
  87. libprotobuf_lite_la_LDFLAGS = -version-info 9:0:0 -export-dynamic -no-undefined
  88. libprotobuf_lite_la_SOURCES = \
  89. google/protobuf/stubs/atomicops_internals_x86_gcc.cc \
  90. google/protobuf/stubs/atomicops_internals_x86_msvc.cc \
  91. google/protobuf/stubs/common.cc \
  92. google/protobuf/stubs/once.cc \
  93. google/protobuf/stubs/hash.h \
  94. google/protobuf/stubs/map_util.h \
  95. google/protobuf/stubs/shared_ptr.h \
  96. google/protobuf/stubs/stringprintf.cc \
  97. google/protobuf/stubs/stringprintf.h \
  98. google/protobuf/extension_set.cc \
  99. google/protobuf/generated_message_util.cc \
  100. google/protobuf/message_lite.cc \
  101. google/protobuf/repeated_field.cc \
  102. google/protobuf/wire_format_lite.cc \
  103. google/protobuf/io/coded_stream.cc \
  104. google/protobuf/io/coded_stream_inl.h \
  105. google/protobuf/io/zero_copy_stream.cc \
  106. google/protobuf/io/zero_copy_stream_impl_lite.cc
  107. libprotobuf_la_LIBADD = $(PTHREAD_LIBS)
  108. libprotobuf_la_LDFLAGS = -version-info 9:0:0 -export-dynamic -no-undefined
  109. libprotobuf_la_SOURCES = \
  110. $(libprotobuf_lite_la_SOURCES) \
  111. google/protobuf/stubs/strutil.cc \
  112. google/protobuf/stubs/strutil.h \
  113. google/protobuf/stubs/substitute.cc \
  114. google/protobuf/stubs/substitute.h \
  115. google/protobuf/stubs/structurally_valid.cc \
  116. google/protobuf/descriptor.cc \
  117. google/protobuf/descriptor.pb.cc \
  118. google/protobuf/descriptor_database.cc \
  119. google/protobuf/dynamic_message.cc \
  120. google/protobuf/extension_set_heavy.cc \
  121. google/protobuf/generated_message_reflection.cc \
  122. google/protobuf/message.cc \
  123. google/protobuf/reflection_ops.cc \
  124. google/protobuf/service.cc \
  125. google/protobuf/text_format.cc \
  126. google/protobuf/unknown_field_set.cc \
  127. google/protobuf/wire_format.cc \
  128. google/protobuf/io/gzip_stream.cc \
  129. google/protobuf/io/printer.cc \
  130. google/protobuf/io/strtod.cc \
  131. google/protobuf/io/tokenizer.cc \
  132. google/protobuf/io/zero_copy_stream_impl.cc \
  133. google/protobuf/compiler/importer.cc \
  134. google/protobuf/compiler/parser.cc
  135. libprotoc_la_LIBADD = $(PTHREAD_LIBS) libprotobuf.la
  136. libprotoc_la_LDFLAGS = -version-info 9:0:0 -export-dynamic -no-undefined
  137. libprotoc_la_SOURCES = \
  138. google/protobuf/compiler/code_generator.cc \
  139. google/protobuf/compiler/command_line_interface.cc \
  140. google/protobuf/compiler/plugin.cc \
  141. google/protobuf/compiler/plugin.pb.cc \
  142. google/protobuf/compiler/subprocess.cc \
  143. google/protobuf/compiler/subprocess.h \
  144. google/protobuf/compiler/zip_writer.cc \
  145. google/protobuf/compiler/zip_writer.h \
  146. google/protobuf/compiler/cpp/cpp_enum.cc \
  147. google/protobuf/compiler/cpp/cpp_enum.h \
  148. google/protobuf/compiler/cpp/cpp_enum_field.cc \
  149. google/protobuf/compiler/cpp/cpp_enum_field.h \
  150. google/protobuf/compiler/cpp/cpp_extension.cc \
  151. google/protobuf/compiler/cpp/cpp_extension.h \
  152. google/protobuf/compiler/cpp/cpp_field.cc \
  153. google/protobuf/compiler/cpp/cpp_field.h \
  154. google/protobuf/compiler/cpp/cpp_file.cc \
  155. google/protobuf/compiler/cpp/cpp_file.h \
  156. google/protobuf/compiler/cpp/cpp_generator.cc \
  157. google/protobuf/compiler/cpp/cpp_helpers.cc \
  158. google/protobuf/compiler/cpp/cpp_helpers.h \
  159. google/protobuf/compiler/cpp/cpp_message.cc \
  160. google/protobuf/compiler/cpp/cpp_message.h \
  161. google/protobuf/compiler/cpp/cpp_message_field.cc \
  162. google/protobuf/compiler/cpp/cpp_message_field.h \
  163. google/protobuf/compiler/cpp/cpp_options.h \
  164. google/protobuf/compiler/cpp/cpp_primitive_field.cc \
  165. google/protobuf/compiler/cpp/cpp_primitive_field.h \
  166. google/protobuf/compiler/cpp/cpp_service.cc \
  167. google/protobuf/compiler/cpp/cpp_service.h \
  168. google/protobuf/compiler/cpp/cpp_string_field.cc \
  169. google/protobuf/compiler/cpp/cpp_string_field.h \
  170. google/protobuf/compiler/java/java_context.cc \
  171. google/protobuf/compiler/java/java_context.h \
  172. google/protobuf/compiler/java/java_enum.cc \
  173. google/protobuf/compiler/java/java_enum.h \
  174. google/protobuf/compiler/java/java_enum_field.cc \
  175. google/protobuf/compiler/java/java_enum_field.h \
  176. google/protobuf/compiler/java/java_extension.cc \
  177. google/protobuf/compiler/java/java_extension.h \
  178. google/protobuf/compiler/java/java_field.cc \
  179. google/protobuf/compiler/java/java_field.h \
  180. google/protobuf/compiler/java/java_file.cc \
  181. google/protobuf/compiler/java/java_file.h \
  182. google/protobuf/compiler/java/java_generator.cc \
  183. google/protobuf/compiler/java/java_generator_factory.cc \
  184. google/protobuf/compiler/java/java_generator_factory.h \
  185. google/protobuf/compiler/java/java_helpers.cc \
  186. google/protobuf/compiler/java/java_helpers.h \
  187. google/protobuf/compiler/java/java_lazy_message_field.cc \
  188. google/protobuf/compiler/java/java_lazy_message_field.h \
  189. google/protobuf/compiler/java/java_message.cc \
  190. google/protobuf/compiler/java/java_message.h \
  191. google/protobuf/compiler/java/java_message_field.cc \
  192. google/protobuf/compiler/java/java_message_field.h \
  193. google/protobuf/compiler/java/java_name_resolver.cc \
  194. google/protobuf/compiler/java/java_name_resolver.h \
  195. google/protobuf/compiler/java/java_primitive_field.cc \
  196. google/protobuf/compiler/java/java_primitive_field.h \
  197. google/protobuf/compiler/java/java_shared_code_generator.cc \
  198. google/protobuf/compiler/java/java_shared_code_generator.h \
  199. google/protobuf/compiler/java/java_service.cc \
  200. google/protobuf/compiler/java/java_service.h \
  201. google/protobuf/compiler/java/java_string_field.cc \
  202. google/protobuf/compiler/java/java_string_field.h \
  203. google/protobuf/compiler/java/java_doc_comment.cc \
  204. google/protobuf/compiler/java/java_doc_comment.h \
  205. google/protobuf/compiler/python/python_generator.cc
  206. bin_PROGRAMS = protoc
  207. protoc_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la
  208. protoc_SOURCES = google/protobuf/compiler/main.cc
  209. # Tests ==============================================================
  210. protoc_inputs = \
  211. google/protobuf/unittest.proto \
  212. google/protobuf/unittest_empty.proto \
  213. google/protobuf/unittest_import.proto \
  214. google/protobuf/unittest_import_public.proto \
  215. google/protobuf/unittest_mset.proto \
  216. google/protobuf/unittest_optimize_for.proto \
  217. google/protobuf/unittest_embed_optimize_for.proto \
  218. google/protobuf/unittest_custom_options.proto \
  219. google/protobuf/unittest_lite.proto \
  220. google/protobuf/unittest_import_lite.proto \
  221. google/protobuf/unittest_import_public_lite.proto \
  222. google/protobuf/unittest_lite_imports_nonlite.proto \
  223. google/protobuf/unittest_no_generic_services.proto \
  224. google/protobuf/compiler/cpp/cpp_test_bad_identifiers.proto
  225. EXTRA_DIST = \
  226. $(protoc_inputs) \
  227. solaris/libstdc++.la \
  228. google/protobuf/io/gzip_stream.h \
  229. google/protobuf/io/gzip_stream_unittest.sh \
  230. google/protobuf/testdata/golden_message \
  231. google/protobuf/testdata/golden_message_oneof_implemented \
  232. google/protobuf/testdata/golden_packed_fields_message \
  233. google/protobuf/testdata/bad_utf8_string \
  234. google/protobuf/testdata/text_format_unittest_data.txt \
  235. google/protobuf/testdata/text_format_unittest_data_oneof_implemented.txt \
  236. google/protobuf/testdata/text_format_unittest_data_pointy.txt \
  237. google/protobuf/testdata/text_format_unittest_data_pointy_oneof.txt \
  238. google/protobuf/testdata/text_format_unittest_extensions_data.txt \
  239. google/protobuf/testdata/text_format_unittest_extensions_data_pointy.txt \
  240. google/protobuf/package_info.h \
  241. google/protobuf/io/package_info.h \
  242. google/protobuf/compiler/package_info.h \
  243. google/protobuf/compiler/zip_output_unittest.sh \
  244. google/protobuf/unittest_enormous_descriptor.proto
  245. protoc_lite_outputs = \
  246. google/protobuf/unittest_lite.pb.cc \
  247. google/protobuf/unittest_lite.pb.h \
  248. google/protobuf/unittest_import_lite.pb.cc \
  249. google/protobuf/unittest_import_lite.pb.h \
  250. google/protobuf/unittest_import_public_lite.pb.cc \
  251. google/protobuf/unittest_import_public_lite.pb.h
  252. protoc_outputs = \
  253. $(protoc_lite_outputs) \
  254. google/protobuf/unittest.pb.cc \
  255. google/protobuf/unittest.pb.h \
  256. google/protobuf/unittest_empty.pb.cc \
  257. google/protobuf/unittest_empty.pb.h \
  258. google/protobuf/unittest_import.pb.cc \
  259. google/protobuf/unittest_import.pb.h \
  260. google/protobuf/unittest_import_public.pb.cc \
  261. google/protobuf/unittest_import_public.pb.h \
  262. google/protobuf/unittest_mset.pb.cc \
  263. google/protobuf/unittest_mset.pb.h \
  264. google/protobuf/unittest_optimize_for.pb.cc \
  265. google/protobuf/unittest_optimize_for.pb.h \
  266. google/protobuf/unittest_embed_optimize_for.pb.cc \
  267. google/protobuf/unittest_embed_optimize_for.pb.h \
  268. google/protobuf/unittest_custom_options.pb.cc \
  269. google/protobuf/unittest_custom_options.pb.h \
  270. google/protobuf/unittest_lite_imports_nonlite.pb.cc \
  271. google/protobuf/unittest_lite_imports_nonlite.pb.h \
  272. google/protobuf/unittest_no_generic_services.pb.cc \
  273. google/protobuf/unittest_no_generic_services.pb.h \
  274. google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc \
  275. google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.h
  276. BUILT_SOURCES = $(protoc_outputs)
  277. if USE_EXTERNAL_PROTOC
  278. unittest_proto_middleman: $(protoc_inputs)
  279. $(PROTOC) -I$(srcdir) --cpp_out=. $^
  280. touch unittest_proto_middleman
  281. else
  282. # We have to cd to $(srcdir) before executing protoc because $(protoc_inputs) is
  283. # relative to srcdir, which may not be the same as the current directory when
  284. # building out-of-tree.
  285. unittest_proto_middleman: protoc$(EXEEXT) $(protoc_inputs)
  286. oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/protoc$(EXEEXT) -I. --cpp_out=$$oldpwd $(protoc_inputs) )
  287. touch unittest_proto_middleman
  288. endif
  289. $(protoc_outputs): unittest_proto_middleman
  290. COMMON_TEST_SOURCES = \
  291. google/protobuf/test_util.cc \
  292. google/protobuf/test_util.h \
  293. google/protobuf/testing/googletest.cc \
  294. google/protobuf/testing/googletest.h \
  295. google/protobuf/testing/file.cc \
  296. google/protobuf/testing/file.h
  297. check_PROGRAMS = protoc protobuf-test protobuf-lazy-descriptor-test \
  298. protobuf-lite-test test_plugin $(GZCHECKPROGRAMS)
  299. protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
  300. $(top_builddir)/gtest/lib/libgtest.la \
  301. $(top_builddir)/gtest/lib/libgtest_main.la
  302. protobuf_test_CPPFLAGS = -I$(top_srcdir)/gtest/include \
  303. -I$(top_builddir)/gtest/include
  304. # Disable optimization for tests unless the user explicitly asked for it,
  305. # since test_util.cc takes forever to compile with optimization (with GCC).
  306. # See configure.ac for more info.
  307. protobuf_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
  308. protobuf_test_SOURCES = \
  309. google/protobuf/stubs/common_unittest.cc \
  310. google/protobuf/stubs/once_unittest.cc \
  311. google/protobuf/stubs/strutil_unittest.cc \
  312. google/protobuf/stubs/structurally_valid_unittest.cc \
  313. google/protobuf/stubs/stringprintf_unittest.cc \
  314. google/protobuf/stubs/template_util_unittest.cc \
  315. google/protobuf/stubs/type_traits_unittest.cc \
  316. google/protobuf/descriptor_database_unittest.cc \
  317. google/protobuf/descriptor_unittest.cc \
  318. google/protobuf/dynamic_message_unittest.cc \
  319. google/protobuf/extension_set_unittest.cc \
  320. google/protobuf/generated_message_reflection_unittest.cc \
  321. google/protobuf/message_unittest.cc \
  322. google/protobuf/reflection_ops_unittest.cc \
  323. google/protobuf/repeated_field_unittest.cc \
  324. google/protobuf/repeated_field_reflection_unittest.cc \
  325. google/protobuf/text_format_unittest.cc \
  326. google/protobuf/unknown_field_set_unittest.cc \
  327. google/protobuf/wire_format_unittest.cc \
  328. google/protobuf/io/coded_stream_unittest.cc \
  329. google/protobuf/io/printer_unittest.cc \
  330. google/protobuf/io/tokenizer_unittest.cc \
  331. google/protobuf/io/zero_copy_stream_unittest.cc \
  332. google/protobuf/compiler/command_line_interface_unittest.cc \
  333. google/protobuf/compiler/importer_unittest.cc \
  334. google/protobuf/compiler/mock_code_generator.cc \
  335. google/protobuf/compiler/mock_code_generator.h \
  336. google/protobuf/compiler/parser_unittest.cc \
  337. google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc \
  338. google/protobuf/compiler/cpp/cpp_unittest.h \
  339. google/protobuf/compiler/cpp/cpp_unittest.cc \
  340. google/protobuf/compiler/cpp/cpp_plugin_unittest.cc \
  341. google/protobuf/compiler/java/java_plugin_unittest.cc \
  342. google/protobuf/compiler/java/java_doc_comment_unittest.cc \
  343. google/protobuf/compiler/python/python_plugin_unittest.cc \
  344. $(COMMON_TEST_SOURCES)
  345. nodist_protobuf_test_SOURCES = $(protoc_outputs)
  346. # Run cpp_unittest again with PROTOBUF_TEST_NO_DESCRIPTORS defined.
  347. protobuf_lazy_descriptor_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la \
  348. libprotoc.la \
  349. $(top_builddir)/gtest/lib/libgtest.la \
  350. $(top_builddir)/gtest/lib/libgtest_main.la
  351. protobuf_lazy_descriptor_test_CPPFLAGS = -I$(top_srcdir)/gtest/include \
  352. -I$(top_builddir)/gtest/include \
  353. -DPROTOBUF_TEST_NO_DESCRIPTORS
  354. protobuf_lazy_descriptor_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
  355. protobuf_lazy_descriptor_test_SOURCES = \
  356. google/protobuf/compiler/cpp/cpp_unittest.cc \
  357. $(COMMON_TEST_SOURCES)
  358. nodist_protobuf_lazy_descriptor_test_SOURCES = $(protoc_outputs)
  359. # Build lite_unittest separately, since it doesn't use gtest.
  360. protobuf_lite_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la
  361. protobuf_lite_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
  362. protobuf_lite_test_SOURCES = \
  363. google/protobuf/lite_unittest.cc \
  364. google/protobuf/test_util_lite.cc \
  365. google/protobuf/test_util_lite.h
  366. nodist_protobuf_lite_test_SOURCES = $(protoc_lite_outputs)
  367. # Test plugin binary.
  368. test_plugin_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
  369. $(top_builddir)/gtest/lib/libgtest.la
  370. test_plugin_CPPFLAGS = -I$(top_srcdir)/gtest/include \
  371. -I$(top_builddir)/gtest/include
  372. test_plugin_SOURCES = \
  373. google/protobuf/compiler/mock_code_generator.cc \
  374. google/protobuf/testing/file.cc \
  375. google/protobuf/testing/file.h \
  376. google/protobuf/compiler/test_plugin.cc
  377. if HAVE_ZLIB
  378. zcgzip_LDADD = $(PTHREAD_LIBS) libprotobuf.la
  379. zcgzip_SOURCES = google/protobuf/testing/zcgzip.cc
  380. zcgunzip_LDADD = $(PTHREAD_LIBS) libprotobuf.la
  381. zcgunzip_SOURCES = google/protobuf/testing/zcgunzip.cc
  382. endif
  383. TESTS = protobuf-test protobuf-lazy-descriptor-test protobuf-lite-test \
  384. google/protobuf/compiler/zip_output_unittest.sh $(GZTESTS)