Makefile.am 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375
  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/FailureSet.php \
  105. Conformance/WireFormat.php \
  106. GPBMetadata/Conformance.php \
  107. GPBMetadata/Google/Protobuf/Any.php \
  108. GPBMetadata/Google/Protobuf/Duration.php \
  109. GPBMetadata/Google/Protobuf/FieldMask.php \
  110. GPBMetadata/Google/Protobuf/Struct.php \
  111. GPBMetadata/Google/Protobuf/TestMessagesProto3.php \
  112. GPBMetadata/Google/Protobuf/Timestamp.php \
  113. GPBMetadata/Google/Protobuf/Wrappers.php \
  114. Google/Protobuf/Any.php \
  115. Google/Protobuf/BoolValue.php \
  116. Google/Protobuf/BytesValue.php \
  117. Google/Protobuf/DoubleValue.php \
  118. Google/Protobuf/Duration.php \
  119. Google/Protobuf/FieldMask.php \
  120. Google/Protobuf/FloatValue.php \
  121. Google/Protobuf/Int32Value.php \
  122. Google/Protobuf/Int64Value.php \
  123. Google/Protobuf/ListValue.php \
  124. Google/Protobuf/NullValue.php \
  125. Google/Protobuf/StringValue.php \
  126. Google/Protobuf/Struct.php \
  127. Google/Protobuf/Timestamp.php \
  128. Google/Protobuf/UInt32Value.php \
  129. Google/Protobuf/UInt64Value.php \
  130. Google/Protobuf/Value.php \
  131. Protobuf_test_messages/Proto3/ForeignEnum.php \
  132. Protobuf_test_messages/Proto3/ForeignMessage.php \
  133. Protobuf_test_messages/Proto3/TestAllTypes_NestedEnum.php \
  134. Protobuf_test_messages/Proto3/TestAllTypes_NestedMessage.php \
  135. Protobuf_test_messages/Proto3/TestAllTypes.php
  136. # lite/com/google/protobuf/Any.java \
  137. # lite/com/google/protobuf/AnyOrBuilder.java \
  138. # lite/com/google/protobuf/AnyProto.java \
  139. # lite/com/google/protobuf/BoolValue.java \
  140. # lite/com/google/protobuf/BoolValueOrBuilder.java \
  141. # lite/com/google/protobuf/BytesValue.java \
  142. # lite/com/google/protobuf/BytesValueOrBuilder.java \
  143. # lite/com/google/protobuf/conformance/Conformance.java \
  144. # lite/com/google/protobuf/DoubleValue.java \
  145. # lite/com/google/protobuf/DoubleValueOrBuilder.java \
  146. # lite/com/google/protobuf/Duration.java \
  147. # lite/com/google/protobuf/DurationOrBuilder.java \
  148. # lite/com/google/protobuf/DurationProto.java \
  149. # lite/com/google/protobuf/FieldMask.java \
  150. # lite/com/google/protobuf/FieldMaskOrBuilder.java \
  151. # lite/com/google/protobuf/FieldMaskProto.java \
  152. # lite/com/google/protobuf/FloatValue.java \
  153. # lite/com/google/protobuf/FloatValueOrBuilder.java \
  154. # lite/com/google/protobuf/Int32Value.java \
  155. # lite/com/google/protobuf/Int32ValueOrBuilder.java \
  156. # lite/com/google/protobuf/Int64Value.java \
  157. # lite/com/google/protobuf/Int64ValueOrBuilder.java \
  158. # lite/com/google/protobuf/ListValue.java \
  159. # lite/com/google/protobuf/ListValueOrBuilder.java \
  160. # lite/com/google/protobuf/NullValue.java \
  161. # lite/com/google/protobuf/StringValue.java \
  162. # lite/com/google/protobuf/StringValueOrBuilder.java \
  163. # lite/com/google/protobuf/Struct.java \
  164. # lite/com/google/protobuf/StructOrBuilder.java \
  165. # lite/com/google/protobuf/StructProto.java \
  166. # lite/com/google/protobuf/Timestamp.java \
  167. # lite/com/google/protobuf/TimestampOrBuilder.java \
  168. # lite/com/google/protobuf/TimestampProto.java \
  169. # lite/com/google/protobuf/UInt32Value.java \
  170. # lite/com/google/protobuf/UInt32ValueOrBuilder.java \
  171. # lite/com/google/protobuf/UInt64Value.java \
  172. # lite/com/google/protobuf/UInt64ValueOrBuilder.java \
  173. # lite/com/google/protobuf/Value.java \
  174. # lite/com/google/protobuf/ValueOrBuilder.java \
  175. # lite/com/google/protobuf/WrappersProto.java
  176. bin_PROGRAMS = conformance-test-runner conformance-cpp
  177. # All source files excepet C++/Objective-C ones should be explicitly listed
  178. # here because the autoconf tools don't include files of other languages
  179. # automatically.
  180. EXTRA_DIST = \
  181. ConformanceJava.java \
  182. ConformanceJavaLite.java \
  183. README.md \
  184. conformance.proto \
  185. conformance_python.py \
  186. conformance_ruby.rb \
  187. conformance_php.php \
  188. failure_list_cpp.txt \
  189. failure_list_csharp.txt \
  190. failure_list_java.txt \
  191. failure_list_js.txt \
  192. failure_list_objc.txt \
  193. failure_list_python.txt \
  194. failure_list_python_cpp.txt \
  195. failure_list_python-post26.txt \
  196. failure_list_ruby.txt \
  197. failure_list_php.txt \
  198. failure_list_php_c.txt
  199. conformance_test_runner_LDADD = $(top_srcdir)/src/libprotobuf.la
  200. conformance_test_runner_SOURCES = conformance_test.h conformance_test.cc \
  201. conformance_test_main.cc \
  202. binary_json_conformance_suite.h \
  203. binary_json_conformance_suite.cc \
  204. text_format_conformance_suite.h \
  205. text_format_conformance_suite.cc \
  206. conformance_test_runner.cc \
  207. third_party/jsoncpp/json.h \
  208. third_party/jsoncpp/jsoncpp.cpp
  209. nodist_conformance_test_runner_SOURCES = conformance.pb.cc google/protobuf/test_messages_proto3.pb.cc google/protobuf/test_messages_proto2.pb.cc
  210. conformance_test_runner_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)
  211. conformance_test_runner_CXXFLAGS = -std=c++11
  212. # Explicit deps because BUILT_SOURCES are only done before a "make all/check"
  213. # so a direct "make test_cpp" could fail if parallel enough.
  214. conformance_test_runner-conformance_test.$(OBJEXT): conformance.pb.h
  215. conformance_test_runner-conformance_test_runner.$(OBJEXT): conformance.pb.h
  216. conformance_cpp_LDADD = $(top_srcdir)/src/libprotobuf.la
  217. conformance_cpp_SOURCES = conformance_cpp.cc
  218. nodist_conformance_cpp_SOURCES = conformance.pb.cc google/protobuf/test_messages_proto3.pb.cc google/protobuf/test_messages_proto2.pb.cc
  219. conformance_cpp_CPPFLAGS = -I$(top_srcdir)/src
  220. # Explicit dep because BUILT_SOURCES are only done before a "make all/check"
  221. # so a direct "make test_cpp" could fail if parallel enough.
  222. conformance_cpp-conformance_cpp.$(OBJEXT): conformance.pb.h
  223. if OBJC_CONFORMANCE_TEST
  224. bin_PROGRAMS += conformance-objc
  225. conformance_objc_SOURCES = conformance_objc.m ../objectivec/GPBProtocolBuffers.m
  226. nodist_conformance_objc_SOURCES = Conformance.pbobjc.m google/protobuf/TestMessagesProto2.pbobjc.m google/protobuf/TestMessagesProto3.pbobjc.m
  227. # On travis, the build fails without the isysroot because whatever system
  228. # headers are being found don't include generics support for
  229. # NSArray/NSDictionary, the only guess is their image at one time had an odd
  230. # setup for Xcode and old frameworks are being found.
  231. conformance_objc_CPPFLAGS = -I$(top_srcdir)/objectivec -isysroot `xcrun --sdk macosx --show-sdk-path`
  232. conformance_objc_LDFLAGS = -framework Foundation
  233. # Explicit dep because BUILT_SOURCES are only done before a "make all/check"
  234. # so a direct "make test_objc" could fail if parallel enough.
  235. conformance_objc-conformance_objc.$(OBJEXT): Conformance.pbobjc.h google/protobuf/TestMessagesProto2.pbobjc.h google/protobuf/TestMessagesProto3.pbobjc.h
  236. endif
  237. # JavaScript well-known types are expected to be in a directory called
  238. # google-protobuf, because they are usually in the google-protobuf npm
  239. # package. But we want to use the sources from our tree, so we recreate
  240. # that directory structure here.
  241. google-protobuf:
  242. mkdir google-protobuf
  243. if USE_EXTERNAL_PROTOC
  244. # Some implementations include pre-generated versions of well-known types.
  245. protoc_middleman: $(conformance_protoc_inputs) $(conformance_proto2_protoc_inputs) $(well_known_type_protoc_inputs) google-protobuf
  246. $(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)
  247. $(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. --java_out=. --objc_out=. --python_out=. --js_out=import_style=commonjs,binary:. $(conformance_proto2_protoc_inputs)
  248. $(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)
  249. ## $(PROTOC) -I$(srcdir) -I$(top_srcdir) --java_out=lite:lite $(conformance_protoc_inputs) $(well_known_type_protoc_inputs)
  250. touch protoc_middleman
  251. else
  252. # We have to cd to $(srcdir) before executing protoc because $(protoc_inputs) is
  253. # relative to srcdir, which may not be the same as the current directory when
  254. # building out-of-tree.
  255. protoc_middleman: $(top_srcdir)/src/protoc$(EXEEXT) $(conformance_protoc_inputs) $(conformance_proto2_protoc_inputs) $(well_known_type_protoc_inputs) google-protobuf
  256. 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) )
  257. 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) )
  258. 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) )
  259. ## @mkdir -p lite
  260. ## 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) )
  261. touch protoc_middleman
  262. endif
  263. $(protoc_outputs): protoc_middleman
  264. $(other_language_protoc_outputs): protoc_middleman
  265. 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)
  266. MAINTAINERCLEANFILES = \
  267. Makefile.in
  268. javac_middleman: ConformanceJava.java protoc_middleman $(other_language_protoc_outputs)
  269. 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
  270. @touch javac_middleman
  271. conformance-java: javac_middleman
  272. @echo "Writing shortcut script conformance-java..."
  273. @echo '#! /bin/sh' > conformance-java
  274. @jar=`ls ../java/util/target/*jar-with-dependencies.jar` && echo java -classpath .:../java/target/classes:$$jar ConformanceJava '$$@' >> conformance-java
  275. @chmod +x conformance-java
  276. javac_middleman_lite: ConformanceJavaLite.java protoc_middleman $(other_language_protoc_outputs)
  277. javac -classpath ../java/lite/target/classes:lite ConformanceJavaLite.java lite/com/google/protobuf/conformance/Conformance.java
  278. @touch javac_middleman_lite
  279. conformance-java-lite: javac_middleman_lite
  280. @echo "Writing shortcut script conformance-java-lite..."
  281. @echo '#! /bin/sh' > conformance-java-lite
  282. @echo java -classpath .:../java/lite/target/classes:lite ConformanceJavaLite '$$@' >> conformance-java-lite
  283. @chmod +x conformance-java-lite
  284. # Currently the conformance code is alongside the rest of the C#
  285. # source, as it's easier to maintain there. We assume we've already
  286. # built that, so we just need a script to run it.
  287. conformance-csharp: $(other_language_protoc_outputs)
  288. @echo "Writing shortcut script conformance-csharp..."
  289. @echo '#! /bin/sh' > conformance-csharp
  290. @echo 'dotnet ../csharp/src/Google.Protobuf.Conformance/bin/Release/netcoreapp2.1/Google.Protobuf.Conformance.dll "$$@"' >> conformance-csharp
  291. @chmod +x conformance-csharp
  292. conformance-php:
  293. @echo "Writing shortcut script conformance-php..."
  294. @echo '#! /bin/sh' > conformance-php
  295. @echo 'php -d auto_prepend_file=autoload.php ./conformance_php.php' >> conformance-php
  296. @chmod +x conformance-php
  297. conformance-php-c:
  298. @echo "Writing shortcut script conformance-php-c..."
  299. @echo '#! /bin/sh' > conformance-php-c
  300. @echo 'php -dextension=../php/ext/google/protobuf/modules/protobuf.so ./conformance_php.php' >> conformance-php-c
  301. @chmod +x conformance-php-c
  302. # Targets for actually running tests.
  303. test_cpp: protoc_middleman conformance-test-runner conformance-cpp
  304. ./conformance-test-runner --enforce_recommended --failure_list failure_list_cpp.txt ./conformance-cpp
  305. test_java: protoc_middleman conformance-test-runner conformance-java
  306. ./conformance-test-runner --enforce_recommended --failure_list failure_list_java.txt --text_format_failure_list text_format_failure_list_java.txt ./conformance-java
  307. test_java_lite: protoc_middleman conformance-test-runner conformance-java-lite
  308. ./conformance-test-runner --enforce_recommended ./conformance-java-lite
  309. test_csharp: protoc_middleman conformance-test-runner conformance-csharp
  310. ./conformance-test-runner --enforce_recommended --failure_list failure_list_csharp.txt --text_format_failure_list text_format_failure_list_csharp.txt ./conformance-csharp
  311. test_ruby: protoc_middleman conformance-test-runner $(other_language_protoc_outputs)
  312. RUBYLIB=../ruby/lib:. ./conformance-test-runner --enforce_recommended --failure_list failure_list_ruby.txt --text_format_failure_list text_format_failure_list_ruby.txt ./conformance_ruby.rb
  313. test_php: protoc_middleman conformance-test-runner conformance-php $(other_language_protoc_outputs)
  314. ./conformance-test-runner --enforce_recommended --failure_list failure_list_php.txt --text_format_failure_list text_format_failure_list_php.txt ./conformance-php
  315. test_php_c: protoc_middleman conformance-test-runner conformance-php-c $(other_language_protoc_outputs)
  316. ./conformance-test-runner --enforce_recommended --failure_list failure_list_php_c.txt --text_format_failure_list text_format_failure_list_php.txt ./conformance-php-c
  317. test_php_c_32: protoc_middleman conformance-test-runner conformance-php-c $(other_language_protoc_outputs)
  318. ./conformance-test-runner --enforce_recommended --failure_list failure_list_php_c_32.txt --text_format_failure_list text_format_failure_list_php.txt ./conformance-php-c
  319. # These depend on library paths being properly set up. The easiest way to
  320. # run them is to just use "tox" from the python dir.
  321. test_python: protoc_middleman conformance-test-runner
  322. ./conformance-test-runner --enforce_recommended --failure_list failure_list_python.txt --text_format_failure_list text_format_failure_list_python.txt ./conformance_python.py
  323. test_python_cpp: protoc_middleman conformance-test-runner
  324. ./conformance-test-runner --enforce_recommended --failure_list failure_list_python_cpp.txt ./conformance_python.py
  325. test_nodejs: protoc_middleman conformance-test-runner $(other_language_protoc_outputs)
  326. NODE_PATH=../js:. ./conformance-test-runner --enforce_recommended --failure_list failure_list_js.txt ./conformance_nodejs.js
  327. if OBJC_CONFORMANCE_TEST
  328. test_objc: protoc_middleman conformance-test-runner conformance-objc
  329. ./conformance-test-runner --enforce_recommended --failure_list failure_list_objc.txt ./conformance-objc
  330. endif