blob: 25f474a4aaefcb749144f87cb30daba26038bb0b [file] [log] [blame]
Roger Meierc2cc61a2010-11-30 19:53:29 +00001#
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#
Roger Meierc0959192013-01-15 23:20:19 +010019.NOTPARALLEL:
Roger Meier213a6642010-10-27 12:30:11 +000020SUBDIRS =
21
22AM_CPPFLAGS = -g -Wall -I../src $(GLIB_CFLAGS)
23AM_LDFLAGS = $(GLIB_LIBS) $(GOBJECT_LIBS) @GCOV_LDFLAGS@
24
25CFLAGS = @GCOV_CFLAGS@
26CXXFLAGS = -g
27
Roger Meier213a6642010-10-27 12:30:11 +000028check_PROGRAMS = \
Roger Meier909f1862014-07-24 23:52:14 +020029 testapplicationexception \
Roger Meier213a6642010-10-27 12:30:11 +000030 testtransportsocket \
Roger Meierc1010922010-11-26 10:17:48 +000031 testbinaryprotocol \
Roger Meier213a6642010-10-27 12:30:11 +000032 testbufferedtransport \
33 testframedtransport \
34 testmemorybuffer \
35 teststruct \
36 testsimpleserver \
37 testdebugproto \
38 testoptionalrequired \
39 testthrifttest
40
41if WITH_CPP
42 check_PROGRAMS += testthrifttestclient
43endif
44
Roger Meier909f1862014-07-24 23:52:14 +020045testapplicationexception_SOURCES = testapplicationexception.c
46testapplicationexception_LDADD = \
47 ../libthrift_c_glib_la-thrift_application_exception.o \
48 ../libthrift_c_glib_la-thrift_protocol.o \
49 ../libthrift_c_glib_la-thrift_struct.o \
50 ../libthrift_c_glib_la-thrift_transport.o
51
Roger Meier213a6642010-10-27 12:30:11 +000052testtransportsocket_SOURCES = testtransportsocket.c
53testtransportsocket_LDADD = \
54 ../libthrift_c_glib_la-thrift_transport.o \
55 ../libthrift_c_glib_la-thrift_server_transport.o \
56 ../libthrift_c_glib_la-thrift_server_socket.o
57
Roger Meierc1010922010-11-26 10:17:48 +000058testbinaryprotocol_SOURCES = testbinaryprotocol.c
59testbinaryprotocol_LDADD = \
Roger Meier213a6642010-10-27 12:30:11 +000060 ../libthrift_c_glib_la-thrift_protocol.o \
61 ../libthrift_c_glib_la-thrift_transport.o \
62 ../libthrift_c_glib_la-thrift_socket.o \
63 ../libthrift_c_glib_la-thrift_server_transport.o \
64 ../libthrift_c_glib_la-thrift_server_socket.o
65
66testbufferedtransport_SOURCES = testbufferedtransport.c
67testbufferedtransport_LDADD = \
68 ../libthrift_c_glib_la-thrift_transport.o \
69 ../libthrift_c_glib_la-thrift_socket.o \
70 ../libthrift_c_glib_la-thrift_server_transport.o \
71 ../libthrift_c_glib_la-thrift_server_socket.o
72
73testframedtransport_SOURCES = testframedtransport.c
74testframedtransport_LDADD = \
75 ../libthrift_c_glib_la-thrift_transport.o \
76 ../libthrift_c_glib_la-thrift_socket.o \
77 ../libthrift_c_glib_la-thrift_server_transport.o \
78 ../libthrift_c_glib_la-thrift_server_socket.o
79
80testmemorybuffer_SOURCES = testmemorybuffer.c
81testmemorybuffer_LDADD = \
82 ../libthrift_c_glib_la-thrift_transport.o
83
84teststruct_SOURCES = teststruct.c
85teststruct_LDADD = \
86 ../libthrift_c_glib_la-thrift_protocol.o \
87 ../libthrift_c_glib_la-thrift_transport.o
88
89testsimpleserver_SOURCES = testsimpleserver.c
90testsimpleserver_LDADD = \
91 ../libthrift_c_glib_la-thrift_protocol.o \
92 ../libthrift_c_glib_la-thrift_transport.o \
93 ../libthrift_c_glib_la-thrift_transport_factory.o \
94 ../libthrift_c_glib_la-thrift_processor.o \
95 ../libthrift_c_glib_la-thrift_protocol_factory.o \
96 ../libthrift_c_glib_la-thrift_binary_protocol.o \
97 ../libthrift_c_glib_la-thrift_binary_protocol_factory.o \
98 ../libthrift_c_glib_la-thrift_socket.o \
99 ../libthrift_c_glib_la-thrift_server_transport.o \
100 ../libthrift_c_glib_la-thrift_server_socket.o \
101 ../libthrift_c_glib_la-thrift_server.o
102
103testdebugproto_SOURCES = testdebugproto.c
104testdebugproto_LDADD = libtestgenc.la
105
106testoptionalrequired_SOURCES = testoptionalrequired.c
107testoptionalrequired_LDADD = \
108 ../libthrift_c_glib_la-thrift_protocol.o \
109 ../libthrift_c_glib_la-thrift_transport.o \
110 libtestgenc.la
111
112testthrifttest_SOURCES = testthrifttest.c
113testthrifttest_LDADD = libtestgenc.la
114
115testthrifttestclient_SOURCES = testthrifttestclient.cpp
116testthrifttestclient_CPPFLAGS = -I../../cpp/src $(BOOST_CPPFLAGS) -I./gen-cpp -I../src -I./gen-c_glib $(GLIB_CFLAGS)
117testthrifttestclient_LDADD = ../../cpp/.libs/libthrift.la ../libthrift_c_glib.la libtestgenc.la libtestgencpp.la
118testthrifttestclient_LDFLAGS = -L../.libs -L../../cpp/.libs $(GLIB_LIBS) $(GOBJECT_LIBS)
119
120check_LTLIBRARIES = libtestgenc.la
121
122if WITH_CPP
123 check_LTLIBRARIES += libtestgencpp.la
124endif
125
Bryan Duxbury39fbb9a2011-01-13 18:09:51 +0000126nodist_libtestgenc_la_SOURCES = \
Roger Meier213a6642010-10-27 12:30:11 +0000127 gen-c_glib/t_test_debug_proto_test_types.c \
128 gen-c_glib/t_test_empty_service.c \
129 gen-c_glib/t_test_inherited.c \
130 gen-c_glib/t_test_optional_required_test_types.c \
131 gen-c_glib/t_test_reverse_order_service.c \
132 gen-c_glib/t_test_second_service.c \
133 gen-c_glib/t_test_service_for_exception_with_a_map.c \
134 gen-c_glib/t_test_srv.c \
135 gen-c_glib/t_test_thrift_test.c \
136 gen-c_glib/t_test_thrift_test_types.c \
137 gen-c_glib/t_test_debug_proto_test_types.h \
138 gen-c_glib/t_test_empty_service.h \
139 gen-c_glib/t_test_inherited.h \
140 gen-c_glib/t_test_optional_required_test_types.h \
141 gen-c_glib/t_test_reverse_order_service.h \
142 gen-c_glib/t_test_second_service.h \
143 gen-c_glib/t_test_service_for_exception_with_a_map.h \
144 gen-c_glib/t_test_srv.h \
145 gen-c_glib/t_test_thrift_test.h \
146 gen-c_glib/t_test_thrift_test_types.h
147libtestgenc_la_LIBADD = $(top_builddir)/lib/c_glib/libthrift_c_glib.la
148
Bryan Duxbury39fbb9a2011-01-13 18:09:51 +0000149nodist_libtestgencpp_la_SOURCES = \
Roger Meier213a6642010-10-27 12:30:11 +0000150 gen-cpp/ThriftTest.cpp \
151 gen-cpp/ThriftTest_constants.cpp \
152 gen-cpp/ThriftTest_types.cpp \
153 gen-cpp/ThriftTest.h \
154 gen-cpp/ThriftTest_constants.h \
155 gen-cpp/ThriftTest_types.h
156libtestgencpp_la_CPPFLAGS = -I../../cpp/src $(BOOST_CPPFLAGS) -I./gen-cpp
157
158THRIFT = $(top_builddir)/compiler/cpp/thrift
159
160gen-c_glib/t_test_debug_proto_test_types.c gen-c_glib/t_test_debug_proto_test_types.h gen-c_glib/t_test_empty_service.c gen-c_glib/t_test_empty_service.h gen-c_glib/t_test_inherited.c gen-c_glib/t_test_inherited.h gen-c_glib/t_test_reverse_order_service.c gen-c_glib/t_test_reverse_order_service.h gen-c_glib/t_test_service_for_exception_with_a_map.c gen-c_glib/t_test_service_for_exception_with_a_map.h gen-c_glib/t_test_srv.c gen-c_glib/t_test_srv.h: ../../../test/DebugProtoTest.thrift
161 $(THRIFT) --gen c_glib $<
162
163gen-c_glib/t_test_optional_required_test_types.c gen-c_glib/t_test_optional_required_test_types.h: ../../../test/OptionalRequiredTest.thrift
164 $(THRIFT) --gen c_glib $<
165
166gen-c_glib/t_test_second_service.c gen-c_glib/t_test_thrift_test.c gen-c_glib/t_test_thrift_test_types.c gen-c_glib/t_test_second_service.h gen-c_glib/t_test_thrift_test-.h gen-c_glib/t_test_thrift_test_types.h: ../../../test/ThriftTest.thrift
167 $(THRIFT) --gen c_glib $<
168
169gen-cpp/ThriftTest.cpp gen-cpp/ThriftTest.h: ../../../test/ThriftTest.thrift
170 $(THRIFT) --gen cpp $<
171
Roger Meier213a6642010-10-27 12:30:11 +0000172TESTS = \
Roger Meier213a6642010-10-27 12:30:11 +0000173 $(check_PROGRAMS) \
174 $(check_SCRIPTS)
175
176# globally added to all instances of valgrind calls
177# VALGRIND_OPTS = --suppressions=glib.suppress
178VALGRIND_OPTS =
179
180# globally added to all memcheck calls
181VALGRIND_MEM_OPTS = --tool=memcheck \
182 --num-callers=10 \
183 ${myextravalgrindmemopts}
184
185# globally added to all leakcheck calls
186VALGRIND_LEAK_OPTS = --tool=memcheck \
187 --num-callers=10 \
188 --leak-check=full \
189 --leak-resolution=high \
190 ${myextravalgrindleakopts}
191
192memcheck: $(check_PROGRAMS)
193 @for x in $(check_PROGRAMS); \
194 do \
195 $(MAKE) memcheck-$$x; \
196 done
197
198leakcheck: $(check_PROGRAMS)
199 @for x in $(check_PROGRAMS); \
200 do \
201 $(MAKE) leakcheck-$$x; \
202 done
203
204memcheck-%: %
205 @echo "*****************************************"; \
206 echo "MEMCHECK: $<"; \
207 echo "ARGS: ${VALGRIND_OPTS} ${VALGRIND_MEM_OPTS} ${$<_VALGRIND_MEM_OPTS}"; \
208 $(LIBTOOL) --mode=execute \
209 valgrind \
210 ${VALGRIND_OPTS} \
211 ${VALGRIND_MEM_OPTS} \
212 ${$<_VALGRIND_MEM_OPTS} ./$<
213
214leakcheck-%: %
215 @echo "*****************************************"; \
216 echo "LEAKCHECK: $<"; \
217 echo "ARGS: ${VALGRIND_OPTS} ${VALGRIND_LEAK_OPTS} ${$<_VALGRIND_LEAK_OPTS}"; \
218 G_SLICE=always-malloc $(LIBTOOL) --mode=execute \
219 valgrind \
220 ${VALGRIND_OPTS} \
221 ${VALGRIND_LEAK_OPTS} \
222 ${$<_VALGRIND_LEAK_OPTS} ./$<
223
Roger Meier213a6642010-10-27 12:30:11 +0000224clean-local:
225 $(RM) -r gen-c_glib gen-cpp
226
227CLEANFILES = \
Roger Meier213a6642010-10-27 12:30:11 +0000228 *.bb \
229 *.bbg \
230 *.da \
231 *.gcno \
232 *.gcda \
Roger Meierc1010922010-11-26 10:17:48 +0000233 *.gcov