Makefile.am 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  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. bin_PROGRAMS = generate-datasets
  15. generate_datasets_LDADD = $(top_srcdir)/src/libprotobuf.la
  16. generate_datasets_SOURCES = generate_datasets.cc
  17. generate_datasets_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)
  18. nodist_generate_datasets_SOURCES = \
  19. $(benchmarks_protoc_outputs) \
  20. $(benchmarks_protoc_outputs_proto2)
  21. # Explicit deps because BUILT_SOURCES are only done before a "make all/check"
  22. # so a direct "make test_cpp" could fail if parallel enough.
  23. # See: https://www.gnu.org/software/automake/manual/html_node/Built-Sources-Example.html#Recording-Dependencies-manually
  24. generate_datasets-generate_datasets.$(OBJEXT): benchmarks.pb.h
  25. $(benchmarks_protoc_outputs): protoc_middleman
  26. $(benchmarks_protoc_outputs_proto2): protoc_middleman2
  27. CLEANFILES = \
  28. $(benchmarks_protoc_outputs) \
  29. $(benchmarks_protoc_outputs_proto2) \
  30. protoc_middleman \
  31. protoc_middleman2 \
  32. dataset.*
  33. MAINTAINERCLEANFILES = \
  34. Makefile.in
  35. if USE_EXTERNAL_PROTOC
  36. protoc_middleman: $(benchmarks_protoc_inputs)
  37. $(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. $(benchmarks_protoc_inputs)
  38. touch protoc_middleman
  39. protoc_middleman2: $(benchmarks_protoc_inputs_proto2)
  40. $(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. $(benchmarks_protoc_inputs_proto2)
  41. touch protoc_middleman2
  42. else
  43. # We have to cd to $(srcdir) before executing protoc because $(protoc_inputs) is
  44. # relative to srcdir, which may not be the same as the current directory when
  45. # building out-of-tree.
  46. protoc_middleman: $(top_srcdir)/src/protoc$(EXEEXT) $(benchmarks_protoc_inputs) $(well_known_type_protoc_inputs)
  47. oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd $(benchmarks_protoc_inputs) )
  48. touch protoc_middleman
  49. protoc_middleman2: $(top_srcdir)/src/protoc$(EXEEXT) $(benchmarks_protoc_inputs_proto2) $(well_known_type_protoc_inputs)
  50. oldpwd=`pwd` && ( cd $(srcdir) && $$oldpwd/../src/protoc$(EXEEXT) -I. -I$(top_srcdir)/src --cpp_out=$$oldpwd $(benchmarks_protoc_inputs_proto2) )
  51. touch protoc_middleman
  52. endif