Makefile.am 20.2 KB
Newer Older
1 2
## Process this file with automake to produce Makefile.in

3
conformance_protoc_inputs =                                    \
4 5
  conformance.proto                                            \
  $(top_srcdir)/src/google/protobuf/test_messages_proto3.proto
6 7

well_known_type_protoc_inputs =                                \
8 9 10 11 12 13 14
  $(top_srcdir)/src/google/protobuf/any.proto                  \
  $(top_srcdir)/src/google/protobuf/duration.proto             \
  $(top_srcdir)/src/google/protobuf/field_mask.proto           \
  $(top_srcdir)/src/google/protobuf/struct.proto               \
  $(top_srcdir)/src/google/protobuf/timestamp.proto            \
  $(top_srcdir)/src/google/protobuf/wrappers.proto

15 16 17 18 19

protoc_outputs =                                               \
  conformance.pb.cc                                            \
  conformance.pb.h

20
other_language_protoc_outputs =                                \
21 22 23
  conformance_pb2.py                                           \
  Conformance.pbobjc.h                                         \
  Conformance.pbobjc.m                                         \
24
  conformance_pb.js                                            \
25
  conformance_pb.rb                                            \
26 27 28 29 30 31 32
  com/google/protobuf/Any.java                                 \
  com/google/protobuf/AnyOrBuilder.java                        \
  com/google/protobuf/AnyProto.java                            \
  com/google/protobuf/BoolValue.java                           \
  com/google/protobuf/BoolValueOrBuilder.java                  \
  com/google/protobuf/BytesValue.java                          \
  com/google/protobuf/BytesValueOrBuilder.java                 \
33
  com/google/protobuf/conformance/Conformance.java             \
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
  com/google/protobuf/DoubleValue.java                         \
  com/google/protobuf/DoubleValueOrBuilder.java                \
  com/google/protobuf/Duration.java                            \
  com/google/protobuf/DurationOrBuilder.java                   \
  com/google/protobuf/DurationProto.java                       \
  com/google/protobuf/FieldMask.java                           \
  com/google/protobuf/FieldMaskOrBuilder.java                  \
  com/google/protobuf/FieldMaskProto.java                      \
  com/google/protobuf/FloatValue.java                          \
  com/google/protobuf/FloatValueOrBuilder.java                 \
  com/google/protobuf/Int32Value.java                          \
  com/google/protobuf/Int32ValueOrBuilder.java                 \
  com/google/protobuf/Int64Value.java                          \
  com/google/protobuf/Int64ValueOrBuilder.java                 \
  com/google/protobuf/ListValue.java                           \
  com/google/protobuf/ListValueOrBuilder.java                  \
  com/google/protobuf/NullValue.java                           \
  com/google/protobuf/StringValue.java                         \
  com/google/protobuf/StringValueOrBuilder.java                \
  com/google/protobuf/Struct.java                              \
  com/google/protobuf/StructOrBuilder.java                     \
  com/google/protobuf/StructProto.java                         \
  com/google/protobuf/Timestamp.java                           \
  com/google/protobuf/TimestampOrBuilder.java                  \
  com/google/protobuf/TimestampProto.java                      \
  com/google/protobuf/UInt32Value.java                         \
  com/google/protobuf/UInt32ValueOrBuilder.java                \
  com/google/protobuf/UInt64Value.java                         \
  com/google/protobuf/UInt64ValueOrBuilder.java                \
  com/google/protobuf/Value.java                               \
  com/google/protobuf/ValueOrBuilder.java                      \
  com/google/protobuf/WrappersProto.java                       \
66
  com/google/protobuf_test_messages/proto3/TestMessagesProto3.java \
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
  google/protobuf/any.pb.cc                                    \
  google/protobuf/any.pb.h                                     \
  google/protobuf/any.rb                                       \
  google/protobuf/any_pb2.py                                   \
  google/protobuf/duration.pb.cc                               \
  google/protobuf/duration.pb.h                                \
  google/protobuf/duration.rb                                  \
  google/protobuf/duration_pb2.py                              \
  google/protobuf/field_mask.pb.cc                             \
  google/protobuf/field_mask.pb.h                              \
  google/protobuf/field_mask.rb                                \
  google/protobuf/field_mask_pb2.py                            \
  google/protobuf/struct.pb.cc                                 \
  google/protobuf/struct.pb.h                                  \
  google/protobuf/struct.rb                                    \
  google/protobuf/struct_pb2.py                                \
