Brian Silverman | 9c614bc | 2016-02-15 20:20:02 -0500 | [diff] [blame^] | 1 | ## Process this file with automake to produce Makefile.in |
| 2 | |
| 3 | conformance_protoc_inputs = \ |
| 4 | conformance.proto |
| 5 | |
| 6 | well_known_type_protoc_inputs = \ |
| 7 | $(top_srcdir)/src/google/protobuf/any.proto \ |
| 8 | $(top_srcdir)/src/google/protobuf/duration.proto \ |
| 9 | $(top_srcdir)/src/google/protobuf/field_mask.proto \ |
| 10 | $(top_srcdir)/src/google/protobuf/struct.proto \ |
| 11 | $(top_srcdir)/src/google/protobuf/timestamp.proto \ |
| 12 | $(top_srcdir)/src/google/protobuf/wrappers.proto |
| 13 | |
| 14 | |
| 15 | protoc_outputs = \ |
| 16 | conformance.pb.cc \ |
| 17 | conformance.pb.h |
| 18 | |
| 19 | other_language_protoc_outputs = \ |
| 20 | conformance.rb \ |
| 21 | com/google/protobuf/conformance/Conformance.java \ |
| 22 | conformance_pb2.py \ |
| 23 | Conformance.pbobjc.h \ |
| 24 | Conformance.pbobjc.m |
| 25 | |
| 26 | bin_PROGRAMS = conformance-test-runner conformance-cpp |
| 27 | |
| 28 | # All source files excepet C++/Objective-C ones should be explicitly listed |
| 29 | # here because the autoconf tools don't include files of other languages |
| 30 | # automatically. |
| 31 | EXTRA_DIST = \ |
| 32 | ConformanceJava.java \ |
| 33 | README.md \ |
| 34 | conformance.proto \ |
| 35 | conformance_python.py \ |
| 36 | conformance_ruby.rb \ |
| 37 | failure_list_cpp.txt \ |
| 38 | failure_list_csharp.txt \ |
| 39 | failure_list_java.txt \ |
| 40 | failure_list_objc.txt \ |
| 41 | failure_list_python.txt \ |
| 42 | failure_list_python_cpp.txt \ |
| 43 | failure_list_python-post26.txt \ |
| 44 | failure_list_ruby.txt |
| 45 | |
| 46 | conformance_test_runner_LDADD = $(top_srcdir)/src/libprotobuf.la |
| 47 | conformance_test_runner_SOURCES = conformance_test.h conformance_test.cc \ |
| 48 | conformance_test_runner.cc \ |
| 49 | third_party/jsoncpp/json.h \ |
| 50 | third_party/jsoncpp/jsoncpp.cpp |
| 51 | nodist_conformance_test_runner_SOURCES = conformance.pb.cc |
| 52 | conformance_test_runner_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir) |
| 53 | conformance_test_runner_CXXFLAGS = -std=c++11 |
| 54 | # Explicit deps beacuse BUILT_SOURCES are only done before a "make all/check" |
| 55 | # so a direct "make test_cpp" could fail if parallel enough. |
| 56 | conformance_test_runner-conformance_test.$(OBJEXT): conformance.pb.h |
| 57 | conformance_test_runner-conformance_test_runner.$(OBJEXT): conformance.pb.h |
| 58 | |
| 59 | conformance_cpp_LDADD = $(top_srcdir)/src/libprotobuf.la |
| 60 | conformance_cpp_SOURCES = conformance_cpp.cc |
| 61 | nodist_conformance_cpp_SOURCES = conformance.pb.cc |
| 62 | conformance_cpp_CPPFLAGS = -I$(top_srcdir)/src |
| 63 | # Explicit dep beacuse BUILT_SOURCES are only done before a "make all/check" |
| 64 | # so a direct "make test_cpp" could fail if parallel enough. |
| 65 | conformance_cpp-conformance_cpp.$(OBJEXT): conformance.pb.h |
| 66 | |
| 67 | if OBJC_CONFORMANCE_TEST |
| 68 | |
| 69 | bin_PROGRAMS += conformance-objc |
| 70 | |
| 71 | conformance_objc_SOURCES = conformance_objc.m ../objectivec/GPBProtocolBuffers.m |
| 72 | nodist_conformance_objc_SOURCES = Conformance.pbobjc.m |
| 73 | # On travis, the build fails without the isysroot because whatever system |
| 74 | # headers are being found don't include generics support for |
| 75 | # NSArray/NSDictionary, the only guess is their image at one time had an odd |
| 76 | # setup for Xcode and old frameworks are being found. |
| 77 | conformance_objc_CPPFLAGS = -I$(top_srcdir)/objectivec -isysroot `xcrun --sdk macosx --show-sdk-path` |
| 78 | conformance_objc_LDFLAGS = -framework Foundation |
| 79 | # Explicit dep beacuse BUILT_SOURCES are only done before a "make all/check" |
| 80 | # so a direct "make test_objc" could fail if parallel enough. |
| 81 | conformance_objc-conformance_objc.$(OBJEXT): Conformance.pbobjc.h |
| 82 | |
| 83 | endif |
| 84 | |
| 85 | if USE_EXTERNAL_PROTOC |
| 86 | |
| 87 | # Some implementations include pre-generated versions of well-known types. |
| 88 | protoc_middleman: $(conformance_protoc_inputs) $(well_known_type_protoc_inputs) |
| 89 | $(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. --java_out=. --ruby_out=. --objc_out=. --python_out=. $(conformance_protoc_inputs) |
| 90 | $(PROTOC) -I$(srcdir) -I$(top_srcdir) --cpp_out=. --java_out=. --ruby_out=. --python_out=. $(well_known_type_protoc_inputs) |
| 91 | touch protoc_middleman |
| 92 | |
| 93 | else |
| 94 | |
| 95 | # We have to cd to $(srcdir) before executing protoc because $(protoc_inputs) is |
| 96 | # relative to srcdir, which may not be the same as the current directory when |
| 97 | # building out-of-tree. |
| 98 | protoc_middleman: $(top_srcdir)/src/protoc$(EXEEXT) $(conformance_protoc_inputs) $(well_known_type_protoc_inputs) |
| 99 | 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 $(conformance_protoc_inputs) ) |
| 100 | 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 $(well_known_type_protoc_inputs) ) |
| 101 | touch protoc_middleman |
| 102 | |
| 103 | endif |
| 104 | |
| 105 | $(protoc_outputs): protoc_middleman |
| 106 | |
| 107 | $(other_language_protoc_outputs): protoc_middleman |
| 108 | |
| 109 | BUILT_SOURCES = $(protoc_outputs) $(other_language_protoc_outputs) |
| 110 | |
| 111 | CLEANFILES = $(protoc_outputs) protoc_middleman javac_middleman conformance-java conformance-csharp $(other_language_protoc_outputs) |
| 112 | |
| 113 | MAINTAINERCLEANFILES = \ |
| 114 | Makefile.in |
| 115 | |
| 116 | javac_middleman: ConformanceJava.java protoc_middleman $(other_language_protoc_outputs) |
| 117 | jar=`ls ../java/util/target/*jar-with-dependencies.jar` && javac -classpath ../java/target/classes:$$jar ConformanceJava.java com/google/protobuf/conformance/Conformance.java |
| 118 | @touch javac_middleman |
| 119 | |
| 120 | conformance-java: javac_middleman |
| 121 | @echo "Writing shortcut script conformance-java..." |
| 122 | @echo '#! /bin/sh' > conformance-java |
| 123 | @jar=`ls ../java/util/target/*jar-with-dependencies.jar` && echo java -classpath .:../java/target/classes:$$jar ConformanceJava '$$@' >> conformance-java |
| 124 | @chmod +x conformance-java |
| 125 | |
| 126 | # Currently the conformance code is alongside the rest of the C# |
| 127 | # source, as it's easier to maintain there. We assume we've already |
| 128 | # built that, so we just need a script to run it. |
| 129 | conformance-csharp: $(other_language_protoc_outputs) |
| 130 | @echo "Writing shortcut script conformance-csharp..." |
| 131 | @echo '#! /bin/sh' > conformance-csharp |
| 132 | @echo 'mono ../csharp/src/Google.Protobuf.Conformance/bin/Release/Google.Protobuf.Conformance.exe "$$@"' >> conformance-csharp |
| 133 | @chmod +x conformance-csharp |
| 134 | |
| 135 | # Targets for actually running tests. |
| 136 | test_cpp: protoc_middleman conformance-test-runner conformance-cpp |
| 137 | ./conformance-test-runner --failure_list failure_list_cpp.txt ./conformance-cpp |
| 138 | |
| 139 | test_java: protoc_middleman conformance-test-runner conformance-java |
| 140 | ./conformance-test-runner --failure_list failure_list_java.txt ./conformance-java |
| 141 | |
| 142 | test_csharp: protoc_middleman conformance-test-runner conformance-csharp |
| 143 | ./conformance-test-runner --failure_list failure_list_csharp.txt ./conformance-csharp |
| 144 | |
| 145 | test_ruby: protoc_middleman conformance-test-runner $(other_language_protoc_outputs) |
| 146 | RUBYLIB=../ruby/lib:. ./conformance-test-runner --failure_list failure_list_ruby.txt ./conformance_ruby.rb |
| 147 | |
| 148 | # These depend on library paths being properly set up. The easiest way to |
| 149 | # run them is to just use "tox" from the python dir. |
| 150 | test_python: protoc_middleman conformance-test-runner |
| 151 | ./conformance-test-runner --failure_list failure_list_python.txt $(CONFORMANCE_PYTHON_EXTRA_FAILURES) ./conformance_python.py |
| 152 | |
| 153 | test_python_cpp: protoc_middleman conformance-test-runner |
| 154 | ./conformance-test-runner --failure_list failure_list_python_cpp.txt $(CONFORMANCE_PYTHON_EXTRA_FAILURES) ./conformance_python.py |
| 155 | |
| 156 | if OBJC_CONFORMANCE_TEST |
| 157 | |
| 158 | test_objc: protoc_middleman conformance-test-runner conformance-objc |
| 159 | ./conformance-test-runner --failure_list failure_list_objc.txt ./conformance-objc |
| 160 | |
| 161 | endif |