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