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
20SUBDIRS = t
21
22Makefile-perl.mk : Makefile.PL
23	$(PERL) Makefile.PL MAKEFILE=Makefile-perl.mk INSTALLDIRS=$(INSTALLDIRS) INSTALL_BASE=$(PERL_PREFIX)
24
25all-local: Makefile-perl.mk
26	$(MAKE) -f $<
27	find blib -name 'Makefile*' -exec rm -f {} \;
28
29install-exec-local: Makefile-perl.mk
30	$(MAKE) -f $< install DESTDIR=$(DESTDIR)/
31
32clean-local:
33	if test -f Makefile-perl.mk ; then \
34		$(MAKE) -f Makefile-perl.mk clean ; \
35	fi
36	$(RM) Makefile-perl.mk.old
37	$(RM) -r gen-perl gen-perl2
38
39EXTRA_DIST = \
40	coding_standards.md \
41	build-cpan-dist.sh \
42	Makefile.PL \
43	MANIFEST.SKIP \
44	test.pl \
45	lib/Thrift.pm \
46	lib/Thrift.pm \
47	lib/Thrift/BinaryProtocol.pm \
48	lib/Thrift/BufferedTransport.pm \
49	lib/Thrift/Exception.pm \
50	lib/Thrift/FramedTransport.pm \
51	lib/Thrift/HttpClient.pm \
52	lib/Thrift/MemoryBuffer.pm \
53	lib/Thrift/MessageType.pm \
54	lib/Thrift/MultiplexedProcessor.pm \
55	lib/Thrift/MultiplexedProtocol.pm \
56	lib/Thrift/Protocol.pm \
57	lib/Thrift/ProtocolDecorator.pm \
58	lib/Thrift/Server.pm \
59	lib/Thrift/ServerSocket.pm \
60	lib/Thrift/Socket.pm \
61	lib/Thrift/SSLSocket.pm \
62	lib/Thrift/SSLServerSocket.pm \
63	lib/Thrift/UnixServerSocket.pm \
64	lib/Thrift/UnixSocket.pm \
65	lib/Thrift/Type.pm \
66	lib/Thrift/Transport.pm \
67	tools/FixupDist.pl \
68	README.md
69
70THRIFT = @top_builddir@/compiler/cpp/thrift
71THRIFT_IF = @top_srcdir@/test/v0.16/ThriftTest.thrift
72NAME_BENCHMARKSERVICE =  @top_srcdir@/lib/rb/benchmark/Benchmark.thrift
73NAME_AGGR = @top_srcdir@/contrib/async-test/aggr.thrift
74
75THRIFTTEST_GEN = \
76	gen-perl/ThriftTest/Constants.pm \
77	gen-perl/ThriftTest/SecondService.pm \
78	gen-perl/ThriftTest/ThriftTest.pm \
79	gen-perl/ThriftTest/Types.pm
80
81BENCHMARK_GEN = \
82	gen-perl/BenchmarkService.pm \
83	gen-perl/Constants.pm \
84	gen-perl/Types.pm
85
86AGGR_GEN = \
87	gen-perl2/Aggr.pm \
88	gen-perl2/Constants.pm \
89	gen-perl2/Types.pm
90
91PERL_GEN = \
92	$(THRIFTTEST_GEN) \
93	$(BENCHMARK_GEN) \
94	$(AGGR_GEN)
95
96BUILT_SOURCES = $(PERL_GEN)
97
98check-local: $(PERL_GEN)
99	$(PERL) -Iblib/lib -I@abs_srcdir@ -I@builddir@/gen-perl2 -I@builddir@/gen-perl \
100		@abs_srcdir@/test.pl @abs_srcdir@/t/*.t
101
102$(THRIFTTEST_GEN): $(THRIFT_IF) $(THRIFT)
103	$(THRIFT) --gen perl $<
104
105$(BENCHMARK_GEN): $(NAME_BENCHMARKSERVICE) $(THRIFT)
106	$(THRIFT) --gen perl $<
107
108$(AGGR_GEN): $(NAME_AGGR) $(THRIFT)
109	$(MKDIR_P) gen-perl2
110	$(THRIFT) -out gen-perl2 --gen perl $<
111