PageRenderTime 42ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/src/Makefile.am

https://code.google.com/
Makefile | 365 lines | 316 code | 34 blank | 15 comment | 6 complexity | c22490c503609ab7065f60942c4dc69f MD5 | raw file
Possible License(s): BSD-3-Clause
  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/common.h \
  33. google/protobuf/stubs/once.h \
  34. google/protobuf/descriptor.h \
  35. google/protobuf/descriptor.pb.h \
  36. google/protobuf/descriptor_database.h \
  37. google/protobuf/dynamic_message.h \
  38. google/protobuf/extension_set.h \
  39. google/protobuf/generated_message_util.h \
  40. google/protobuf/generated_message_reflection.h \
  41. google/protobuf/message.h \
  42. google/protobuf/message_lite.h \
  43. google/protobuf/reflection_ops.h \
  44. google/protobuf/repeated_field.h \
  45. google/protobuf/service.h \
  46. google/protobuf/text_format.h \
  47. google/protobuf/unknown_field_set.h \
  48. google/protobuf/wire_format.h \
  49. google/protobuf/wire_format_lite.h \
  50. google/protobuf/wire_format_lite_inl.h \
  51. google/protobuf/io/coded_stream.h \
  52. $(GZHEADERS) \
  53. google/protobuf/io/printer.h \
  54. google/protobuf/io/tokenizer.h \
  55. google/protobuf/io/zero_copy_stream.h \
  56. google/protobuf/io/zero_copy_stream_impl.h \
  57. google/protobuf/io/zero_copy_stream_impl_lite.h \
  58. google/protobuf/compiler/code_generator.h \
  59. google/protobuf/compiler/command_line_interface.h \
  60. google/protobuf/compiler/importer.h \
  61. google/protobuf/compiler/parser.h \
  62. google/protobuf/compiler/plugin.h \
  63. google/protobuf/compiler/plugin.pb.h \
  64. google/protobuf/compiler/cpp/cpp_generator.h \
  65. google/protobuf/compiler/java/java_generator.h \
  66. google/protobuf/compiler/python/python_generator.h \
  67. farsounder/protobuf/compiler/matlab/matlab_generator.h
  68. lib_LTLIBRARIES = libprotobuf-lite.la libprotobuf.la libprotoc.la
  69. libprotobuf_lite_la_LIBADD = $(PTHREAD_LIBS)
  70. libprotobuf_lite_la_LDFLAGS = -version-info 7:0:0 -export-dynamic -no-undefined
  71. libprotobuf_lite_la_SOURCES = \
  72. google/protobuf/stubs/common.cc \
  73. google/protobuf/stubs/once.cc \
  74. google/protobuf/stubs/hash.h \
  75. google/protobuf/stubs/map-util.h \
  76. google/protobuf/stubs/stl_util-inl.h \
  77. google/protobuf/extension_set.cc \
  78. google/protobuf/generated_message_util.cc \
  79. google/protobuf/message_lite.cc \
  80. google/protobuf/repeated_field.cc \
  81. google/protobuf/wire_format_lite.cc \
  82. google/protobuf/io/coded_stream.cc \
  83. google/protobuf/io/coded_stream_inl.h \
  84. google/protobuf/io/zero_copy_stream.cc \
  85. google/protobuf/io/zero_copy_stream_impl_lite.cc
  86. libprotobuf_la_LIBADD = $(PTHREAD_LIBS)
  87. libprotobuf_la_LDFLAGS = -version-info 7:0:0 -export-dynamic -no-undefined
  88. libprotobuf_la_SOURCES = \
  89. $(libprotobuf_lite_la_SOURCES) \
  90. google/protobuf/stubs/strutil.cc \
  91. google/protobuf/stubs/strutil.h \
  92. google/protobuf/stubs/substitute.cc \
  93. google/protobuf/stubs/substitute.h \
  94. google/protobuf/stubs/structurally_valid.cc \
  95. google/protobuf/descriptor.cc \
  96. google/protobuf/descriptor.pb.cc \
  97. google/protobuf/descriptor_database.cc \
  98. google/protobuf/dynamic_message.cc \
  99. google/protobuf/extension_set_heavy.cc \
  100. google/protobuf/generated_message_reflection.cc \
  101. google/protobuf/message.cc \
  102. google/protobuf/reflection_ops.cc \
  103. google/protobuf/service.cc \
  104. google/protobuf/text_format.cc \
  105. google/protobuf/unknown_field_set.cc \
  106. google/protobuf/wire_format.cc \
  107. google/protobuf/io/gzip_stream.cc \
  108. google/protobuf/io/printer.cc \
  109. google/protobuf/io/tokenizer.cc \
  110. google/protobuf/io/zero_copy_stream_impl.cc \
  111. google/protobuf/compiler/importer.cc \
  112. google/protobuf/compiler/parser.cc
  113. libprotoc_la_LIBADD = $(PTHREAD_LIBS) libprotobuf.la
  114. libprotoc_la_LDFLAGS = -version-info 7:0:0 -export-dynamic -no-undefined
  115. libprotoc_la_SOURCES = \
  116. google/protobuf/compiler/code_generator.cc \
  117. google/protobuf/compiler/command_line_interface.cc \
  118. google/protobuf/compiler/plugin.cc \
  119. google/protobuf/compiler/plugin.pb.cc \
  120. google/protobuf/compiler/subprocess.cc \
  121. google/protobuf/compiler/subprocess.h \
  122. google/protobuf/compiler/zip_writer.cc \
  123. google/protobuf/compiler/zip_writer.h \
  124. google/protobuf/compiler/cpp/cpp_enum.cc \
  125. google/protobuf/compiler/cpp/cpp_enum.h \
  126. google/protobuf/compiler/cpp/cpp_enum_field.cc \
  127. google/protobuf/compiler/cpp/cpp_enum_field.h \
  128. google/protobuf/compiler/cpp/cpp_extension.cc \
  129. google/protobuf/compiler/cpp/cpp_extension.h \
  130. google/protobuf/compiler/cpp/cpp_field.cc \
  131. google/protobuf/compiler/cpp/cpp_field.h \
  132. google/protobuf/compiler/cpp/cpp_file.cc \
  133. google/protobuf/compiler/cpp/cpp_file.h \
  134. google/protobuf/compiler/cpp/cpp_generator.cc \
  135. google/protobuf/compiler/cpp/cpp_helpers.cc \
  136. google/protobuf/compiler/cpp/cpp_helpers.h \
  137. google/protobuf/compiler/cpp/cpp_message.cc \
  138. google/protobuf/compiler/cpp/cpp_message.h \
  139. google/protobuf/compiler/cpp/cpp_message_field.cc \
  140. google/protobuf/compiler/cpp/cpp_message_field.h \
  141. google/protobuf/compiler/cpp/cpp_primitive_field.cc \
  142. google/protobuf/compiler/cpp/cpp_primitive_field.h \
  143. google/protobuf/compiler/cpp/cpp_service.cc \
  144. google/protobuf/compiler/cpp/cpp_service.h \
  145. google/protobuf/compiler/cpp/cpp_string_field.cc \
  146. google/protobuf/compiler/cpp/cpp_string_field.h \
  147. google/protobuf/compiler/java/java_enum.cc \
  148. google/protobuf/compiler/java/java_enum.h \
  149. google/protobuf/compiler/java/java_enum_field.cc \
  150. google/protobuf/compiler/java/java_enum_field.h \
  151. google/protobuf/compiler/java/java_extension.cc \
  152. google/protobuf/compiler/java/java_extension.h \
  153. google/protobuf/compiler/java/java_field.cc \
  154. google/protobuf/compiler/java/java_field.h \
  155. google/protobuf/compiler/java/java_file.cc \
  156. google/protobuf/compiler/java/java_file.h \
  157. google/protobuf/compiler/java/java_generator.cc \
  158. google/protobuf/compiler/java/java_helpers.cc \
  159. google/protobuf/compiler/java/java_helpers.h \
  160. google/protobuf/compiler/java/java_message.cc \
  161. google/protobuf/compiler/java/java_message.h \
  162. google/protobuf/compiler/java/java_message_field.cc \
  163. google/protobuf/compiler/java/java_message_field.h \
  164. google/protobuf/compiler/java/java_primitive_field.cc \
  165. google/protobuf/compiler/java/java_primitive_field.h \
  166. google/protobuf/compiler/java/java_service.cc \
  167. google/protobuf/compiler/java/java_service.h \
  168. google/protobuf/compiler/java/java_string_field.cc \
  169. google/protobuf/compiler/java/java_string_field.h \
  170. google/protobuf/compiler/python/python_generator.cc \
  171. farsounder/protobuf/compiler/matlab/matlab_generator.cc
  172. bin_PROGRAMS = protoc
  173. protoc_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la
  174. protoc_SOURCES = google/protobuf/compiler/main.cc
  175. # Tests ==============================================================
  176. protoc_inputs = \
  177. google/protobuf/unittest.proto \
  178. google/protobuf/unittest_empty.proto \
  179. google/protobuf/unittest_import.proto \
  180. google/protobuf/unittest_mset.proto \
  181. google/protobuf/unittest_optimize_for.proto \
  182. google/protobuf/unittest_embed_optimize_for.proto \
  183. google/protobuf/unittest_custom_options.proto \
  184. google/protobuf/unittest_lite.proto \
  185. google/protobuf/unittest_import_lite.proto \
  186. google/protobuf/unittest_lite_imports_nonlite.proto \
  187. google/protobuf/unittest_no_generic_services.proto \
  188. google/protobuf/compiler/cpp/cpp_test_bad_identifiers.proto
  189. EXTRA_DIST = \
  190. $(protoc_inputs) \
  191. solaris/libstdc++.la \
  192. google/protobuf/io/gzip_stream.h \
  193. google/protobuf/io/gzip_stream_unittest.sh \
  194. google/protobuf/testdata/golden_message \
  195. google/protobuf/testdata/golden_packed_fields_message \
  196. google/protobuf/testdata/text_format_unittest_data.txt \
  197. google/protobuf/testdata/text_format_unittest_extensions_data.txt \
  198. google/protobuf/package_info.h \
  199. google/protobuf/io/package_info.h \
  200. google/protobuf/compiler/package_info.h \
  201. google/protobuf/compiler/zip_output_unittest.sh \
  202. google/protobuf/unittest_enormous_descriptor.proto
  203. protoc_lite_outputs = \
  204. google/protobuf/unittest_lite.pb.cc \
  205. google/protobuf/unittest_lite.pb.h \
  206. google/protobuf/unittest_import_lite.pb.cc \
  207. google/protobuf/unittest_import_lite.pb.h
  208. protoc_outputs = \
  209. $(protoc_lite_outputs) \
  210. google/protobuf/unittest.pb.cc \
  211. google/protobuf/unittest.pb.h \
  212. google/protobuf/unittest_empty.pb.cc \
  213. google/protobuf/unittest_empty.pb.h \
  214. google/protobuf/unittest_import.pb.cc \
  215. google/protobuf/unittest_import.pb.h \
  216. google/protobuf/unittest_mset.pb.cc \
  217. google/protobuf/unittest_mset.pb.h \
  218. google/protobuf/unittest_optimize_for.pb.cc \
  219. google/protobuf/unittest_optimize_for.pb.h \
  220. google/protobuf/unittest_embed_optimize_for.pb.cc \
  221. google/protobuf/unittest_embed_optimize_for.pb.h \
  222. google/protobuf/unittest_custom_options.pb.cc \
  223. google/protobuf/unittest_custom_options.pb.h \
  224. google/protobuf/unittest_lite_imports_nonlite.pb.cc \
  225. google/protobuf/unittest_lite_imports_nonlite.pb.h \
  226. google/protobuf/unittest_no_generic_services.pb.cc \
  227. google/protobuf/unittest_no_generic_services.pb.h \
  228. google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc \
  229. google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.h
  230. BUILT_SOURCES = $(protoc_outputs)
  231. if USE_EXTERNAL_PROTOC
  232. unittest_proto_middleman: $(protoc_inputs)
  233. $(PROTOC) -I$(srcdir) --cpp_out=. $^
  234. touch unittest_proto_middleman
  235. else
  236. # We have to cd to $(srcdir) before executing protoc because $(protoc_inputs) is
  237. # relative to srcdir, which may not be the same as the current directory when
  238. # building out-of-tree.
  239. unittest_proto_middleman: protoc$(EXEEXT) $(protoc_inputs)
  240. oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/protoc$(EXEEXT) -I. --cpp_out=$$oldpwd $(protoc_inputs) )
  241. touch unittest_proto_middleman
  242. endif
  243. $(protoc_outputs): unittest_proto_middleman
  244. COMMON_TEST_SOURCES = \
  245. google/protobuf/test_util.cc \
  246. google/protobuf/test_util.h \
  247. google/protobuf/testing/googletest.cc \
  248. google/protobuf/testing/googletest.h \
  249. google/protobuf/testing/file.cc \
  250. google/protobuf/testing/file.h
  251. check_PROGRAMS = protoc protobuf-test protobuf-lazy-descriptor-test \
  252. protobuf-lite-test test_plugin $(GZCHECKPROGRAMS)
  253. protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
  254. $(top_builddir)/gtest/lib/libgtest.la \
  255. $(top_builddir)/gtest/lib/libgtest_main.la
  256. protobuf_test_CPPFLAGS = -I$(top_srcdir)/gtest/include \
  257. -I$(top_builddir)/gtest/include
  258. # Disable optimization for tests unless the user explicitly asked for it,
  259. # since test_util.cc takes forever to compile with optimization (with GCC).
  260. # See configure.ac for more info.
  261. protobuf_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
  262. protobuf_test_SOURCES = \
  263. google/protobuf/stubs/common_unittest.cc \
  264. google/protobuf/stubs/once_unittest.cc \
  265. google/protobuf/stubs/strutil_unittest.cc \
  266. google/protobuf/stubs/structurally_valid_unittest.cc \
  267. google/protobuf/descriptor_database_unittest.cc \
  268. google/protobuf/descriptor_unittest.cc \
  269. google/protobuf/dynamic_message_unittest.cc \
  270. google/protobuf/extension_set_unittest.cc \
  271. google/protobuf/generated_message_reflection_unittest.cc \
  272. google/protobuf/message_unittest.cc \
  273. google/protobuf/reflection_ops_unittest.cc \
  274. google/protobuf/repeated_field_unittest.cc \
  275. google/protobuf/text_format_unittest.cc \
  276. google/protobuf/unknown_field_set_unittest.cc \
  277. google/protobuf/wire_format_unittest.cc \
  278. google/protobuf/io/coded_stream_unittest.cc \
  279. google/protobuf/io/printer_unittest.cc \
  280. google/protobuf/io/tokenizer_unittest.cc \
  281. google/protobuf/io/zero_copy_stream_unittest.cc \
  282. google/protobuf/compiler/command_line_interface_unittest.cc \
  283. google/protobuf/compiler/importer_unittest.cc \
  284. google/protobuf/compiler/mock_code_generator.cc \
  285. google/protobuf/compiler/mock_code_generator.h \
  286. google/protobuf/compiler/parser_unittest.cc \
  287. google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc \
  288. google/protobuf/compiler/cpp/cpp_unittest.cc \
  289. google/protobuf/compiler/cpp/cpp_plugin_unittest.cc \
  290. google/protobuf/compiler/java/java_plugin_unittest.cc \
  291. google/protobuf/compiler/python/python_plugin_unittest.cc \
  292. $(COMMON_TEST_SOURCES)
  293. nodist_protobuf_test_SOURCES = $(protoc_outputs)
  294. # Run cpp_unittest again with PROTOBUF_TEST_NO_DESCRIPTORS defined.
  295. protobuf_lazy_descriptor_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la \
  296. $(top_builddir)/gtest/lib/libgtest.la \
  297. $(top_builddir)/gtest/lib/libgtest_main.la
  298. protobuf_lazy_descriptor_test_CPPFLAGS = -I$(top_srcdir)/gtest/include \
  299. -I$(top_builddir)/gtest/include \
  300. -DPROTOBUF_TEST_NO_DESCRIPTORS
  301. protobuf_lazy_descriptor_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
  302. protobuf_lazy_descriptor_test_SOURCES = \
  303. google/protobuf/compiler/cpp/cpp_unittest.cc \
  304. $(COMMON_TEST_SOURCES)
  305. nodist_protobuf_lazy_descriptor_test_SOURCES = $(protoc_outputs)
  306. # Build lite_unittest separately, since it doesn't use gtest.
  307. protobuf_lite_test_LDADD = $(PTHREAD_LIBS) libprotobuf-lite.la
  308. protobuf_lite_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
  309. protobuf_lite_test_SOURCES = \
  310. google/protobuf/lite_unittest.cc \
  311. google/protobuf/test_util_lite.cc \
  312. google/protobuf/test_util_lite.h
  313. nodist_protobuf_lite_test_SOURCES = $(protoc_lite_outputs)
  314. # Test plugin binary.
  315. test_plugin_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
  316. $(top_builddir)/gtest/lib/libgtest.la
  317. test_plugin_CPPFLAGS = -I$(top_srcdir)/gtest/include \
  318. -I$(top_builddir)/gtest/include
  319. test_plugin_SOURCES = \
  320. google/protobuf/compiler/mock_code_generator.cc \
  321. google/protobuf/testing/file.cc \
  322. google/protobuf/testing/file.h \
  323. google/protobuf/compiler/test_plugin.cc
  324. if HAVE_ZLIB
  325. zcgzip_LDADD = $(PTHREAD_LIBS) libprotobuf.la
  326. zcgzip_SOURCES = google/protobuf/testing/zcgzip.cc
  327. zcgunzip_LDADD = $(PTHREAD_LIBS) libprotobuf.la
  328. zcgunzip_SOURCES = google/protobuf/testing/zcgunzip.cc
  329. endif
  330. TESTS = protobuf-test protobuf-lazy-descriptor-test protobuf-lite-test \
  331. google/protobuf/compiler/zip_output_unittest.sh $(GZTESTS)