83 84 85 86 87 88
  google/protobuf/TestMessagesProto3.pbobjc.h                  \
  google/protobuf/TestMessagesProto3.pbobjc.m                  \
  google/protobuf/test_messages_proto3.pb.cc                   \
  google/protobuf/test_messages_proto3.pb.h                    \
  google/protobuf/test_messages_proto3_pb.rb                   \
  google/protobuf/test_messages_proto3_pb2.py                  \
89 90 91 92 93 94 95
  google/protobuf/timestamp.pb.cc                              \
  google/protobuf/timestamp.pb.h                               \
  google/protobuf/timestamp.rb                                 \
  google/protobuf/timestamp_pb2.py                             \
  google/protobuf/wrappers.pb.cc                               \
  google/protobuf/wrappers.pb.h                                \
  google/protobuf/wrappers.rb                                  \
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129
  google/protobuf/wrappers_pb2.py                              \
  Conformance/ConformanceRequest.php                           \
  Conformance/ConformanceResponse.php                          \
  Conformance/WireFormat.php                                   \
  GPBMetadata/Conformance.php                                  \
  GPBMetadata/Google/Protobuf/Any.php                          \
  GPBMetadata/Google/Protobuf/Duration.php                     \
  GPBMetadata/Google/Protobuf/FieldMask.php                    \
  GPBMetadata/Google/Protobuf/Struct.php                       \
  GPBMetadata/Google/Protobuf/TestMessagesProto3.php           \
  GPBMetadata/Google/Protobuf/Timestamp.php                    \
  GPBMetadata/Google/Protobuf/Wrappers.php                     \
  Google/Protobuf/Any.php                                      \
  Google/Protobuf/BoolValue.php                                \
  Google/Protobuf/BytesValue.php                               \
  Google/Protobuf/DoubleValue.php                              \
  Google/Protobuf/Duration.php                                 \
  Google/Protobuf/FieldMask.php                                \
  Google/Protobuf/FloatValue.php                               \
  Google/Protobuf/Int32Value.php                               \
  Google/Protobuf/Int64Value.php                               \
  Google/Protobuf/ListValue.php                                \
  Google/Protobuf/NullValue.php                                \
  Google/Protobuf/StringValue.php                              \
  Google/Protobuf/Struct.php                                   \
  Google/Protobuf/Timestamp.php                                \
  Google/Protobuf/UInt32Value.php                              \
  Google/Protobuf/UInt64Value.php                              \
  Google/Protobuf/Value.php                                    \
  Protobuf_test_messages/Proto3/ForeignEnum.php                \
  Protobuf_test_messages/Proto3/ForeignMessage.php             \
  Protobuf_test_messages/Proto3/TestAllTypes_NestedEnum.php    \
  Protobuf_test_messages/Proto3/TestAllTypes_NestedMessage.php \
  Protobuf_test_messages/Proto3/TestAllTypes.php
