Makefile.am 20 KB

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