Makefile.am 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. benchmarks_protoc_inputs = \
  2. benchmarks.proto \
  3. benchmark_messages_proto3.proto
  4. benchmarks_protoc_inputs_proto2 = \
  5. benchmark_messages_proto2.proto
  6. benchmarks_protoc_outputs = \
  7. benchmarks.pb.cc \
  8. benchmarks.pb.h \
  9. benchmark_messages_proto3.pb.cc \
  10. benchmark_messages_proto3.pb.h
  11. benchmarks_protoc_outputs_proto2 = \
  12. benchmark_messages_proto2.pb.cc \
  13. benchmark_messages_proto2.pb.h
  14. AM_CXXFLAGS = $(NO_OPT_CXXFLAGS) $(PROTOBUF_OPT_FLAG) -Wall -Wwrite-strings -Woverloaded-virtual -Wno-sign-compare
  15. bin_PROGRAMS = generate-datasets cpp-benchmark
  16. generate_datasets_LDADD = $(top_srcdir)/src/libprotobuf.la
  17. generate_datasets_SOURCES = generate_datasets.cc
  18. generate_datasets_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)
  19. nodist_generate_datasets_SOURCES = \
  20. $(benchmarks_protoc_outputs) \
  21. $(benchmarks_protoc_outputs_proto2)
  22. # Explicit deps because BUILT_SOURCES are only done before a "make all/check"
  23. # so a direct "make test_cpp" could fail if parallel enough.
  24. # See: https://www.gnu.org/software/automake/manual/html_node/Built-Sources-Example.html#Recording-Dependencies-manually
  25. generate_datasets-generate_datasets.$(OBJEXT): benchmarks.pb.h
  26. cpp_benchmark_LDADD = $(top_srcdir)/src/libprotobuf.la $(top_srcdir)/third_party/benchmark/src/libbenchmark.a
  27. cpp_benchmark_SOURCES = cpp_benchmark.cc
  28. cpp_benchmark_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir) -I$(top_srcdir)/third_party/benchmark/include
  29. nodist_cpp_benchmark_SOURCES = \
  30. $(benchmarks_protoc_outputs) \
  31. $(benchmarks_protoc_outputs_proto2)
  32. $(benchmarks_protoc_outputs): protoc_middleman
  33. $(benchmarks_protoc_outputs_proto2): protoc_middleman2
  34. CLEANFILES = \
  35. $(benchmarks_protoc_outputs) \
  36. $(benchmarks_protoc_outputs_proto2) \
  37. protoc_middleman \
  38. protoc_middleman2 \
  39. dataset.*
  40. MAINTAINERCLEANFILES = \
  41. Makefile.in
  42. if USE_EXTERNAL_PROTOC
  43. protoc_middleman: $(benchmarks_protoc_inputs)
  44. $(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. $(benchmarks_protoc_inputs)
  45. touch protoc_middleman
  46. protoc_middleman2: $(benchmarks_protoc_inputs_proto2)
  47. $(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. $(benchmarks_protoc_inputs_proto2)
  48. touch protoc_middleman2
  49. else
  50. # We have to cd to $(srcdir) before executing protoc because $(protoc_inputs) is
  51. # relative to srcdir, which may not be the same as the current directory when
  52. # building out-of-tree.
  53. protoc_middleman: $(top_srcdir)/src/protoc$(EXEEXT) $(benchmarks_protoc_inputs) $(well_known_type_protoc_inputs)
  54. oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd $(benchmarks_protoc_inputs) )
  55. touch protoc_middleman
  56. protoc_middleman2: $(top_srcdir)/src/protoc$(EXEEXT) $(benchmarks_protoc_inputs_proto2) $(well_known_type_protoc_inputs)
  57. oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd $(benchmarks_protoc_inputs_proto2) )
  58. touch protoc_middleman
  59. endif