PageRenderTime 47ms CodeModel.GetById 17ms RepoModel.GetById 1ms app.codeStats 0ms

/src/protobuf/src/Makefile.am

http://decs.googlecode.com/
Makefile | 301 lines | 251 code | 30 blank | 20 comment | 4 complexity | 60fccdd618bed6e3d048066f8f010605 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-2.1, LGPL-2.0
  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. # Not sure why these don't get cleaned automatically.
  24. clean-local:
  25. rm -f *.loT
  26. CLEANFILES = $(protoc_outputs) unittest_proto_middleman
  27. MAINTAINERCLEANFILES = \
  28. Makefile.in
  29. nobase_include_HEADERS = \
  30. google/protobuf/stubs/common.h \
  31. google/protobuf/stubs/once.h \
  32. google/protobuf/descriptor.h \
  33. google/protobuf/descriptor.pb.h \
  34. google/protobuf/descriptor_database.h \
  35. google/protobuf/dynamic_message.h \
  36. google/protobuf/extension_set.h \
  37. google/protobuf/generated_message_reflection.h \
  38. google/protobuf/message.h \
  39. google/protobuf/reflection_ops.h \
  40. google/protobuf/repeated_field.h \
  41. google/protobuf/service.h \
  42. google/protobuf/text_format.h \
  43. google/protobuf/unknown_field_set.h \
  44. google/protobuf/wire_format.h \
  45. google/protobuf/wire_format_inl.h \
  46. google/protobuf/io/coded_stream.h \
  47. $(GZHEADERS) \
  48. google/protobuf/io/printer.h \
  49. google/protobuf/io/tokenizer.h \
  50. google/protobuf/io/zero_copy_stream.h \
  51. google/protobuf/io/zero_copy_stream_impl.h \
  52. google/protobuf/compiler/code_generator.h \
  53. google/protobuf/compiler/command_line_interface.h \
  54. google/protobuf/compiler/importer.h \
  55. google/protobuf/compiler/parser.h \
  56. google/protobuf/compiler/cpp/cpp_generator.h \
  57. google/protobuf/compiler/java/java_generator.h \
  58. google/protobuf/compiler/python/python_generator.h
  59. lib_LTLIBRARIES = libprotobuf.la libprotoc.la
  60. libprotobuf_la_LIBADD = $(PTHREAD_LIBS)
  61. libprotobuf_la_LDFLAGS = -version-info 4:0:0
  62. libprotobuf_la_SOURCES = \
  63. google/protobuf/stubs/common.cc \
  64. google/protobuf/stubs/once.cc \
  65. google/protobuf/stubs/hash.cc \
  66. google/protobuf/stubs/hash.h \
  67. google/protobuf/stubs/map-util.cc \
  68. google/protobuf/stubs/map-util.h \
  69. google/protobuf/stubs/stl_util-inl.cc \
  70. google/protobuf/stubs/stl_util-inl.h \
  71. google/protobuf/stubs/substitute.cc \
  72. google/protobuf/stubs/substitute.h \
  73. google/protobuf/stubs/strutil.cc \
  74. google/protobuf/stubs/strutil.h \
  75. google/protobuf/stubs/structurally_valid.cc \
  76. google/protobuf/descriptor.cc \
  77. google/protobuf/descriptor.pb.cc \
  78. google/protobuf/descriptor_database.cc \
  79. google/protobuf/dynamic_message.cc \
  80. google/protobuf/extension_set.cc \
  81. google/protobuf/generated_message_reflection.cc \
  82. google/protobuf/message.cc \
  83. google/protobuf/reflection_ops.cc \
  84. google/protobuf/repeated_field.cc \
  85. google/protobuf/service.cc \
  86. google/protobuf/text_format.cc \
  87. google/protobuf/unknown_field_set.cc \
  88. google/protobuf/wire_format.cc \
  89. google/protobuf/io/coded_stream.cc \
  90. google/protobuf/io/gzip_stream.cc \
  91. google/protobuf/io/printer.cc \
  92. google/protobuf/io/tokenizer.cc \
  93. google/protobuf/io/zero_copy_stream.cc \
  94. google/protobuf/io/zero_copy_stream_impl.cc \
  95. google/protobuf/compiler/importer.cc \
  96. google/protobuf/compiler/parser.cc
  97. libprotoc_la_LIBADD = $(PTHREAD_LIBS) libprotobuf.la
  98. libprotoc_la_LDFLAGS = -version-info 4:0:0
  99. libprotoc_la_SOURCES = \
  100. google/protobuf/compiler/code_generator.cc \
  101. google/protobuf/compiler/command_line_interface.cc \
  102. google/protobuf/compiler/cpp/cpp_enum.cc \
  103. google/protobuf/compiler/cpp/cpp_enum.h \
  104. google/protobuf/compiler/cpp/cpp_enum_field.cc \
  105. google/protobuf/compiler/cpp/cpp_enum_field.h \
  106. google/protobuf/compiler/cpp/cpp_extension.cc \
  107. google/protobuf/compiler/cpp/cpp_extension.h \
  108. google/protobuf/compiler/cpp/cpp_field.cc \
  109. google/protobuf/compiler/cpp/cpp_field.h \
  110. google/protobuf/compiler/cpp/cpp_file.cc \
  111. google/protobuf/compiler/cpp/cpp_file.h \
  112. google/protobuf/compiler/cpp/cpp_generator.cc \
  113. google/protobuf/compiler/cpp/cpp_helpers.cc \
  114. google/protobuf/compiler/cpp/cpp_helpers.h \
  115. google/protobuf/compiler/cpp/cpp_message.cc \
  116. google/protobuf/compiler/cpp/cpp_message.h \
  117. google/protobuf/compiler/cpp/cpp_message_field.cc \
  118. google/protobuf/compiler/cpp/cpp_message_field.h \
  119. google/protobuf/compiler/cpp/cpp_primitive_field.cc \
  120. google/protobuf/compiler/cpp/cpp_primitive_field.h \
  121. google/protobuf/compiler/cpp/cpp_service.cc \
  122. google/protobuf/compiler/cpp/cpp_service.h \
  123. google/protobuf/compiler/cpp/cpp_string_field.cc \
  124. google/protobuf/compiler/cpp/cpp_string_field.h \
  125. google/protobuf/compiler/java/java_enum.cc \
  126. google/protobuf/compiler/java/java_enum.h \
  127. google/protobuf/compiler/java/java_enum_field.cc \
  128. google/protobuf/compiler/java/java_enum_field.h \
  129. google/protobuf/compiler/java/java_extension.cc \
  130. google/protobuf/compiler/java/java_extension.h \
  131. google/protobuf/compiler/java/java_field.cc \
  132. google/protobuf/compiler/java/java_field.h \
  133. google/protobuf/compiler/java/java_file.cc \
  134. google/protobuf/compiler/java/java_file.h \
  135. google/protobuf/compiler/java/java_generator.cc \
  136. google/protobuf/compiler/java/java_helpers.cc \
  137. google/protobuf/compiler/java/java_helpers.h \
  138. google/protobuf/compiler/java/java_message.cc \
  139. google/protobuf/compiler/java/java_message.h \
  140. google/protobuf/compiler/java/java_message_field.cc \
  141. google/protobuf/compiler/java/java_message_field.h \
  142. google/protobuf/compiler/java/java_primitive_field.cc \
  143. google/protobuf/compiler/java/java_primitive_field.h \
  144. google/protobuf/compiler/java/java_service.cc \
  145. google/protobuf/compiler/java/java_service.h \
  146. google/protobuf/compiler/python/python_generator.cc
  147. bin_PROGRAMS = protoc
  148. protoc_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la
  149. protoc_SOURCES = google/protobuf/compiler/main.cc
  150. # Tests ==============================================================
  151. protoc_inputs = \
  152. google/protobuf/unittest.proto \
  153. google/protobuf/unittest_empty.proto \
  154. google/protobuf/unittest_import.proto \
  155. google/protobuf/unittest_mset.proto \
  156. google/protobuf/unittest_optimize_for.proto \
  157. google/protobuf/unittest_embed_optimize_for.proto \
  158. google/protobuf/unittest_custom_options.proto \
  159. google/protobuf/compiler/cpp/cpp_test_bad_identifiers.proto
  160. EXTRA_DIST = \
  161. $(protoc_inputs) \
  162. solaris/libstdc++.la \
  163. google/protobuf/io/gzip_stream.h \
  164. google/protobuf/io/gzip_stream_unittest.sh \
  165. google/protobuf/testdata/golden_message \
  166. google/protobuf/testdata/golden_packed_fields_message \
  167. google/protobuf/testdata/text_format_unittest_data.txt \
  168. google/protobuf/testdata/text_format_unittest_extensions_data.txt \
  169. google/protobuf/package_info.h \
  170. google/protobuf/io/package_info.h \
  171. google/protobuf/compiler/package_info.h
  172. protoc_outputs = \
  173. google/protobuf/unittest.pb.cc \
  174. google/protobuf/unittest.pb.h \
  175. google/protobuf/unittest_empty.pb.cc \
  176. google/protobuf/unittest_empty.pb.h \
  177. google/protobuf/unittest_import.pb.cc \
  178. google/protobuf/unittest_import.pb.h \
  179. google/protobuf/unittest_mset.pb.cc \
  180. google/protobuf/unittest_mset.pb.h \
  181. google/protobuf/unittest_optimize_for.pb.cc \
  182. google/protobuf/unittest_optimize_for.pb.h \
  183. google/protobuf/unittest_embed_optimize_for.pb.cc \
  184. google/protobuf/unittest_embed_optimize_for.pb.h \
  185. google/protobuf/unittest_custom_options.pb.cc \
  186. google/protobuf/unittest_custom_options.pb.h \
  187. google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.cc \
  188. google/protobuf/compiler/cpp/cpp_test_bad_identifiers.pb.h
  189. BUILT_SOURCES = $(protoc_outputs)
  190. if USE_EXTERNAL_PROTOC
  191. unittest_proto_middleman: $(protoc_inputs)
  192. $(PROTOC) -I$(srcdir) --cpp_out=. $(protoc_inputs)
  193. touch unittest_proto_middleman
  194. else
  195. # This rule is a little weird. The first prereq is the protoc executable
  196. # and the rest are its inputs. Therefore, $^ -- which expands to the
  197. # list of prereqs -- is actually a valid command. We have to place "./" in
  198. # front of it in case protoc is in the current directory. protoc allows
  199. # flags to appear after input file names, so we happily stick the flags on
  200. # the end.
  201. #
  202. # For reference, if we didn't have to worry about VPATH (i.e., building from
  203. # a directory other than the package root), we could have just written this:
  204. # ./protoc$(EXEEXT) -I$(srcdir) --cpp_out=. $(protoc_inputs)
  205. unittest_proto_middleman: protoc$(EXEEXT) $(protoc_inputs)
  206. ./$^ -I$(srcdir) --cpp_out=.
  207. touch unittest_proto_middleman
  208. endif
  209. $(protoc_outputs): unittest_proto_middleman
  210. COMMON_TEST_SOURCES = \
  211. google/protobuf/test_util.cc \
  212. google/protobuf/test_util.h \
  213. google/protobuf/testing/googletest.cc \
  214. google/protobuf/testing/googletest.h \
  215. google/protobuf/testing/file.cc \
  216. google/protobuf/testing/file.h
  217. check_PROGRAMS = protobuf-test protobuf-lazy-descriptor-test $(GZCHECKPROGRAMS)
  218. protobuf_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la libprotoc.la \
  219. $(top_builddir)/gtest/lib/libgtest.la \
  220. $(top_builddir)/gtest/lib/libgtest_main.la
  221. protobuf_test_CPPFLAGS = -I$(top_srcdir)/gtest/include \
  222. -I$(top_builddir)/gtest/include
  223. # Disable optimization for tests unless the user explicitly asked for it,
  224. # since test_util.cc takes forever to compile with optimization (with GCC).
  225. # See configure.ac for more info.
  226. protobuf_test_CXXFLAGS = $(NO_OPT_CXXFLAGS)
  227. protobuf_test_SOURCES = \
  228. google/protobuf/stubs/common_unittest.cc \
  229. google/protobuf/stubs/once_unittest.cc \
  230. google/protobuf/stubs/strutil_unittest.cc \
  231. google/protobuf/stubs/structurally_valid_unittest.cc \
  232. google/protobuf/descriptor_database_unittest.cc \
  233. google/protobuf/descriptor_unittest.cc \
  234. google/protobuf/dynamic_message_unittest.cc \
  235. google/protobuf/extension_set_unittest.cc \
  236. google/protobuf/generated_message_reflection_unittest.cc \
  237. google/protobuf/message_unittest.cc \
  238. google/protobuf/reflection_ops_unittest.cc \
  239. google/protobuf/repeated_field_unittest.cc \
  240. google/protobuf/text_format_unittest.cc \
  241. google/protobuf/unknown_field_set_unittest.cc \
  242. google/protobuf/wire_format_unittest.cc \
  243. google/protobuf/io/coded_stream_unittest.cc \
  244. google/protobuf/io/printer_unittest.cc \
  245. google/protobuf/io/tokenizer_unittest.cc \
  246. google/protobuf/io/zero_copy_stream_unittest.cc \
  247. google/protobuf/compiler/command_line_interface_unittest.cc \
  248. google/protobuf/compiler/importer_unittest.cc \
  249. google/protobuf/compiler/parser_unittest.cc \
  250. google/protobuf/compiler/cpp/cpp_bootstrap_unittest.cc \
  251. google/protobuf/compiler/cpp/cpp_unittest.cc \
  252. $(COMMON_TEST_SOURCES)
  253. nodist_protobuf_test_SOURCES = $(protoc_outputs)
  254. # Run cpp_unittest again with PROTOBUF_TEST_NO_DESCRIPTORS defined.
  255. protobuf_lazy_descriptor_test_LDADD = $(PTHREAD_LIBS) libprotobuf.la \
  256. $(top_builddir)/gtest/lib/libgtest.la \
  257. $(top_builddir)/gtest/lib/libgtest_main.la
  258. protobuf_lazy_descriptor_test_CPPFLAGS = -I$(top_srcdir)/gtest/include \
  259. -I$(top_builddir)/gtest/include \
  260. -DPROTOBUF_TEST_NO_DESCRIPTORS
  261. protobuf_lazy_descriptor_test_SOURCES = \
  262. google/protobuf/compiler/cpp/cpp_unittest.cc \
  263. $(COMMON_TEST_SOURCES)
  264. nodist_protobuf_lazy_descriptor_test_SOURCES = $(protoc_outputs)
  265. if HAVE_ZLIB
  266. zcgzip_LDADD = $(PTHREAD_LIBS) libprotobuf.la
  267. zcgzip_SOURCES = google/protobuf/testing/zcgzip.cc
  268. zcgunzip_LDADD = $(PTHREAD_LIBS) libprotobuf.la
  269. zcgunzip_SOURCES = google/protobuf/testing/zcgunzip.cc
  270. endif
  271. TESTS = protobuf-test protobuf-lazy-descriptor-test $(GZTESTS)