Makefile.am 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664
  1. benchmarks_protoc_inputs_benchmark_wrapper = \
  2. benchmarks.proto
  3. benchmarks_protoc_inputs = \
  4. datasets/google_message1/proto3/benchmark_message1_proto3.proto
  5. benchmarks_protoc_inputs_proto2 = \
  6. datasets/google_message1/proto2/benchmark_message1_proto2.proto \
  7. datasets/google_message2/benchmark_message2.proto \
  8. datasets/google_message3/benchmark_message3.proto \
  9. datasets/google_message3/benchmark_message3_1.proto \
  10. datasets/google_message3/benchmark_message3_2.proto \
  11. datasets/google_message3/benchmark_message3_3.proto \
  12. datasets/google_message3/benchmark_message3_4.proto \
  13. datasets/google_message3/benchmark_message3_5.proto \
  14. datasets/google_message3/benchmark_message3_6.proto \
  15. datasets/google_message3/benchmark_message3_7.proto \
  16. datasets/google_message3/benchmark_message3_8.proto \
  17. datasets/google_message4/benchmark_message4.proto \
  18. datasets/google_message4/benchmark_message4_1.proto \
  19. datasets/google_message4/benchmark_message4_2.proto \
  20. datasets/google_message4/benchmark_message4_3.proto
  21. make_tmp_dir:
  22. mkdir -p 'tmp/java/src/main/java'
  23. touch make_tmp_dir
  24. # We have to cd to $(srcdir) before executing protoc because $(protoc_inputs) is
  25. # relative to srcdir, which may not be the same as the current directory when
  26. # building out-of-tree.
  27. protoc_middleman: make_tmp_dir $(top_srcdir)/src/protoc$(EXEEXT) $(benchmarks_protoc_inputs) $(well_known_type_protoc_inputs) $(benchmarks_protoc_inputs_benchmark_wrapper)
  28. oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd/cpp --java_out=$$oldpwd/tmp/java/src/main/java --python_out=$$oldpwd/tmp $(benchmarks_protoc_inputs) $(benchmarks_protoc_inputs_benchmark_wrapper) )
  29. touch protoc_middleman
  30. protoc_middleman2: make_tmp_dir $(top_srcdir)/src/protoc$(EXEEXT) $(benchmarks_protoc_inputs_proto2) $(well_known_type_protoc_inputs)
  31. oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd/cpp --java_out=$$oldpwd/tmp/java/src/main/java --python_out=$$oldpwd/tmp $(benchmarks_protoc_inputs_proto2) )
  32. touch protoc_middleman2
  33. all_data = $$(find $$(cd $(srcdir) && pwd) -type f -name "dataset.*.pb" -not -path "$$(cd $(srcdir) && pwd)/tmp/*")
  34. ############# CPP RULES ##############
  35. benchmarks_protoc_outputs = \
  36. cpp/benchmarks.pb.cc \
  37. cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc
  38. benchmarks_protoc_outputs_header = \
  39. cpp/benchmarks.pb.h \
  40. cpp/datasets/google_message1/proto3/benchmark_message1_proto3.pb.h
  41. benchmarks_protoc_outputs_proto2_header = \
  42. cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.h \
  43. cpp/datasets/google_message2/benchmark_message2.pb.h \
  44. cpp/datasets/google_message3/benchmark_message3.pb.h \
  45. cpp/datasets/google_message3/benchmark_message3_1.pb.h \
  46. cpp/datasets/google_message3/benchmark_message3_2.pb.h \
  47. cpp/datasets/google_message3/benchmark_message3_3.pb.h \
  48. cpp/datasets/google_message3/benchmark_message3_4.pb.h \
  49. cpp/datasets/google_message3/benchmark_message3_5.pb.h \
  50. cpp/datasets/google_message3/benchmark_message3_6.pb.h \
  51. cpp/datasets/google_message3/benchmark_message3_7.pb.h \
  52. cpp/datasets/google_message3/benchmark_message3_8.pb.h \
  53. cpp/datasets/google_message4/benchmark_message4.pb.h \
  54. cpp/datasets/google_message4/benchmark_message4_1.pb.h \
  55. cpp/datasets/google_message4/benchmark_message4_2.pb.h \
  56. cpp/datasets/google_message4/benchmark_message4_3.pb.h
  57. benchmarks_protoc_outputs_proto2 = \
  58. cpp/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc \
  59. cpp/datasets/google_message2/benchmark_message2.pb.cc \
  60. cpp/datasets/google_message3/benchmark_message3.pb.cc \
  61. cpp/datasets/google_message3/benchmark_message3_1.pb.cc \
  62. cpp/datasets/google_message3/benchmark_message3_2.pb.cc \
  63. cpp/datasets/google_message3/benchmark_message3_3.pb.cc \
  64. cpp/datasets/google_message3/benchmark_message3_4.pb.cc \
  65. cpp/datasets/google_message3/benchmark_message3_5.pb.cc \
  66. cpp/datasets/google_message3/benchmark_message3_6.pb.cc \
  67. cpp/datasets/google_message3/benchmark_message3_7.pb.cc \
  68. cpp/datasets/google_message3/benchmark_message3_8.pb.cc \
  69. cpp/datasets/google_message4/benchmark_message4.pb.cc \
  70. cpp/datasets/google_message4/benchmark_message4_1.pb.cc \
  71. cpp/datasets/google_message4/benchmark_message4_2.pb.cc \
  72. cpp/datasets/google_message4/benchmark_message4_3.pb.cc
  73. $(benchmarks_protoc_outputs): protoc_middleman
  74. $(benchmarks_protoc_outputs_header): protoc_middleman
  75. $(benchmarks_protoc_outputs_proto2): protoc_middleman2
  76. $(benchmarks_protoc_outputs_proto2_header): protoc_middleman2
  77. initialize_submodule:
  78. oldpwd=`pwd`
  79. cd $(top_srcdir) && git submodule update --init -r third_party/benchmark && \
  80. cd third_party/benchmark && cmake -DCMAKE_BUILD_TYPE=Release && make
  81. cd $$oldpwd
  82. touch initialize_submodule
  83. $(top_srcdir)/third_party/benchmark/src/libbenchmark.a: initialize_submodule
  84. AM_CXXFLAGS = $(NO_OPT_CXXFLAGS) $(PROTOBUF_OPT_FLAG) -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare
  85. bin_PROGRAMS = cpp-benchmark
  86. cpp_benchmark_LDADD = $(top_srcdir)/src/libprotobuf.la $(top_srcdir)/third_party/benchmark/src/libbenchmark.a
  87. cpp_benchmark_SOURCES = cpp/cpp_benchmark.cc
  88. cpp_benchmark_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)/cpp -I$(top_srcdir)/third_party/benchmark/include
  89. # Explicit deps because BUILT_SOURCES are only done before a "make all/check"
  90. # so a direct "make test_cpp" could fail if parallel enough.
  91. # See: https://www.gnu.org/software/automake/manual/html_node/Built-Sources-Example.html#Recording-Dependencies-manually
  92. cpp/cpp_benchmark-cpp_benchmark.$(OBJEXT): $(benchmarks_protoc_outputs) $(benchmarks_protoc_outputs_proto2) $(benchmarks_protoc_outputs_header) $(benchmarks_protoc_outputs_proto2_header) $(top_srcdir)/src/libprotobuf.la $(top_srcdir)/third_party/benchmark/src/libbenchmark.a
  93. cpp/benchmark-cpp_benchmark.$(OBJEXT): $(benchmarks_protoc_outputs) $(benchmarks_protoc_outputs_proto2) $(benchmarks_protoc_outputs_header) $(benchmarks_protoc_outputs_proto2_header) $(top_srcdir)/src/libprotobuf.la $(top_srcdir)/third_party/benchmark/src/libbenchmark.a
  94. nodist_cpp_benchmark_SOURCES = \
  95. $(benchmarks_protoc_outputs) \
  96. $(benchmarks_protoc_outputs_proto2) \
  97. $(benchmarks_protoc_outputs_proto2_header) \
  98. $(benchmarks_protoc_outputs_header)
  99. cpp: protoc_middleman protoc_middleman2 cpp-benchmark initialize_submodule
  100. ./cpp-benchmark $(all_data)
  101. ############ CPP RULES END ############
  102. ############# JAVA RULES ##############
  103. java_benchmark_testing_files = \
  104. java/src/main/java/com/google/protobuf/ProtoCaliperBenchmark.java
  105. javac_middleman: $(java_benchmark_testing_files) protoc_middleman protoc_middleman2
  106. cp -r $(srcdir)/java tmp
  107. mkdir -p tmp/java/lib
  108. cp $(top_srcdir)/java/core/target/*.jar tmp/java/lib/protobuf-java.jar
  109. cd tmp/java && mvn clean compile assembly:single -Dprotobuf.version=$(PACKAGE_VERSION) && cd ../..
  110. @touch javac_middleman
  111. java-benchmark: javac_middleman
  112. @echo "Writing shortcut script java-benchmark..."
  113. @echo '#! /bin/bash' > java-benchmark
  114. @echo 'all_data=""' >> java-benchmark
  115. @echo 'conf=()' >> java-benchmark
  116. @echo 'data_files=""' >> java-benchmark
  117. @echo 'for arg in $$@; do if [[ $${arg:0:1} == "-" ]]; then conf+=($$arg); else data_files+="$$arg,"; fi; done' >> java-benchmark
  118. @echo 'java -cp '\"tmp/java/target/*:$(top_srcdir)/java/core/target/*:$(top_srcdir)/java/util/target/*\"" \\" >>java-benchmark
  119. @echo ' com.google.caliper.runner.CaliperMain com.google.protobuf.ProtoCaliperBenchmark -i runtime '"\\" >> java-benchmark
  120. @echo ' -b serializeToByteArray,serializeToMemoryStream,deserializeFromByteArray,deserializeFromMemoryStream '"\\" >> java-benchmark
  121. @echo ' -DdataFile=$${data_files:0:-1} $${conf[*]}' >> java-benchmark
  122. @chmod +x java-benchmark
  123. java: protoc_middleman protoc_middleman2 java-benchmark
  124. ./java-benchmark $(all_data)
  125. ############# JAVA RULES END ##############
  126. ############# PYTHON RULES ##############
  127. python_add_init: protoc_middleman protoc_middleman2
  128. all_file=`find tmp -type f -regex '.*\.py'` && \
  129. for file in $${all_file[@]}; do \
  130. path="$${file%/*}"; \
  131. while true; do \
  132. touch "$$path/__init__.py" && chmod +x "$$path/__init__.py"; \
  133. if [[ $$path != *"/"* ]]; then break; fi; \
  134. path=$${path%/*}; \
  135. done \
  136. done
  137. python_cpp_pkg_flags = `pkg-config --cflags --libs python`
  138. lib_LTLIBRARIES = libbenchmark_messages.la
  139. libbenchmark_messages_la_SOURCES = python/python_benchmark_messages.cc
  140. libbenchmark_messages_la_LIBADD = $(top_srcdir)/src/.libs/libprotobuf.la
  141. libbenchmark_messages_la_LDFLAGS = -version-info 1:0:0 -export-dynamic
  142. libbenchmark_messages_la_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)/cpp $(python_cpp_pkg_flags)
  143. libbenchmark_messages_la-python_benchmark_messages.$(OBJEXT): $(benchmarks_protoc_outputs_header) $(benchmarks_protoc_outputs_proto2_header) $(benchmarks_protoc_outputs) $(benchmarks_protoc_outputs_proto2)
  144. nodist_libbenchmark_messages_la_SOURCES = \
  145. $(benchmarks_protoc_outputs) \
  146. $(benchmarks_protoc_outputs_proto2) \
  147. $(benchmarks_protoc_outputs_proto2_header) \
  148. $(benchmarks_protoc_outputs_header)
  149. python-pure-python-benchmark: python_add_init
  150. @echo "Writing shortcut script python-pure-python-benchmark..."
  151. @echo '#! /bin/bash' > python-pure-python-benchmark
  152. @echo export LD_LIBRARY_PATH=$(top_srcdir)/src/.libs >> python-pure-python-benchmark
  153. @echo export DYLD_LIBRARY_PATH=$(top_srcdir)/src/.libs >> python-pure-python-benchmark
  154. @echo export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=\'python\' >> python-pure-python-benchmark
  155. @echo cp $(srcdir)/python/py_benchmark.py tmp >> python-pure-python-benchmark
  156. @echo python tmp/py_benchmark.py '$$@' >> python-pure-python-benchmark
  157. @chmod +x python-pure-python-benchmark
  158. python-cpp-reflection-benchmark: python_add_init
  159. @echo "Writing shortcut script python-cpp-reflection-benchmark..."
  160. @echo '#! /bin/bash' > python-cpp-reflection-benchmark
  161. @echo export LD_LIBRARY_PATH=$(top_srcdir)/src/.libs >> python-cpp-reflection-benchmark
  162. @echo export DYLD_LIBRARY_PATH=$(top_srcdir)/src/.libs >> python-cpp-reflection-benchmark
  163. @echo export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=\'cpp\' >> python-cpp-reflection-benchmark
  164. @echo cp $(srcdir)/python/py_benchmark.py tmp >> python-cpp-reflection-benchmark
  165. @echo python tmp/py_benchmark.py '$$@' >> python-cpp-reflection-benchmark
  166. @chmod +x python-cpp-reflection-benchmark
  167. python-cpp-generated-code-benchmark: python_add_init libbenchmark_messages.la
  168. @echo "Writing shortcut script python-cpp-generated-code-benchmark..."
  169. @echo '#! /bin/bash' > python-cpp-generated-code-benchmark
  170. @echo export LD_LIBRARY_PATH=$(top_srcdir)/src/.libs >> python-cpp-generated-code-benchmark
  171. @echo export DYLD_LIBRARY_PATH=$(top_srcdir)/src/.libs >> python-cpp-generated-code-benchmark
  172. @echo export PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=\'cpp\' >> python-cpp-generated-code-benchmark
  173. @echo cp $(srcdir)/python/py_benchmark.py tmp >> python-cpp-generated-code-benchmark
  174. @echo python tmp/py_benchmark.py --cpp_generated '$$@' >> python-cpp-generated-code-benchmark
  175. @chmod +x python-cpp-generated-code-benchmark
  176. python-pure-python: python-pure-python-benchmark
  177. ./python-pure-python-benchmark $(all_data)
  178. python-cpp-reflection: python-cpp-reflection-benchmark
  179. ./python-cpp-reflection-benchmark $(all_data)
  180. python-cpp-generated-code: python-cpp-generated-code-benchmark
  181. ./python-cpp-generated-code-benchmark $(all_data)
  182. ############# PYTHON RULES END ##############
  183. ############# GO RULES BEGIN ##############
  184. benchmarks_protoc_inputs_proto2_message1 = \
  185. datasets/google_message1/proto2/benchmark_message1_proto2.proto
  186. benchmarks_protoc_inputs_proto2_message2 = \
  187. datasets/google_message2/benchmark_message2.proto
  188. benchmarks_protoc_inputs_proto2_message3 = \
  189. datasets/google_message3/benchmark_message3.proto \
  190. datasets/google_message3/benchmark_message3_1.proto \
  191. datasets/google_message3/benchmark_message3_2.proto \
  192. datasets/google_message3/benchmark_message3_3.proto \
  193. datasets/google_message3/benchmark_message3_4.proto \
  194. datasets/google_message3/benchmark_message3_5.proto \
  195. datasets/google_message3/benchmark_message3_6.proto \
  196. datasets/google_message3/benchmark_message3_7.proto \
  197. datasets/google_message3/benchmark_message3_8.proto
  198. benchmarks_protoc_inputs_proto2_message4 = \
  199. datasets/google_message4/benchmark_message4.proto \
  200. datasets/google_message4/benchmark_message4_1.proto \
  201. datasets/google_message4/benchmark_message4_2.proto \
  202. datasets/google_message4/benchmark_message4_3.proto
  203. go_protoc_middleman: make_tmp_dir $(top_srcdir)/src/protoc$(EXEEXT) $(benchmarks_protoc_inputs) $(well_known_type_protoc_inputs) $(benchmarks_protoc_inputs_proto2_message1) $(benchmarks_protoc_inputs_proto2_message2) $(benchmarks_protoc_inputs_proto2_message3) $(benchmarks_protoc_inputs_proto2_message4) $(well_known_type_protoc_inputs)
  204. oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --go_out=$$oldpwd/tmp $(benchmarks_protoc_inputs) )
  205. oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --go_out=$$oldpwd/tmp $(benchmarks_protoc_inputs_benchmark_wrapper) )
  206. oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --go_out=$$oldpwd/tmp $(benchmarks_protoc_inputs_proto2_message1) )
  207. oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --go_out=$$oldpwd/tmp $(benchmarks_protoc_inputs_proto2_message2) )
  208. oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --go_out=$$oldpwd/tmp $(benchmarks_protoc_inputs_proto2_message3) )
  209. oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --go_out=$$oldpwd/tmp $(benchmarks_protoc_inputs_proto2_message4) )
  210. touch go_protoc_middleman
  211. go-benchmark: go_protoc_middleman
  212. @echo "Writing shortcut script go-benchmark..."
  213. @echo '#! /bin/bash' > go-benchmark
  214. @echo 'cd $(srcdir)/go' >> go-benchmark
  215. @echo 'all_data=""' >> go-benchmark
  216. @echo 'conf=()' >> go-benchmark
  217. @echo 'data_files=()' >> go-benchmark
  218. @echo 'for arg in $$@; do if [[ $${arg:0:1} == "-" ]]; then conf+=($$arg); else data_files+=("$$arg"); fi; done' >> go-benchmark
  219. @echo 'go test -bench=. $${conf[*]} -- $${data_files[*]}' >> go-benchmark
  220. @echo 'cd ..' >> go-benchmark
  221. @chmod +x go-benchmark
  222. go: go_protoc_middleman go-benchmark
  223. ./go-benchmark $(all_data)
  224. ############# GO RULES END ##############
  225. ############# GOGO RULES BEGIN ############
  226. cpp_no_group_benchmarks_protoc_outputs_header = \
  227. gogo/cpp_no_group/benchmarks.pb.h \
  228. gogo/cpp_no_group/datasets/google_message1/proto3/benchmark_message1_proto3.pb.h
  229. cpp_no_group_benchmarks_protoc_outputs = \
  230. gogo/cpp_no_group/benchmarks.pb.cc \
  231. gogo/cpp_no_group/datasets/google_message1/proto3/benchmark_message1_proto3.pb.cc
  232. cpp_no_group_benchmarks_protoc_outputs_proto2_header = \
  233. gogo/cpp_no_group/datasets/google_message1/proto2/benchmark_message1_proto2.pb.h \
  234. gogo/cpp_no_group/datasets/google_message2/benchmark_message2.pb.h \
  235. gogo/cpp_no_group/datasets/google_message3/benchmark_message3.pb.h \
  236. gogo/cpp_no_group/datasets/google_message3/benchmark_message3_1.pb.h \
  237. gogo/cpp_no_group/datasets/google_message3/benchmark_message3_2.pb.h \
  238. gogo/cpp_no_group/datasets/google_message3/benchmark_message3_3.pb.h \
  239. gogo/cpp_no_group/datasets/google_message3/benchmark_message3_4.pb.h \
  240. gogo/cpp_no_group/datasets/google_message3/benchmark_message3_5.pb.h \
  241. gogo/cpp_no_group/datasets/google_message3/benchmark_message3_6.pb.h \
  242. gogo/cpp_no_group/datasets/google_message3/benchmark_message3_7.pb.h \
  243. gogo/cpp_no_group/datasets/google_message3/benchmark_message3_8.pb.h \
  244. gogo/cpp_no_group/datasets/google_message4/benchmark_message4.pb.h \
  245. gogo/cpp_no_group/datasets/google_message4/benchmark_message4_1.pb.h \
  246. gogo/cpp_no_group/datasets/google_message4/benchmark_message4_2.pb.h \
  247. gogo/cpp_no_group/datasets/google_message4/benchmark_message4_3.pb.h
  248. cpp_no_group_benchmarks_protoc_outputs_proto2 = \
  249. gogo/cpp_no_group/datasets/google_message1/proto2/benchmark_message1_proto2.pb.cc \
  250. gogo/cpp_no_group/datasets/google_message2/benchmark_message2.pb.cc \
  251. gogo/cpp_no_group/datasets/google_message3/benchmark_message3.pb.cc \
  252. gogo/cpp_no_group/datasets/google_message3/benchmark_message3_1.pb.cc \
  253. gogo/cpp_no_group/datasets/google_message3/benchmark_message3_2.pb.cc \
  254. gogo/cpp_no_group/datasets/google_message3/benchmark_message3_3.pb.cc \
  255. gogo/cpp_no_group/datasets/google_message3/benchmark_message3_4.pb.cc \
  256. gogo/cpp_no_group/datasets/google_message3/benchmark_message3_5.pb.cc \
  257. gogo/cpp_no_group/datasets/google_message3/benchmark_message3_6.pb.cc \
  258. gogo/cpp_no_group/datasets/google_message3/benchmark_message3_7.pb.cc \
  259. gogo/cpp_no_group/datasets/google_message3/benchmark_message3_8.pb.cc \
  260. gogo/cpp_no_group/datasets/google_message4/benchmark_message4.pb.cc \
  261. gogo/cpp_no_group/datasets/google_message4/benchmark_message4_1.pb.cc \
  262. gogo/cpp_no_group/datasets/google_message4/benchmark_message4_2.pb.cc \
  263. gogo/cpp_no_group/datasets/google_message4/benchmark_message4_3.pb.cc
  264. $(cpp_no_group_benchmarks_protoc_outputs): cpp_no_group_protoc_middleman
  265. $(cpp_no_group_benchmarks_protoc_outputs_header): cpp_no_group_protoc_middleman
  266. $(cpp_no_group_benchmarks_protoc_outputs_proto2): cpp_no_group_protoc_middleman
  267. $(cpp_no_group_benchmarks_protoc_outputs_proto2_header): cpp_no_group_protoc_middleman
  268. generate_cpp_no_group_benchmark_code:
  269. cp $(srcdir)/cpp/cpp_benchmark.cc gogo/cpp_no_group/cpp_benchmark.cc
  270. sed -i -e "s/\#include \"datasets/\#include \"gogo\/cpp_no_group\/datasets/g" gogo/cpp_no_group/cpp_benchmark.cc
  271. sed -i -e "s/\#include \"benchmarks.pb.h/\#include \"gogo\/cpp_no_group\/benchmarks.pb.h/g" gogo/cpp_no_group/cpp_benchmark.cc
  272. touch generate_cpp_no_group_benchmark_code
  273. bin_PROGRAMS += cpp-no-group-benchmark
  274. cpp_no_group_benchmark_LDADD = $(top_srcdir)/src/libprotobuf.la $(top_srcdir)/third_party/benchmark/src/libbenchmark.a
  275. cpp_no_group_benchmark_SOURCES = gogo/cpp_no_group/cpp_benchmark.cc
  276. cpp_no_group_benchmark_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)/gogo/cpp_no_group -I$(top_srcdir)/third_party/benchmark/include
  277. # Explicit deps because BUILT_SOURCES are only done before a "make all/check"
  278. # so a direct "make test_cpp" could fail if parallel enough.
  279. # See: https://www.gnu.org/software/automake/manual/html_node/Built-Sources-Example.html#Recording-Dependencies-manually
  280. gogo/cpp_no_group/cpp_no_group_benchmark-cpp_benchmark.$(OBJEXT): $(cpp_no_group_benchmarks_protoc_outputs) $(cpp_no_group_benchmarks_protoc_outputs_proto2) $(cpp_no_group_benchmarks_protoc_outputs_header) \
  281. $(cpp_no_group_benchmarks_protoc_outputs_proto2_header) $(top_srcdir)/third_party/benchmark/src/libbenchmark.a generate_cpp_no_group_benchmark_code
  282. gogo/cpp_no_group/cpp_benchmark.cc: generate_cpp_no_group_benchmark_code
  283. nodist_cpp_no_group_benchmark_SOURCES = \
  284. $(cpp_no_group_benchmarks_protoc_outputs_proto2) \
  285. $(cpp_no_group_benchmarks_protoc_outputs) \
  286. $(cpp_no_group_benchmarks_protoc_outputs_header) \
  287. $(cpp_no_group_benchmarks_protoc_outputs_proto2_header)
  288. cpp_no_group: cpp_no_group_protoc_middleman generate_gogo_data cpp-no-group-benchmark
  289. ./cpp-no-group-benchmark $(gogo_data)
  290. gogo_proto_middleman: protoc-gen-gogoproto
  291. mkdir -p "tmp/gogo_proto"
  292. oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I$(srcdir) -I$(top_srcdir) --plugin=protoc-gen-gogoproto --gogoproto_out=$$oldpwd/tmp/gogo_proto $(benchmarks_protoc_inputs) $(benchmarks_protoc_inputs_benchmark_wrapper) $(benchmarks_protoc_inputs_proto2) )
  293. touch gogo_proto_middleman
  294. gogo_data = $$(for data in $(all_data); do echo "tmp/gogo_data$${data\#$(srcdir)}"; done | xargs)
  295. generate_gogo_data: protoc_middleman protoc_middleman2 gogo-data-scrubber
  296. mkdir -p `dirname $(gogo_data)`
  297. ./gogo-data-scrubber $(all_data) $(gogo_data)
  298. touch generate_gogo_data
  299. make_tmp_dir_gogo:
  300. mkdir -p tmp/go_no_group/benchmark_code
  301. mkdir -p tmp/gogofast/benchmark_code
  302. mkdir -p tmp/gogofaster/benchmark_code
  303. mkdir -p tmp/gogoslick/benchmark_code
  304. touch make_tmp_dir_gogo
  305. go_no_group_protoc_middleman: make_tmp_dir_gogo $(top_srcdir)/src/protoc$(EXEEXT) gogo_proto_middleman $(well_known_type_protoc_inputs)
  306. oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --go_out=$$oldpwd/tmp/go_no_group $(benchmarks_protoc_inputs) )
  307. oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --go_out=$$oldpwd/tmp/go_no_group $(benchmarks_protoc_inputs_benchmark_wrapper) )
  308. oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --go_out=$$oldpwd/tmp/go_no_group $(benchmarks_protoc_inputs_proto2_message1) )
  309. oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --go_out=$$oldpwd/tmp/go_no_group $(benchmarks_protoc_inputs_proto2_message2) )
  310. oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --go_out=$$oldpwd/tmp/go_no_group $(benchmarks_protoc_inputs_proto2_message3) )
  311. oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --go_out=$$oldpwd/tmp/go_no_group $(benchmarks_protoc_inputs_proto2_message4) )
  312. touch go_no_group_protoc_middleman
  313. cpp_no_group_protoc_middleman: make_tmp_dir_gogo $(top_srcdir)/src/protoc$(EXEEXT) gogo_proto_middleman $(well_known_type_protoc_inputs)
  314. oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --cpp_out=$$oldpwd/gogo/cpp_no_group $(benchmarks_protoc_inputs) )
  315. oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --cpp_out=$$oldpwd/gogo/cpp_no_group $(benchmarks_protoc_inputs_benchmark_wrapper) )
  316. oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --cpp_out=$$oldpwd/gogo/cpp_no_group $(benchmarks_protoc_inputs_proto2_message1) )
  317. oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --cpp_out=$$oldpwd/gogo/cpp_no_group $(benchmarks_protoc_inputs_proto2_message2) )
  318. oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --cpp_out=$$oldpwd/gogo/cpp_no_group $(benchmarks_protoc_inputs_proto2_message3) )
  319. oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --cpp_out=$$oldpwd/gogo/cpp_no_group $(benchmarks_protoc_inputs_proto2_message4) )
  320. touch cpp_no_group_protoc_middleman
  321. gogofast_protoc_middleman: make_tmp_dir_gogo $(top_srcdir)/src/protoc$(EXEEXT) gogo_proto_middleman $(well_known_type_protoc_inputs)
  322. oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofast_out=$$oldpwd/tmp/gogofast $(benchmarks_protoc_inputs) )
  323. oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofast_out=$$oldpwd/tmp/gogofast $(benchmarks_protoc_inputs_benchmark_wrapper) )
  324. oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofast_out=$$oldpwd/tmp/gogofast $(benchmarks_protoc_inputs_proto2_message1) )
  325. oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofast_out=$$oldpwd/tmp/gogofast $(benchmarks_protoc_inputs_proto2_message2) )
  326. oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofast_out=$$oldpwd/tmp/gogofast $(benchmarks_protoc_inputs_proto2_message3) )
  327. oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofast_out=$$oldpwd/tmp/gogofast $(benchmarks_protoc_inputs_proto2_message4) )
  328. touch gogofast_protoc_middleman
  329. gogofaster_protoc_middleman: make_tmp_dir_gogo $(top_srcdir)/src/protoc$(EXEEXT) gogo_proto_middleman $(well_known_type_protoc_inputs)
  330. oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofaster_out=$$oldpwd/tmp/gogofaster $(benchmarks_protoc_inputs) )
  331. oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofaster_out=$$oldpwd/tmp/gogofaster $(benchmarks_protoc_inputs_benchmark_wrapper) )
  332. oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofaster_out=$$oldpwd/tmp/gogofaster $(benchmarks_protoc_inputs_proto2_message1) )
  333. oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofaster_out=$$oldpwd/tmp/gogofaster $(benchmarks_protoc_inputs_proto2_message2) )
  334. oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofaster_out=$$oldpwd/tmp/gogofaster $(benchmarks_protoc_inputs_proto2_message3) )
  335. oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogofaster_out=$$oldpwd/tmp/gogofaster $(benchmarks_protoc_inputs_proto2_message4) )
  336. touch gogofaster_protoc_middleman
  337. gogoslick_protoc_middleman: make_tmp_dir_gogo $(top_srcdir)/src/protoc$(EXEEXT) gogo_proto_middleman $(well_known_type_protoc_inputs)
  338. oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogoslick_out=$$oldpwd/tmp/gogoslick $(benchmarks_protoc_inputs) )
  339. oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogoslick_out=$$oldpwd/tmp/gogoslick $(benchmarks_protoc_inputs_benchmark_wrapper) )
  340. oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogoslick_out=$$oldpwd/tmp/gogoslick $(benchmarks_protoc_inputs_proto2_message1) )
  341. oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogoslick_out=$$oldpwd/tmp/gogoslick $(benchmarks_protoc_inputs_proto2_message2) )
  342. oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogoslick_out=$$oldpwd/tmp/gogoslick $(benchmarks_protoc_inputs_proto2_message3) )
  343. oldpwd=`pwd` && ( cd $(srcdir)/tmp/gogo_proto && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$$oldpwd/$(top_srcdir)/src --gogoslick_out=$$oldpwd/tmp/gogoslick $(benchmarks_protoc_inputs_proto2_message4) )
  344. touch gogoslick_protoc_middleman
  345. generate-gogo-benchmark-code:
  346. @echo '#! /bin/bash' > generate-gogo-benchmark-code
  347. @echo 'cp $(srcdir)/go/go_benchmark_test.go tmp/$$1/benchmark_code/$$1_benchmark1_test.go' >> generate-gogo-benchmark-code
  348. @echo 'sed -i -e "s/\.\.\/tmp/../g" tmp/$$1/benchmark_code/$$1_benchmark1_test.go' >> generate-gogo-benchmark-code
  349. @echo 'sed -i -e "s/b\.Run(\"\(.*\)\"/b.Run(\"\1\_$$1\"/g" tmp/$$1/benchmark_code/$$1_benchmark1_test.go' >> generate-gogo-benchmark-code
  350. @echo 'if [[ $$2 == 1 ]]; then sed -i -e "s/github\.com\/golang/github.com\/gogo/g" tmp/$$1/benchmark_code/$$1_benchmark1_test.go; fi ' >> generate-gogo-benchmark-code
  351. @chmod +x generate-gogo-benchmark-code
  352. generate_all_gogo_benchmark_code: generate-gogo-benchmark-code make_tmp_dir_gogo
  353. ./generate-gogo-benchmark-code go_no_group 0
  354. ./generate-gogo-benchmark-code gogofast 1
  355. ./generate-gogo-benchmark-code gogofaster 1
  356. ./generate-gogo-benchmark-code gogoslick 1
  357. gogo-benchmark:
  358. @echo "Writing shortcut script gogo-benchmark..."
  359. @echo '#! /bin/bash' > gogo-benchmark
  360. @echo 'cd tmp/$$1/benchmark_code' >> gogo-benchmark
  361. @echo 'shift' >> gogo-benchmark
  362. @echo 'all_data=""' >> gogo-benchmark
  363. @echo 'for data_file in $$@; do all_data="$$all_data ../../../$$data_file"; done' >> gogo-benchmark
  364. @echo 'go test -bench=. -- $$all_data' >> gogo-benchmark
  365. @echo 'cd ../..' >> gogo-benchmark
  366. @chmod +x gogo-benchmark
  367. go_no_group: go_no_group_protoc_middleman generate_gogo_data generate_all_gogo_benchmark_code gogo-benchmark
  368. ./gogo-benchmark go_no_group $(gogo_data)
  369. gogofast: gogofast_protoc_middleman generate_gogo_data gogo-benchmark generate_all_gogo_benchmark_code
  370. ./gogo-benchmark gogofast $(gogo_data)
  371. gogofaster: gogofaster_protoc_middleman generate_gogo_data gogo-benchmark generate_all_gogo_benchmark_code
  372. ./gogo-benchmark gogofaster $(gogo_data)
  373. gogoslick: gogoslick_protoc_middleman generate_gogo_data gogo-benchmark generate_all_gogo_benchmark_code
  374. ./gogo-benchmark gogoslick $(gogo_data)
  375. ############# GOGO RULES END ############
  376. ############ UTIL RULES BEGIN ############
  377. bin_PROGRAMS += protoc-gen-gogoproto gogo-data-scrubber protoc-gen-proto2_to_proto3 proto3-data-stripper
  378. protoc_gen_gogoproto_LDADD = $(top_srcdir)/src/libprotobuf.la $(top_srcdir)/src/libprotoc.la
  379. protoc_gen_gogoproto_SOURCES = util/protoc-gen-gogoproto.cc
  380. protoc_gen_gogoproto_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)/cpp -I$(srcdir)/util
  381. gogo_data_scrubber_LDADD = $(top_srcdir)/src/libprotobuf.la
  382. gogo_data_scrubber_SOURCES = util/gogo_data_scrubber.cc
  383. gogo_data_scrubber_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)/cpp -I$(srcdir)/util
  384. util/gogo_data_scrubber-gogo_data_scrubber.$(OBJEXT): $(benchmarks_protoc_outputs) $(benchmarks_protoc_outputs_proto2) $(benchmarks_protoc_outputs_header) $(benchmarks_protoc_outputs_proto2_header)
  385. nodist_gogo_data_scrubber_SOURCES = \
  386. $(benchmarks_protoc_outputs) \
  387. $(benchmarks_protoc_outputs_proto2) \
  388. $(benchmarks_protoc_outputs_proto2_header) \
  389. $(benchmarks_protoc_outputs_header)
  390. protoc_gen_proto2_to_proto3_LDADD = $(top_srcdir)/src/libprotobuf.la $(top_srcdir)/src/libprotoc.la
  391. protoc_gen_proto2_to_proto3_SOURCES = util/protoc-gen-proto2_to_proto3.cc
  392. protoc_gen_proto2_to_proto3_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)/cpp -I$(srcdir)/util
  393. proto3_data_stripper_LDADD = $(top_srcdir)/src/libprotobuf.la
  394. proto3_data_stripper_SOURCES = util/proto3_data_stripper.cc
  395. proto3_data_stripper_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)/cpp -I$(srcdir)/util
  396. util/proto3_data_stripper-proto3_data_stripper.$(OBJEXT): $(benchmarks_protoc_outputs) $(benchmarks_protoc_outputs_proto2) $(benchmarks_protoc_outputs_header) $(benchmarks_protoc_outputs_proto2_header)
  397. nodist_proto3_data_stripper_SOURCES = \
  398. $(benchmarks_protoc_outputs) \
  399. $(benchmarks_protoc_outputs_proto2) \
  400. $(benchmarks_protoc_outputs_proto2_header) \
  401. $(benchmarks_protoc_outputs_header)
  402. ############ UTIL RULES END ############
  403. ############ PROTO3 PREPARATION BEGIN #############
  404. proto3_proto_middleman: protoc-gen-proto2_to_proto3
  405. mkdir -p "tmp/proto3_proto"
  406. oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I$(srcdir) -I$(top_srcdir) --plugin=protoc-gen-proto2_to_proto3 --proto2_to_proto3_out=$$oldpwd/tmp/proto3_proto $(benchmarks_protoc_inputs) $(benchmarks_protoc_inputs_benchmark_wrapper) $(benchmarks_protoc_inputs_proto2) )
  407. touch proto3_proto_middleman
  408. full_srcdir = $$(cd $(srcdir) && pwd)
  409. proto3_data = $$(for data in $(all_data); do echo $(full_srcdir)"/tmp/proto3_data$${data\#$(full_srcdir)}"; done | xargs)
  410. generate_proto3_data: protoc_middleman protoc_middleman2 proto3-data-stripper
  411. mkdir -p `dirname $(proto3_data)`
  412. ./proto3-data-stripper $(all_data) $(proto3_data)
  413. touch generate_proto3_data
  414. ############ PROTO3 PREPARATION END #############
  415. ############ PHP RULES BEGIN #################
  416. proto3_middleman_php: proto3_proto_middleman
  417. mkdir -p "tmp/php"
  418. oldpwd=`pwd` && ( cd tmp/proto3_proto && $$oldpwd/../src/protoc$(EXEEXT) -I$(srcdir) -I$(top_srcdir) --php_out=$$oldpwd/tmp/php $(benchmarks_protoc_inputs) $(benchmarks_protoc_inputs_benchmark_wrapper) $(benchmarks_protoc_inputs_proto2) )
  419. touch proto3_middleman_php
  420. php-benchmark: proto3_middleman_php generate_proto3_data
  421. mkdir -p "tmp/php/Google/Protobuf/Benchmark" && cp php/PhpBenchmark.php "tmp/php/Google/Protobuf/Benchmark"
  422. cp php/autoload.php "tmp/php"
  423. @echo "Writing shortcut script php-benchmark..."
  424. @echo '#! /bin/bash' > php-benchmark
  425. @echo 'export PROTOBUF_PHP_SRCDIR="$$(cd $(top_srcdir) && pwd)/php/src"' >> php-benchmark
  426. @echo 'cd tmp/php' >> php-benchmark
  427. @echo 'export CURRENT_DIR=$$(pwd)' >> php-benchmark
  428. @echo 'php -d auto_prepend_file="autoload.php" -d include_path="$$(pwd)" Google/Protobuf/Benchmark/PhpBenchmark.php $$@' >> php-benchmark
  429. @echo 'cd ../..' >> php-benchmark
  430. @chmod +x php-benchmark
  431. php: php-benchmark proto3_middleman_php
  432. ./php-benchmark --behavior_prefix="php" $(proto3_data)
  433. php_c_extension:
  434. cd $(top_srcdir)/php/ext/google/protobuf && phpize && ./configure CFLAGS='-O3' && make -j8
  435. php-c-benchmark: proto3_middleman_php generate_proto3_data php_c_extension php_c_extension
  436. mkdir -p "tmp/php/Google/Protobuf/Benchmark" && cp php/PhpBenchmark.php "tmp/php/Google/Protobuf/Benchmark"
  437. cp php/autoload.php "tmp/php"
  438. @echo "Writing shortcut script php-c-benchmark..."
  439. @echo '#! /bin/bash' > php-c-benchmark
  440. @echo 'export PROTOBUF_PHP_SRCDIR="$$(cd $(top_srcdir) && pwd)/php/src"' >> php-c-benchmark
  441. @echo 'export PROTOBUF_PHP_EXTDIR="$$PROTOBUF_PHP_SRCDIR/../ext/google/protobuf/modules"' >> php-c-benchmark
  442. @echo 'cd tmp/php' >> php-c-benchmark
  443. @echo 'export CURRENT_DIR=$$(pwd)' >> php-c-benchmark
  444. @echo 'php -d auto_prepend_file="autoload.php" -d include_path="$$(pwd)" -d extension="$$PROTOBUF_PHP_EXTDIR/protobuf.so" Google/Protobuf/Benchmark/PhpBenchmark.php $$@' >> php-c-benchmark
  445. @echo 'cd ../..' >> php-c-benchmark
  446. @chmod +x php-c-benchmark
  447. php_c: php-c-benchmark proto3_middleman_php
  448. ./php-c-benchmark --behavior_prefix="php_c" $(proto3_data)
  449. ############ PHP RULES END #################
  450. ############ protobuf.js RULE BEGIN #############
  451. pbjs_preparation:
  452. mkdir -p tmp/protobuf.js
  453. cd tmp/protobuf.js && git clone https://github.com/dcodeIO/protobuf.js.git && \
  454. cd protobuf.js && npm install && npm run build
  455. cd tmp/protobuf.js && npm install benchmark
  456. cp protobuf.js/* tmp/protobuf.js
  457. cp js/benchmark_suite.js tmp/protobuf.js
  458. touch pbjs_preparation
  459. pbjs_middleman: pbjs_preparation
  460. export OLDDIR=$$(pwd) && cd tmp/protobuf.js && node generate_pbjs_files.js --target static-module --include_path=$$OLDDIR -o generated_bundle_code.js $(benchmarks_protoc_inputs) $(benchmarks_protoc_inputs_benchmark_wrapper) $(benchmarks_protoc_inputs_proto2)
  461. touch pbjs_middleman
  462. pbjs-benchmark: pbjs_middleman
  463. @echo '#! /bin/bash' > pbjs-benchmark
  464. @echo 'cd tmp/protobuf.js' >> pbjs-benchmark
  465. @echo 'sed -i "s/protobufjs/.\/protobuf.js/g" generated_bundle_code.js' >> pbjs-benchmark
  466. @echo 'env NODE_PATH=".:./node_modules:$$NODE_PATH" node protobufjs_benchmark.js $$@' >> pbjs-benchmark
  467. @chmod +x pbjs-benchmark
  468. pbjs: pbjs-benchmark
  469. ./pbjs-benchmark $(all_data)
  470. ############ protobuf.js RULE END #############
  471. ############ JS RULE BEGIN #############
  472. js_preparation:
  473. mkdir -p tmp/js
  474. oldpwd=$$(pwd) && cd $(top_srcdir)/js && npm install && npm test
  475. cd tmp/js && npm install benchmark
  476. cp js/* tmp/js
  477. touch js_preparation
  478. js_middleman: js_preparation
  479. oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --js_out=import_style=commonjs,binary:$$oldpwd/tmp/js $(benchmarks_protoc_inputs) $(benchmarks_protoc_inputs_benchmark_wrapper) $(benchmarks_protoc_inputs_proto2))
  480. touch js_middleman
  481. js-benchmark: js_middleman
  482. @echo '#! /bin/bash' > js-benchmark
  483. @echo 'export TOP_JS_SRCDIR=$$(cd $(top_srcdir)/js && pwd)' >> js-benchmark
  484. @echo 'cd tmp/js' >> js-benchmark
  485. @echo 'env NODE_PATH="$$TOP_JS_SRCDIR:.:./node_modules:$$NODE_PATH" node --max-old-space-size=4096 js_benchmark.js $$@' >> js-benchmark
  486. @chmod +x js-benchmark
  487. js: js-benchmark
  488. ./js-benchmark $(all_data)
  489. ############ JS RULE END #############
  490. EXTRA_DIST = \
  491. $(benchmarks_protoc_inputs_benchmark_wrapper) \
  492. $(benchmarks_protoc_inputs) \
  493. $(benchmarks_protoc_inputs_proto2) \
  494. google_size.proto
  495. MAINTAINERCLEANFILES = \
  496. Makefile.in
  497. CLEANFILES = \
  498. $(benchmarks_protoc_outputs) \
  499. $(benchmarks_protoc_outputs_header) \
  500. $(benchmarks_protoc_outputs_proto2) \
  501. $(benchmarks_protoc_outputs_proto2_header) \
  502. initialize_submodule \
  503. make_tmp_dir \
  504. protoc_middleman \
  505. protoc_middleman2 \
  506. javac_middleman \
  507. java-benchmark \
  508. python_cpp_proto_library \
  509. python-pure-python-benchmark \
  510. python-cpp-reflection-benchmark \
  511. python-cpp-generated-code-benchmark \
  512. go-benchmark \
  513. go_protoc_middleman \
  514. make_tmp_dir_gogo \
  515. gogo_proto_middleman \
  516. generate_gogo_data \
  517. go_no_group_protoc_middleman \
  518. go_no_group \
  519. go-no-group-benchmark \
  520. $(cpp_no_group_benchmarks_protoc_outputs_header) \
  521. $(cpp_no_group_benchmarks_protoc_outputs) \
  522. $(cpp_no_group_benchmarks_protoc_outputs_proto2_header) \
  523. $(cpp_no_group_benchmarks_protoc_outputs_proto2) \
  524. generate_all_gogo_benchmark_code \
  525. generate-gogo-benchmark-code \
  526. cpp_no_group_protoc_middleman \
  527. generate_cpp_no_group_benchmark_code \
  528. generate_gogo_benchmark_code \
  529. gogofast_protoc_middleman \
  530. gogofast \
  531. gogofaster_protoc_middleman \
  532. gogofaster \
  533. gogoslick_protoc_middleman \
  534. gogoslick \
  535. gogo-benchmark \
  536. gogo/cpp_no_group/cpp_benchmark.* \
  537. proto3_proto_middleman \
  538. generate_proto3_data \
  539. php-benchmark \
  540. php-c-benchmark \
  541. proto3_middleman_php \
  542. pbjs_preparation \
  543. pbjs_middleman \
  544. pbjs-benchmark \
  545. js_preparation \
  546. js_middleman \
  547. js-benchmark
  548. clean-local:
  549. -rm -rf tmp/*