130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
  # lite/com/google/protobuf/Any.java                            \
  # lite/com/google/protobuf/AnyOrBuilder.java                   \
  # lite/com/google/protobuf/AnyProto.java                       \
  # lite/com/google/protobuf/BoolValue.java                      \
  # lite/com/google/protobuf/BoolValueOrBuilder.java             \
  # lite/com/google/protobuf/BytesValue.java                     \
  # lite/com/google/protobuf/BytesValueOrBuilder.java            \
  # lite/com/google/protobuf/conformance/Conformance.java        \
  # lite/com/google/protobuf/DoubleValue.java                    \
  # lite/com/google/protobuf/DoubleValueOrBuilder.java           \
  # lite/com/google/protobuf/Duration.java                       \
  # lite/com/google/protobuf/DurationOrBuilder.java              \
  # lite/com/google/protobuf/DurationProto.java                  \
  # lite/com/google/protobuf/FieldMask.java                      \
  # lite/com/google/protobuf/FieldMaskOrBuilder.java             \
  # lite/com/google/protobuf/FieldMaskProto.java                 \
  # lite/com/google/protobuf/FloatValue.java                     \
  # lite/com/google/protobuf/FloatValueOrBuilder.java            \
  # lite/com/google/protobuf/Int32Value.java                     \
  # lite/com/google/protobuf/Int32ValueOrBuilder.java            \
  # lite/com/google/protobuf/Int64Value.java                     \
  # lite/com/google/protobuf/Int64ValueOrBuilder.java            \
  # lite/com/google/protobuf/ListValue.java                      \
  # lite/com/google/protobuf/ListValueOrBuilder.java             \
  # lite/com/google/protobuf/NullValue.java                      \
  # lite/com/google/protobuf/StringValue.java                    \
  # lite/com/google/protobuf/StringValueOrBuilder.java           \
  # lite/com/google/protobuf/Struct.java                         \
  # lite/com/google/protobuf/StructOrBuilder.java                \
  # lite/com/google/protobuf/StructProto.java                    \
  # lite/com/google/protobuf/Timestamp.java                      \
  # lite/com/google/protobuf/TimestampOrBuilder.java             \
  # lite/com/google/protobuf/TimestampProto.java                 \
  # lite/com/google/protobuf/UInt32Value.java                    \
  # lite/com/google/protobuf/UInt32ValueOrBuilder.java           \
  # lite/com/google/protobuf/UInt64Value.java                    \
  # lite/com/google/protobuf/UInt64ValueOrBuilder.java           \
  # lite/com/google/protobuf/Value.java                          \
  # lite/com/google/protobuf/ValueOrBuilder.java                 \
  # lite/com/google/protobuf/WrappersProto.java
170

171
bin_PROGRAMS = conformance-test-runner conformance-cpp
172

173 174 175 176 177
# All source files excepet C++/Objective-C ones should be explicitly listed
# here because the autoconf tools don't include files of other languages
# automatically.
EXTRA_DIST =                  \
  ConformanceJava.java        \
178
  ConformanceJavaLite.java    \
179 180 181 182
  README.md                   \
  conformance.proto           \
  conformance_python.py       \
  conformance_ruby.rb         \
183
  conformance_php.php         \
184 185 186
  failure_list_cpp.txt        \
  failure_list_csharp.txt     \
  failure_list_java.txt       \
187
  failure_list_js.txt         \
188 189 190
  failure_list_objc.txt       \
  failure_list_python.txt     \
  failure_list_python_cpp.txt \
191
  failure_list_python-post26.txt \
192 193 194
  failure_list_ruby.txt       \
  failure_list_php.txt        \
  failure_list_php_c.txt
195

196
conformance_test_runner_LDADD = $(top_srcdir)/src/libprotobuf.la
197 198 199
conformance_test_runner_SOURCES = conformance_test.h conformance_test.cc \
                                  conformance_test_runner.cc             \
                                  third_party/jsoncpp/json.h             \
200
                                  third_party/jsoncpp/jsoncpp.cpp
201
nodist_conformance_test_runner_SOURCES = conformance.pb.cc google/protobuf/test_messages_proto3.pb.cc
202
conformance_test_runner_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)
203
conformance_test_runner_CXXFLAGS = -std=c++11
204 205 206 207
# Explicit deps beacuse BUILT_SOURCES are only done before a "make all/check"
# so a direct "make test_cpp" could fail if parallel enough.
conformance_test_runner-conformance_test.$(OBJEXT): conformance.pb.h
conformance_test_runner-conformance_test_runner.$(OBJEXT): conformance.pb.h
208 209 210

conformance_cpp_LDADD = $(top_srcdir)/src/libprotobuf.la
conformance_cpp_SOURCES = conformance_cpp.cc
211
nodist_conformance_cpp_SOURCES = conformance.pb.cc google/protobuf/test_messages_proto3.pb.cc
212
conformance_cpp_CPPFLAGS = -I$(top_srcdir)/src
213 214 215 216 217 218 219 220 221
# Explicit dep beacuse BUILT_SOURCES are only done before a "make all/check"
# so a direct "make test_cpp" could fail if parallel enough.
conformance_cpp-conformance_cpp.$(OBJEXT): conformance.pb.h

