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
20GENERATED = \
21	gen-csharp/Aggr.cs \
22	gen-csharp/BenchmarkService.cs \
23	gen-csharp/Error.cs
24
25BUILT_SOURCES = $(GENERATED)
26
27THRIFT = $(top_builddir)/compiler/cpp/thrift
28
29gen-csharp/Aggr.cs: $(top_srcdir)/contrib/async-test/aggr.thrift
30	$(THRIFT) --gen csharp $<
31
32gen-csharp/BenchmarkService.cs gen-csharp/Error.cs: $(top_srcdir)/lib/rb/benchmark/Benchmark.thrift
33	$(THRIFT) --gen csharp $<
34
35ThriftImpl.dll: Multiplex.Test.Common.cs $(GENERATED) ../../Thrift.dll
36	$(CSC) $(CSC_DEFINES) -t:library -out:./ThriftImpl.dll -reference:../../Thrift.dll $(GENERATED) $<
37
38MultiplexClient.exe: Client/Multiplex.Test.Client.cs ThriftImpl.dll
39	$(CSC) $(CSC_DEFINES) -out:$@ -reference:../../Thrift.dll -reference:ThriftImpl.dll $<
40
41MultiplexServer.exe: Server/Multiplex.Test.Server.cs ThriftImpl.dll
42	$(CSC) $(CSC_DEFINES) -out:$@ -reference:../../Thrift.dll -reference:ThriftImpl.dll $<
43
44CLEANFILES = \
45	MultiplexClient.exe \
46	MultiplexServer.exe \
47	ThriftImpl.dll
48
49DISTCLEANFILES = \
50	Makefile.in
51
52clean-local:
53	$(RM) -rf gen-csharp
54
55dist-hook:
56	$(RM) -r $(distdir)/gen-csharp/
57
58TESTPORT = 9501
59check-local: MultiplexServer.exe MultiplexClient.exe
60	echo $(TESTPORT)
61	MONO_PATH=../../ timeout 10 mono MultiplexServer.exe $(TESTPORT) &
62	sleep 1
63	MONO_PATH=../../ mono MultiplexClient.exe $(TESTPORT)
64