Nobuaki Sukegawa | 88c5ee7 | 2016-09-04 18:49:18 +0900 | [diff] [blame^] | 1 | # |
| 2 | # Licensed to the Apache Software Foundation (ASF) under one |
| 3 | # or more contributor license agreements. See the NOTICE file |
| 4 | # distributed with this work for additional information |
| 5 | # regarding copyright ownership. The ASF licenses this file |
| 6 | # to you under the Apache License, Version 2.0 (the |
| 7 | # "License"); you may not use this file except in compliance |
| 8 | # with the License. You may obtain a copy of the License at |
| 9 | # |
| 10 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | # |
| 12 | # Unless required by applicable law or agreed to in writing, |
| 13 | # software distributed under the License is distributed on an |
| 14 | # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| 15 | # KIND, either express or implied. See the License for the |
| 16 | # specific language governing permissions and limitations |
| 17 | # under the License. |
| 18 | # |
| 19 | |
| 20 | GENERATED = \ |
| 21 | gen-csharp/Thrift/Test/Bonk.cs \ |
| 22 | gen-csharp/Thrift/Test/Bools.cs \ |
| 23 | gen-csharp/Thrift/Test/BoolTest.cs \ |
| 24 | gen-csharp/Thrift/Test/CrazyNesting.cs \ |
| 25 | gen-csharp/Thrift/Test/EmptyStruct.cs \ |
| 26 | gen-csharp/Thrift/Test/GuessProtocolStruct.cs \ |
| 27 | gen-csharp/Thrift/Test/Insanity.cs \ |
| 28 | gen-csharp/Thrift/Test/LargeDeltas.cs \ |
| 29 | gen-csharp/Thrift/Test/ListBonks.cs \ |
| 30 | gen-csharp/Thrift/Test/ListTypeVersioningV1.cs \ |
| 31 | gen-csharp/Thrift/Test/ListTypeVersioningV2.cs \ |
| 32 | gen-csharp/Thrift/Test/NestedListsBonk.cs \ |
| 33 | gen-csharp/Thrift/Test/NestedListsI32x2.cs \ |
| 34 | gen-csharp/Thrift/Test/NestedListsI32x3.cs \ |
| 35 | gen-csharp/Thrift/Test/NestedMixedx2.cs \ |
| 36 | gen-csharp/Thrift/Test/Numberz.cs \ |
| 37 | gen-csharp/Thrift/Test/OneField.cs \ |
| 38 | gen-csharp/Thrift/Test/SecondService.cs \ |
| 39 | gen-csharp/Thrift/Test/StructA.cs \ |
| 40 | gen-csharp/Thrift/Test/StructB.cs \ |
| 41 | gen-csharp/Thrift/Test/ThriftTest.Constants.cs \ |
| 42 | gen-csharp/Thrift/Test/ThriftTest.cs \ |
| 43 | gen-csharp/Thrift/Test/VersioningTestV1.cs \ |
| 44 | gen-csharp/Thrift/Test/VersioningTestV2.cs \ |
| 45 | gen-csharp/Thrift/Test/Xception.cs \ |
| 46 | gen-csharp/Thrift/Test/Xception2.cs \ |
| 47 | gen-csharp/Thrift/Test/Xtruct.cs \ |
| 48 | gen-csharp/Thrift/Test/Xtruct2.cs \ |
| 49 | gen-csharp/Thrift/Test/Xtruct3.cs |
| 50 | |
| 51 | BUILT_SOURCES = $(GENERATED) |
| 52 | |
| 53 | if MONO_MCS |
| 54 | CSC = mcs |
| 55 | else |
| 56 | CSC = gmcs |
| 57 | endif |
| 58 | |
| 59 | if NET_2_0 |
| 60 | CSC_DEFINES = -d:NET_2_0 |
| 61 | endif |
| 62 | |
| 63 | LIBDIR = $(top_builddir)/lib/csharp |
| 64 | |
| 65 | THRIFT = $(top_builddir)/compiler/cpp/thrift |
| 66 | |
| 67 | $(GENERATED): $(top_srcdir)/test/ThriftTest.thrift $(THRIFT) |
| 68 | $(THRIFT) --gen csharp -o . $< |
| 69 | |
| 70 | precross: TestClientServer.exe |
| 71 | |
| 72 | ThriftImpl.dll: $(GENERATED) $(LIBDIR)/Thrift.dll |
| 73 | $(CSC) $(CSC_DEFINES) -t:library -out:$@ -reference:$(LIBDIR)/Thrift.dll $(GENERATED) |
| 74 | |
| 75 | SRCS = TestClient.cs TestServer.cs Program.cs |
| 76 | |
| 77 | TestClientServer.exe: $(SRCS) ThriftImpl.dll |
| 78 | $(CSC) $(CSC_DEFINES) -out:$@ -reference:$(LIBDIR)/Thrift.dll -reference:ThriftImpl.dll $(SRCS) |
| 79 | |
| 80 | clean-local: |
| 81 | $(RM) -rf gen-csharp *.exe *.dll |
| 82 | |
| 83 | TESTPORT = 9500 |
| 84 | check-local: TestClientServer.exe |
| 85 | MONO_PATH=$(LIBDIR) timeout 10 mono TestClientServer.exe server --port=$(TESTPORT) & |
| 86 | sleep 1 |
| 87 | MONO_PATH=$(LIBDIR) mono TestClientServer.exe client --port=$(TESTPORT) |