if OBJC_CONFORMANCE_TEST

bin_PROGRAMS += conformance-objc

conformance_objc_SOURCES = conformance_objc.m ../objectivec/GPBProtocolBuffers.m
222
nodist_conformance_objc_SOURCES = Conformance.pbobjc.m google/protobuf/TestMessagesProto3.pbobjc.m
223 224 225 226 227
# On travis, the build fails without the isysroot because whatever system
# headers are being found don't include generics support for
# NSArray/NSDictionary, the only guess is their image at one time had an odd
# setup for Xcode and old frameworks are being found.
conformance_objc_CPPFLAGS = -I$(top_srcdir)/objectivec -isysroot `xcrun --sdk macosx --show-sdk-path`
228 229 230
conformance_objc_LDFLAGS = -framework Foundation
# Explicit dep beacuse BUILT_SOURCES are only done before a "make all/check"
# so a direct "make test_objc" could fail if parallel enough.
231
conformance_objc-conformance_objc.$(OBJEXT): Conformance.pbobjc.h google/protobuf/TestMessagesProto3.pbobjc.h
232 233

endif
234

235 236 237 238 239 240 241
# JavaScript well-known types are expected to be in a directory called
# google-protobuf, because they are usually in the google-protobuf npm
# package.  But we want to use the sources from our tree, so we recreate
# that directory structure here.
google-protobuf:
	mkdir google-protobuf

242 243
if USE_EXTERNAL_PROTOC

244
# Some implementations include pre-generated versions of well-known types.
245
protoc_middleman: $(conformance_protoc_inputs) $(well_known_type_protoc_inputs) google-protobuf
246
	$(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)
247
	$(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)
248
	## $(PROTOC) -I$(srcdir) -I$(top_srcdir) --java_out=lite:lite $(conformance_protoc_inputs) $(well_known_type_protoc_inputs)
249
	touch protoc_middleman
250 251 252 253 254 255

else

# We have to cd to $(srcdir) before executing protoc because $(protoc_inputs) is
# relative to srcdir, which may not be the same as the current directory when
# building out-of-tree.
256
protoc_middleman: $(top_srcdir)/src/protoc$(EXEEXT) $(conformance_protoc_inputs) $(well_known_type_protoc_inputs) google-protobuf
257
	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) )
258
	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) )
259 260
	## @mkdir -p lite
	## 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) )
261
	touch protoc_middleman
262 263 264

endif

265
$(protoc_outputs): protoc_middleman
266

267 268
$(other_language_protoc_outputs): protoc_middleman

269
BUILT_SOURCES = $(protoc_outputs) $(other_language_protoc_outputs)
270

271
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)
272 273 274 275

MAINTAINERCLEANFILES =   \
  Makefile.in

276
javac_middleman: ConformanceJava.java protoc_middleman $(other_language_protoc_outputs)
277
	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
278 279 280 281 282
	@touch javac_middleman

conformance-java: javac_middleman
	@echo "Writing shortcut script conformance-java..."
	@echo '#! /bin/sh' > conformance-java
283
	@jar=`ls ../java/util/target/*jar-with-dependencies.jar` && echo java -classpath .:../java/target/classes:$$jar ConformanceJava '$$@' >> conformance-java
284 285
	@chmod +x conformance-java

286 287 288 289 290 291 292 293 294 295
javac_middleman_lite: ConformanceJavaLite.java protoc_middleman $(other_language_protoc_outputs)
	javac -classpath ../java/lite/target/classes:lite ConformanceJavaLite.java lite/com/google/protobuf/conformance/Conformance.java
	@touch javac_middleman_lite

conformance-java-lite: javac_middleman_lite
	@echo "Writing shortcut script conformance-java-lite..."
	@echo '#! /bin/sh' > conformance-java-lite
	@echo java -classpath .:../java/lite/target/classes:lite ConformanceJavaLite '$$@' >> conformance-java-lite
	@chmod +x conformance-java-lite

