blob: ad166e38408afc378f5161f1a385a9e201a404fe [file] [log] [blame]
Nobuaki Sukegawa88c5ee72016-09-04 18:49:18 +09001#
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
20GENERATED = \
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
51BUILT_SOURCES = $(GENERATED)
52
53if MONO_MCS
54CSC = mcs
55else
56CSC = gmcs
57endif
58
59if NET_2_0
60CSC_DEFINES = -d:NET_2_0
61endif
62
63LIBDIR = $(top_builddir)/lib/csharp
64
65THRIFT = $(top_builddir)/compiler/cpp/thrift
66
67$(GENERATED): $(top_srcdir)/test/ThriftTest.thrift $(THRIFT)
68 $(THRIFT) --gen csharp -o . $<
69
70precross: TestClientServer.exe
71
72ThriftImpl.dll: $(GENERATED) $(LIBDIR)/Thrift.dll
73 $(CSC) $(CSC_DEFINES) -t:library -out:$@ -reference:$(LIBDIR)/Thrift.dll $(GENERATED)
74
75SRCS = TestClient.cs TestServer.cs Program.cs
76
77TestClientServer.exe: $(SRCS) ThriftImpl.dll
78 $(CSC) $(CSC_DEFINES) -out:$@ -reference:$(LIBDIR)/Thrift.dll -reference:ThriftImpl.dll $(SRCS)
79
80clean-local:
81 $(RM) -rf gen-csharp *.exe *.dll
82
83TESTPORT = 9500
84check-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)
Jens Geyerf3a29742017-11-30 22:30:03 +010088
89EXTRA_DIST = \
90 Properties/AssemblyInfo.cs \
91 ThriftTest.csproj \
92 ThriftTest.sln \
93 Program.cs \
94 TestServer.cs \
95 TestClient.cs