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

/src/Makefile.am

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