296 297 298
# Currently the conformance code is alongside the rest of the C#
# source, as it's easier to maintain there. We assume we've already
# built that, so we just need a script to run it.
299
conformance-csharp: $(other_language_protoc_outputs)
300 301
	@echo "Writing shortcut script conformance-csharp..."
	@echo '#! /bin/sh' > conformance-csharp
302
	@echo 'dotnet ../csharp/src/Google.Protobuf.Conformance/bin/Release/netcoreapp1.0/Google.Protobuf.Conformance.dll "$$@"' >> conformance-csharp
303 304
	@chmod +x conformance-csharp

305 306 307 308 309 310 311 312 313 314 315 316
conformance-php:
	@echo "Writing shortcut script conformance-php..."
	@echo '#! /bin/sh' > conformance-php
	@echo 'php  ./conformance_php.php' >> conformance-php
	@chmod +x conformance-php

conformance-php-c:
	@echo "Writing shortcut script conformance-php-c..."
	@echo '#! /bin/sh' > conformance-php-c
	@echo 'php -dextension=../php/ext/google/protobuf/modules/protobuf.so ./conformance_php.php' >> conformance-php-c
	@chmod +x conformance-php-c

317
# Targets for actually running tests.
318
test_cpp: protoc_middleman conformance-test-runner conformance-cpp
Bo Yang's avatar
Bo Yang committed
319
	./conformance-test-runner --enforce_recommended --failure_list failure_list_cpp.txt ./conformance-cpp
320 321

test_java: protoc_middleman conformance-test-runner conformance-java
Bo Yang's avatar
Bo Yang committed
322
	./conformance-test-runner --enforce_recommended --failure_list failure_list_java.txt ./conformance-java
323

324
test_java_lite: protoc_middleman conformance-test-runner conformance-java-lite
Bo Yang's avatar
Bo Yang committed
325
	./conformance-test-runner --enforce_recommended ./conformance-java-lite
326

327
test_csharp: protoc_middleman conformance-test-runner conformance-csharp
Bo Yang's avatar
Bo Yang committed
328
	./conformance-test-runner --enforce_recommended --failure_list failure_list_csharp.txt ./conformance-csharp
329

330
test_ruby: protoc_middleman conformance-test-runner $(other_language_protoc_outputs)
Bo Yang's avatar
Bo Yang committed
331
	RUBYLIB=../ruby/lib:. ./conformance-test-runner --enforce_recommended --failure_list failure_list_ruby.txt ./conformance_ruby.rb
332

333 334 335 336 337 338
test_php: protoc_middleman conformance-test-runner conformance-php $(other_language_protoc_outputs)
	./conformance-test-runner --enforce_recommended --failure_list failure_list_php.txt ./conformance-php

test_php_c: protoc_middleman conformance-test-runner conformance-php-c $(other_language_protoc_outputs)
	./conformance-test-runner --enforce_recommended --failure_list failure_list_php_c.txt ./conformance-php-c

339 340 341
# These depend on library paths being properly set up.  The easiest way to
# run them is to just use "tox" from the python dir.
test_python: protoc_middleman conformance-test-runner
Bo Yang's avatar
Bo Yang committed
342
	./conformance-test-runner --enforce_recommended --failure_list failure_list_python.txt ./conformance_python.py
343 344

test_python_cpp: protoc_middleman conformance-test-runner
Bo Yang's avatar
Bo Yang committed
345
	./conformance-test-runner --enforce_recommended --failure_list failure_list_python_cpp.txt ./conformance_python.py
346

347
test_nodejs: protoc_middleman conformance-test-runner $(other_language_protoc_outputs)
348
	NODE_PATH=../js:. ./conformance-test-runner --enforce_recommended --failure_list failure_list_js.txt ./conformance_nodejs.js
349

350 351 352
if OBJC_CONFORMANCE_TEST

test_objc: protoc_middleman conformance-test-runner conformance-objc
353
	./conformance-test-runner --enforce_recommended --failure_list failure_list_objc.txt ./conformance-objc
354 355

endif