Makefile.am 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371
  1. ## Process this file with automake to produce Makefile.in
  2. conformance_protoc_inputs = \
  3. conformance.proto \
  4. $(top_srcdir)/src/google/protobuf/test_messages_proto3.proto
  5. # proto2 input files, should be separated with proto3, as we
  6. # can't generate proto2 files for ruby, php and objc
  7. conformance_proto2_protoc_inputs = \
  8. $(top_srcdir)/src/google/protobuf/test_messages_proto2.proto
  9. well_known_type_protoc_inputs = \
  10. $(top_srcdir)/src/google/protobuf/any.proto \
  11. $(top_srcdir)/src/google/protobuf/duration.proto \
  12. $(top_srcdir)/src/google/protobuf/field_mask.proto \
  13. $(top_srcdir)/src/google/protobuf/struct.proto \
  14. $(top_srcdir)/src/google/protobuf/timestamp.proto \
  15. $(top_srcdir)/src/google/protobuf/wrappers.proto
  16. protoc_outputs = \
  17. conformance.pb.cc \
  18. conformance.pb.h
  19. other_language_protoc_outputs = \
  20. conformance_pb2.py \
  21. Conformance.pbobjc.h \
  22. Conformance.pbobjc.m \
  23. conformance_pb.js \
  24. conformance_pb.rb \
  25. com/google/protobuf/Any.java \
  26. com/google/protobuf/AnyOrBuilder.java \
  27. com/google/protobuf/AnyProto.java \
  28. com/google/protobuf/BoolValue.java \
  29. com/google/protobuf/BoolValueOrBuilder.java \
  30. com/google/protobuf/BytesValue.java \
  31. com/google/protobuf/BytesValueOrBuilder.java \
  32. com/google/protobuf/conformance/Conformance.java \
  33. com/google/protobuf/DoubleValue.java \
  34. com/google/protobuf/DoubleValueOrBuilder.java \
  35. com/google/protobuf/Duration.java \
  36. com/google/protobuf/DurationOrBuilder.java \
  37. com/google/protobuf/DurationProto.java \
  38. com/google/protobuf/FieldMask.java \
  39. com/google/protobuf/FieldMaskOrBuilder.java \
  40. com/google/protobuf/FieldMaskProto.java \
  41. com/google/protobuf/FloatValue.java \
  42. com/google/protobuf/FloatValueOrBuilder.java \
  43. com/google/protobuf/Int32Value.java \
  44. com/google/protobuf/Int32ValueOrBuilder.java \
  45. com/google/protobuf/Int64Value.java \
  46. com/google/protobuf/Int64ValueOrBuilder.java \
  47. com/google/protobuf/ListValue.java \
  48. com/google/protobuf/ListValueOrBuilder.java \
  49. com/google/protobuf/NullValue.java \
  50. com/google/protobuf/StringValue.java \
  51. com/google/protobuf/StringValueOrBuilder.java \
  52. com/google/protobuf/Struct.java \
  53. com/google/protobuf/StructOrBuilder.java \
  54. com/google/protobuf/StructProto.java \
  55. com/google/protobuf/Timestamp.java \
  56. com/google/protobuf/TimestampOrBuilder.java \
  57. com/google/protobuf/TimestampProto.java \
  58. com/google/protobuf/UInt32Value.java \
  59. com/google/protobuf/UInt32ValueOrBuilder.java \
  60. com/google/protobuf/UInt64Value.java \
  61. com/google/protobuf/UInt64ValueOrBuilder.java \
  62. com/google/protobuf/Value.java \
  63. com/google/protobuf/ValueOrBuilder.java \
  64. com/google/protobuf/WrappersProto.java \
  65. com/google/protobuf_test_messages/proto3/TestMessagesProto3.java \
  66. com/google/protobuf_test_messages/proto2/TestMessagesProto2.java \
  67. google/protobuf/any.pb.cc \
  68. google/protobuf/any.pb.h \
  69. google/protobuf/any.rb \
  70. google/protobuf/any_pb2.py \
  71. google/protobuf/duration.pb.cc \
  72. google/protobuf/duration.pb.h \
  73. google/protobuf/duration.rb \
  74. google/protobuf/duration_pb2.py \
  75. google/protobuf/field_mask.pb.cc \
  76. google/protobuf/field_mask.pb.h \
  77. google/protobuf/field_mask.rb \
  78. google/protobuf/field_mask_pb2.py \
  79. google/protobuf/struct.pb.cc \
  80. google/protobuf/struct.pb.h \
  81. google/protobuf/struct.rb \
  82. google/protobuf/struct_pb2.py \
  83. google/protobuf/TestMessagesProto2.pbobjc.h \
  84. google/protobuf/TestMessagesProto2.pbobjc.m \
  85. google/protobuf/TestMessagesProto3.pbobjc.h \
  86. google/protobuf/TestMessagesProto3.pbobjc.m \
  87. google/protobuf/test_messages_proto3.pb.cc \
  88. google/protobuf/test_messages_proto3.pb.h \
  89. google/protobuf/test_messages_proto2.pb.cc \
  90. google/protobuf/test_messages_proto2.pb.h \
  91. google/protobuf/test_messages_proto3_pb.rb \
  92. google/protobuf/test_messages_proto3_pb2.py \
  93. google/protobuf/test_messages_proto2_pb2.py \
  94. google/protobuf/timestamp.pb.cc \
  95. google/protobuf/timestamp.pb.h \
  96. google/protobuf/timestamp.rb \
  97. google/protobuf/timestamp_pb2.py \
  98. google/protobuf/wrappers.pb.cc \
  99. google/protobuf/wrappers.pb.h \
  100. google/protobuf/wrappers.rb \
  101. google/protobuf/wrappers_pb2.py \
  102. Conformance/ConformanceRequest.php \
  103. Conformance/ConformanceResponse.php \
  104. Conformance/WireFormat.php \
  105. GPBMetadata/Conformance.php \
  106. GPBMetadata/Google/Protobuf/Any.php \
  107. GPBMetadata/Google/Protobuf/Duration.php \
  108. GPBMetadata/Google/Protobuf/FieldMask.php \
  109. GPBMetadata/Google/Protobuf/Struct.php \
  110. GPBMetadata/Google/Protobuf/TestMessagesProto3.php \
  111. GPBMetadata/Google/Protobuf/Timestamp.php \
  112. GPBMetadata/Google/Protobuf/Wrappers.php \
  113. Google/Protobuf/Any.php \
  114. Google/Protobuf/BoolValue.php \
  115. Google/Protobuf/BytesValue.php \
  116. Google/Protobuf/DoubleValue.php \
  117. Google/Protobuf/Duration.php \
  118. Google/Protobuf/FieldMask.php \
  119. Google/Protobuf/FloatValue.php \
  120. Google/Protobuf/Int32Value.php \
  121. Google/Protobuf/Int64Value.php \
  122. Google/Protobuf/ListValue.php \
  123. Google/Protobuf/NullValue.php \
  124. Google/Protobuf/StringValue.php \
  125. Google/Protobuf/Struct.php \
  126. Google/Protobuf/Timestamp.php \
  127. Google/Protobuf/UInt32Value.php \
  128. Google/Protobuf/UInt64Value.php \
  129. Google/Protobuf/Value.php \
  130. Protobuf_test_messages/Proto3/ForeignEnum.php \
  131. Protobuf_test_messages/Proto3/ForeignMessage.php \
  132. Protobuf_test_messages/Proto3/TestAllTypes_NestedEnum.php \
  133. Protobuf_test_messages/Proto3/TestAllTypes_NestedMessage.php \
  134. Protobuf_test_messages/Proto3/TestAllTypes.php
  135. # lite/com/google/protobuf/Any.java \
  136. # lite/com/google/protobuf/AnyOrBuilder.java \
  137. # lite/com/google/protobuf/AnyProto.java \
  138. # lite/com/google/protobuf/BoolValue.java \
  139. # lite/com/google/protobuf/BoolValueOrBuilder.java \
  140. # lite/com/google/protobuf/BytesValue.java \
  141. # lite/com/google/protobuf/BytesValueOrBuilder.java \
  142. # lite/com/google/protobuf/conformance/Conformance.java \
  143. # lite/com/google/protobuf/DoubleValue.java \
  144. # lite/com/google/protobuf/DoubleValueOrBuilder.java \
  145. # lite/com/google/protobuf/Duration.java \
  146. # lite/com/google/protobuf/DurationOrBuilder.java \
  147. # lite/com/google/protobuf/DurationProto.java \
  148. # lite/com/google/protobuf/FieldMask.java \
  149. # lite/com/google/protobuf/FieldMaskOrBuilder.java \
  150. # lite/com/google/protobuf/FieldMaskProto.java \
  151. # lite/com/google/protobuf/FloatValue.java \
  152. # lite/com/google/protobuf/FloatValueOrBuilder.java \
  153. # lite/com/google/protobuf/Int32Value.java \
  154. # lite/com/google/protobuf/Int32ValueOrBuilder.java \
  155. # lite/com/google/protobuf/Int64Value.java \
  156. # lite/com/google/protobuf/Int64ValueOrBuilder.java \
  157. # lite/com/google/protobuf/ListValue.java \
  158. # lite/com/google/protobuf/ListValueOrBuilder.java \
  159. # lite/com/google/protobuf/NullValue.java \
  160. # lite/com/google/protobuf/StringValue.java \
  161. # lite/com/google/protobuf/StringValueOrBuilder.java \
  162. # lite/com/google/protobuf/Struct.java \
  163. # lite/com/google/protobuf/StructOrBuilder.java \
  164. # lite/com/google/protobuf/StructProto.java \
  165. # lite/com/google/protobuf/Timestamp.java \
  166. # lite/com/google/protobuf/TimestampOrBuilder.java \
  167. # lite/com/google/protobuf/TimestampProto.java \
  168. # lite/com/google/protobuf/UInt32Value.java \
  169. # lite/com/google/protobuf/UInt32ValueOrBuilder.java \
  170. # lite/com/google/protobuf/UInt64Value.java \
  171. # lite/com/google/protobuf/UInt64ValueOrBuilder.java \
  172. # lite/com/google/protobuf/Value.java \
  173. # lite/com/google/protobuf/ValueOrBuilder.java \
  174. # lite/com/google/protobuf/WrappersProto.java
  175. bin_PROGRAMS = conformance-test-runner conformance-cpp
  176. # All source files excepet C++/Objective-C ones should be explicitly listed
  177. # here because the autoconf tools don't include files of other languages
  178. # automatically.
  179. EXTRA_DIST = \
  180. ConformanceJava.java \
  181. ConformanceJavaLite.java \
  182. README.md \
  183. conformance.proto \
  184. conformance_python.py \
  185. conformance_ruby.rb \
  186. conformance_php.php \
  187. failure_list_cpp.txt \
  188. failure_list_csharp.txt \
  189. failure_list_java.txt \
  190. failure_list_js.txt \
  191. failure_list_objc.txt \
  192. failure_list_python.txt \
  193. failure_list_python_cpp.txt \
  194. failure_list_python-post26.txt \
  195. failure_list_ruby.txt \
  196. failure_list_php.txt \
  197. failure_list_php_c.txt
  198. conformance_test_runner_LDADD = $(top_srcdir)/src/libprotobuf.la
  199. conformance_test_runner_SOURCES = conformance_test.h conformance_test.cc \
  200. conformance_test_runner.cc \
  201. third_party/jsoncpp/json.h \
  202. third_party/jsoncpp/jsoncpp.cpp
  203. nodist_conformance_test_runner_SOURCES = conformance.pb.cc google/protobuf/test_messages_proto3.pb.cc google/protobuf/test_messages_proto2.pb.cc
  204. conformance_test_runner_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)
  205. conformance_test_runner_CXXFLAGS = -std=c++11
  206. # Explicit deps beacuse BUILT_SOURCES are only done before a "make all/check"
  207. # so a direct "make test_cpp" could fail if parallel enough.
  208. conformance_test_runner-conformance_test.$(OBJEXT): conformance.pb.h
  209. conformance_test_runner-conformance_test_runner.$(OBJEXT): conformance.pb.h
  210. conformance_cpp_LDADD = $(top_srcdir)/src/libprotobuf.la
  211. conformance_cpp_SOURCES = conformance_cpp.cc
  212. nodist_conformance_cpp_SOURCES = conformance.pb.cc google/protobuf/test_messages_proto3.pb.cc google/protobuf/test_messages_proto2.pb.cc
  213. conformance_cpp_CPPFLAGS = -I$(top_srcdir)/src
  214. # Explicit dep beacuse BUILT_SOURCES are only done before a "make all/check"
  215. # so a direct "make test_cpp" could fail if parallel enough.
  216. conformance_cpp-conformance_cpp.$(OBJEXT): conformance.pb.h
  217. if OBJC_CONFORMANCE_TEST
  218. bin_PROGRAMS += conformance-objc
  219. conformance_objc_SOURCES = conformance_objc.m ../objectivec/GPBProtocolBuffers.m
  220. nodist_conformance_objc_SOURCES = Conformance.pbobjc.m google/protobuf/TestMessagesProto2.pbobjc.m google/protobuf/TestMessagesProto3.pbobjc.m
  221. # On travis, the build fails without the isysroot because whatever system
  222. # headers are being found don't include generics support for
  223. # NSArray/NSDictionary, the only guess is their image at one time had an odd
  224. # setup for Xcode and old frameworks are being found.
  225. conformance_objc_CPPFLAGS = -I$(top_srcdir)/objectivec -isysroot `xcrun --sdk macosx --show-sdk-path`
  226. conformance_objc_LDFLAGS = -framework Foundation
  227. # Explicit dep beacuse BUILT_SOURCES are only done before a "make all/check"
  228. # so a direct "make test_objc" could fail if parallel enough.
  229. conformance_objc-conformance_objc.$(OBJEXT): Conformance.pbobjc.h google/protobuf/TestMessagesProto2.pbobjc.h google/protobuf/TestMessagesProto3.pbobjc.h
  230. endif
  231. # JavaScript well-known types are expected to be in a directory called
  232. # google-protobuf, because they are usually in the google-protobuf npm
  233. # package. But we want to use the sources from our tree, so we recreate
  234. # that directory structure here.
  235. google-protobuf:
  236. mkdir google-protobuf
  237. if USE_EXTERNAL_PROTOC
  238. # Some implementations include pre-generated versions of well-known types.
  239. protoc_middleman: $(conformance_protoc_inputs) $(conformance_proto2_protoc_inputs) $(well_known_type_protoc_inputs) google-protobuf
  240. $(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. --java_out=. --ruby_out=. --objc_out=. --python_out=. --php_out=. --js_out=import_style=commonjs,binary:. $(conformance_protoc_inputs)
  241. $(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. --java_out=. --objc_out=. --python_out=. --js_out=import_style=commonjs,binary:. $(conformance_proto2_protoc_inputs)
  242. $(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. --java_out=. --ruby_out=. --python_out=. --js_out=import_style=commonjs,binary:google-protobuf $(well_known_type_protoc_inputs)
  243. ## $(PROTOC) -I$(srcdir) -I$(top_srcdir) --java_out=lite:lite $(conformance_protoc_inputs) $(well_known_type_protoc_inputs)
  244. touch protoc_middleman
  245. else
  246. # We have to cd to $(srcdir) before executing protoc because $(protoc_inputs) is
  247. # relative to srcdir, which may not be the same as the current directory when
  248. # building out-of-tree.
  249. protoc_middleman: $(top_srcdir)/src/protoc$(EXEEXT) $(conformance_protoc_inputs) $(conformance_proto2_protoc_inputs) $(well_known_type_protoc_inputs) google-protobuf
  250. oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd --java_out=$$oldpwd --ruby_out=$$oldpwd --objc_out=$$oldpwd --python_out=$$oldpwd --php_out=$$oldpwd --js_out=import_style=commonjs,binary:$$oldpwd $(conformance_protoc_inputs) )
  251. oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd --java_out=$$oldpwd --objc_out=. --python_out=$$oldpwd --js_out=import_style=commonjs,binary:$$oldpwd $(conformance_proto2_protoc_inputs) )
  252. oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd --java_out=$$oldpwd --ruby_out=$$oldpwd --python_out=$$oldpwd --js_out=import_style=commonjs,binary:$$oldpwd/google-protobuf $(well_known_type_protoc_inputs) )
  253. ## @mkdir -p lite
  254. ## oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --java_out=lite:$$oldpwd/lite $(conformance_protoc_inputs) $(well_known_type_protoc_inputs) )
  255. touch protoc_middleman
  256. endif
  257. $(protoc_outputs): protoc_middleman
  258. $(other_language_protoc_outputs): protoc_middleman
  259. BUILT_SOURCES = $(protoc_outputs) $(other_language_protoc_outputs)
  260. CLEANFILES = $(protoc_outputs) protoc_middleman javac_middleman conformance-java javac_middleman_lite conformance-java-lite conformance-csharp conformance-php conformance-php-c $(other_language_protoc_outputs)
  261. MAINTAINERCLEANFILES = \
  262. Makefile.in
  263. javac_middleman: ConformanceJava.java protoc_middleman $(other_language_protoc_outputs)
  264. jar=`ls ../java/util/target/*jar-with-dependencies.jar` && javac -classpath ../java/target/classes:$$jar ConformanceJava.java com/google/protobuf/conformance/Conformance.java com/google/protobuf_test_messages/proto3/TestMessagesProto3.java com/google/protobuf_test_messages/proto2/TestMessagesProto2.java
  265. @touch javac_middleman
  266. conformance-java: javac_middleman
  267. @echo "Writing shortcut script conformance-java..."
  268. @echo '#! /bin/sh' > conformance-java
  269. @jar=`ls ../java/util/target/*jar-with-dependencies.jar` && echo java -classpath .:../java/target/classes:$$jar ConformanceJava '$$@' >> conformance-java
  270. @chmod +x conformance-java
  271. javac_middleman_lite: ConformanceJavaLite.java protoc_middleman $(other_language_protoc_outputs)
  272. javac -classpath ../java/lite/target/classes:lite ConformanceJavaLite.java lite/com/google/protobuf/conformance/Conformance.java
  273. @touch javac_middleman_lite
  274. conformance-java-lite: javac_middleman_lite
  275. @echo "Writing shortcut script conformance-java-lite..."
  276. @echo '#! /bin/sh' > conformance-java-lite
  277. @echo java -classpath .:../java/lite/target/classes:lite ConformanceJavaLite '$$@' >> conformance-java-lite
  278. @chmod +x conformance-java-lite
  279. # Currently the conformance code is alongside the rest of the C#
  280. # source, as it's easier to maintain there. We assume we've already
  281. # built that, so we just need a script to run it.
  282. conformance-csharp: $(other_language_protoc_outputs)
  283. @echo "Writing shortcut script conformance-csharp..."
  284. @echo '#! /bin/sh' > conformance-csharp
  285. @echo 'dotnet ../csharp/src/Google.Protobuf.Conformance/bin/Release/netcoreapp1.0/Google.Protobuf.Conformance.dll "$$@"' >> conformance-csharp
  286. @chmod +x conformance-csharp
  287. conformance-php:
  288. @echo "Writing shortcut script conformance-php..."
  289. @echo '#! /bin/sh' > conformance-php
  290. @echo 'php -d auto_prepend_file=autoload.php ./conformance_php.php' >> conformance-php
  291. @chmod +x conformance-php
  292. conformance-php-c:
  293. @echo "Writing shortcut script conformance-php-c..."
  294. @echo '#! /bin/sh' > conformance-php-c
  295. @echo 'php -dextension=../php/ext/google/protobuf/modules/protobuf.so ./conformance_php.php' >> conformance-php-c
  296. @chmod +x conformance-php-c
  297. # Targets for actually running tests.
  298. test_cpp: protoc_middleman conformance-test-runner conformance-cpp
  299. ./conformance-test-runner --enforce_recommended --failure_list failure_list_cpp.txt ./conformance-cpp
  300. test_java: protoc_middleman conformance-test-runner conformance-java
  301. ./conformance-test-runner --enforce_recommended --failure_list failure_list_java.txt ./conformance-java
  302. test_java_lite: protoc_middleman conformance-test-runner conformance-java-lite
  303. ./conformance-test-runner --enforce_recommended ./conformance-java-lite
  304. test_csharp: protoc_middleman conformance-test-runner conformance-csharp
  305. ./conformance-test-runner --enforce_recommended --failure_list failure_list_csharp.txt ./conformance-csharp
  306. test_ruby: protoc_middleman conformance-test-runner $(other_language_protoc_outputs)
  307. RUBYLIB=../ruby/lib:. ./conformance-test-runner --enforce_recommended --failure_list failure_list_ruby.txt ./conformance_ruby.rb
  308. test_php: protoc_middleman conformance-test-runner conformance-php $(other_language_protoc_outputs)
  309. ./conformance-test-runner --enforce_recommended --failure_list failure_list_php.txt ./conformance-php
  310. test_php_c: protoc_middleman conformance-test-runner conformance-php-c $(other_language_protoc_outputs)
  311. ./conformance-test-runner --enforce_recommended --failure_list failure_list_php_c.txt ./conformance-php-c
  312. test_php_zts_c: protoc_middleman conformance-test-runner conformance-php-c $(other_language_protoc_outputs)
  313. ./conformance-test-runner --enforce_recommended --failure_list failure_list_php_zts_c.txt ./conformance-php-c
  314. # These depend on library paths being properly set up. The easiest way to
  315. # run them is to just use "tox" from the python dir.
  316. test_python: protoc_middleman conformance-test-runner
  317. ./conformance-test-runner --enforce_recommended --failure_list failure_list_python.txt ./conformance_python.py
  318. test_python_cpp: protoc_middleman conformance-test-runner
  319. ./conformance-test-runner --enforce_recommended --failure_list failure_list_python_cpp.txt ./conformance_python.py
  320. test_nodejs: protoc_middleman conformance-test-runner $(other_language_protoc_outputs)
  321. NODE_PATH=../js:. ./conformance-test-runner --enforce_recommended --failure_list failure_list_js.txt ./conformance_nodejs.js
  322. if OBJC_CONFORMANCE_TEST
  323. test_objc: protoc_middleman conformance-test-runner conformance-objc
  324. ./conformance-test-runner --enforce_recommended --failure_list failure_list_objc.txt ./conformance-objc
  325. endif