blob: e9f070e000bf9361e05c451abd204bf263801775 [file] [log] [blame]
Roger Meier213a6642010-10-27 12:30:11 +00001SUBDIRS =
2
3AM_CPPFLAGS = -g -Wall -I../src $(GLIB_CFLAGS)
4AM_LDFLAGS = $(GLIB_LIBS) $(GOBJECT_LIBS) @GCOV_LDFLAGS@
5
6CFLAGS = @GCOV_CFLAGS@
7CXXFLAGS = -g
8
Roger Meier213a6642010-10-27 12:30:11 +00009check_PROGRAMS = \
10 testtransportsocket \
Roger Meierc1010922010-11-26 10:17:48 +000011 testbinaryprotocol \
Roger Meier213a6642010-10-27 12:30:11 +000012 testbufferedtransport \
13 testframedtransport \
14 testmemorybuffer \
15 teststruct \
16 testsimpleserver \
17 testdebugproto \
18 testoptionalrequired \
19 testthrifttest
20
21if WITH_CPP
22 check_PROGRAMS += testthrifttestclient
23endif
24
25testtransportsocket_SOURCES = testtransportsocket.c
26testtransportsocket_LDADD = \
27 ../libthrift_c_glib_la-thrift_transport.o \
28 ../libthrift_c_glib_la-thrift_server_transport.o \
29 ../libthrift_c_glib_la-thrift_server_socket.o
30
Roger Meierc1010922010-11-26 10:17:48 +000031testbinaryprotocol_SOURCES = testbinaryprotocol.c
32testbinaryprotocol_LDADD = \
Roger Meier213a6642010-10-27 12:30:11 +000033 ../libthrift_c_glib_la-thrift_protocol.o \
34 ../libthrift_c_glib_la-thrift_transport.o \
35 ../libthrift_c_glib_la-thrift_socket.o \
36 ../libthrift_c_glib_la-thrift_server_transport.o \
37 ../libthrift_c_glib_la-thrift_server_socket.o
38
39testbufferedtransport_SOURCES = testbufferedtransport.c
40testbufferedtransport_LDADD = \
41 ../libthrift_c_glib_la-thrift_transport.o \
42 ../libthrift_c_glib_la-thrift_socket.o \
43 ../libthrift_c_glib_la-thrift_server_transport.o \
44 ../libthrift_c_glib_la-thrift_server_socket.o
45
46testframedtransport_SOURCES = testframedtransport.c
47testframedtransport_LDADD = \
48 ../libthrift_c_glib_la-thrift_transport.o \
49 ../libthrift_c_glib_la-thrift_socket.o \
50 ../libthrift_c_glib_la-thrift_server_transport.o \
51 ../libthrift_c_glib_la-thrift_server_socket.o
52
53testmemorybuffer_SOURCES = testmemorybuffer.c
54testmemorybuffer_LDADD = \
55 ../libthrift_c_glib_la-thrift_transport.o
56
57teststruct_SOURCES = teststruct.c
58teststruct_LDADD = \
59 ../libthrift_c_glib_la-thrift_protocol.o \
60 ../libthrift_c_glib_la-thrift_transport.o
61
62testsimpleserver_SOURCES = testsimpleserver.c
63testsimpleserver_LDADD = \
64 ../libthrift_c_glib_la-thrift_protocol.o \
65 ../libthrift_c_glib_la-thrift_transport.o \
66 ../libthrift_c_glib_la-thrift_transport_factory.o \
67 ../libthrift_c_glib_la-thrift_processor.o \
68 ../libthrift_c_glib_la-thrift_protocol_factory.o \
69 ../libthrift_c_glib_la-thrift_binary_protocol.o \
70 ../libthrift_c_glib_la-thrift_binary_protocol_factory.o \
71 ../libthrift_c_glib_la-thrift_socket.o \
72 ../libthrift_c_glib_la-thrift_server_transport.o \
73 ../libthrift_c_glib_la-thrift_server_socket.o \
74 ../libthrift_c_glib_la-thrift_server.o
75
76testdebugproto_SOURCES = testdebugproto.c
77testdebugproto_LDADD = libtestgenc.la
78
79testoptionalrequired_SOURCES = testoptionalrequired.c
80testoptionalrequired_LDADD = \
81 ../libthrift_c_glib_la-thrift_protocol.o \
82 ../libthrift_c_glib_la-thrift_transport.o \
83 libtestgenc.la
84
85testthrifttest_SOURCES = testthrifttest.c
86testthrifttest_LDADD = libtestgenc.la
87
88testthrifttestclient_SOURCES = testthrifttestclient.cpp
89testthrifttestclient_CPPFLAGS = -I../../cpp/src $(BOOST_CPPFLAGS) -I./gen-cpp -I../src -I./gen-c_glib $(GLIB_CFLAGS)
90testthrifttestclient_LDADD = ../../cpp/.libs/libthrift.la ../libthrift_c_glib.la libtestgenc.la libtestgencpp.la
91testthrifttestclient_LDFLAGS = -L../.libs -L../../cpp/.libs $(GLIB_LIBS) $(GOBJECT_LIBS)
92
93check_LTLIBRARIES = libtestgenc.la
94
95if WITH_CPP
96 check_LTLIBRARIES += libtestgencpp.la
97endif
98
99libtestgenc_la_SOURCES = \
100 gen-c_glib/t_test_debug_proto_test_types.c \
101 gen-c_glib/t_test_empty_service.c \
102 gen-c_glib/t_test_inherited.c \
103 gen-c_glib/t_test_optional_required_test_types.c \
104 gen-c_glib/t_test_reverse_order_service.c \
105 gen-c_glib/t_test_second_service.c \
106 gen-c_glib/t_test_service_for_exception_with_a_map.c \
107 gen-c_glib/t_test_srv.c \
108 gen-c_glib/t_test_thrift_test.c \
109 gen-c_glib/t_test_thrift_test_types.c \
110 gen-c_glib/t_test_debug_proto_test_types.h \
111 gen-c_glib/t_test_empty_service.h \
112 gen-c_glib/t_test_inherited.h \
113 gen-c_glib/t_test_optional_required_test_types.h \
114 gen-c_glib/t_test_reverse_order_service.h \
115 gen-c_glib/t_test_second_service.h \
116 gen-c_glib/t_test_service_for_exception_with_a_map.h \
117 gen-c_glib/t_test_srv.h \
118 gen-c_glib/t_test_thrift_test.h \
119 gen-c_glib/t_test_thrift_test_types.h
120libtestgenc_la_LIBADD = $(top_builddir)/lib/c_glib/libthrift_c_glib.la
121
122libtestgencpp_la_SOURCES = \
123 gen-cpp/ThriftTest.cpp \
124 gen-cpp/ThriftTest_constants.cpp \
125 gen-cpp/ThriftTest_types.cpp \
126 gen-cpp/ThriftTest.h \
127 gen-cpp/ThriftTest_constants.h \
128 gen-cpp/ThriftTest_types.h
129libtestgencpp_la_CPPFLAGS = -I../../cpp/src $(BOOST_CPPFLAGS) -I./gen-cpp
130
131THRIFT = $(top_builddir)/compiler/cpp/thrift
132
133gen-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
134 $(THRIFT) --gen c_glib $<
135
136gen-c_glib/t_test_optional_required_test_types.c gen-c_glib/t_test_optional_required_test_types.h: ../../../test/OptionalRequiredTest.thrift
137 $(THRIFT) --gen c_glib $<
138
139gen-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
140 $(THRIFT) --gen c_glib $<
141
142gen-cpp/ThriftTest.cpp gen-cpp/ThriftTest.h: ../../../test/ThriftTest.thrift
143 $(THRIFT) --gen cpp $<
144
Roger Meier213a6642010-10-27 12:30:11 +0000145TESTS = \
Roger Meier213a6642010-10-27 12:30:11 +0000146 $(check_PROGRAMS) \
147 $(check_SCRIPTS)
148
149# globally added to all instances of valgrind calls
150# VALGRIND_OPTS = --suppressions=glib.suppress
151VALGRIND_OPTS =
152
153# globally added to all memcheck calls
154VALGRIND_MEM_OPTS = --tool=memcheck \
155 --num-callers=10 \
156 ${myextravalgrindmemopts}
157
158# globally added to all leakcheck calls
159VALGRIND_LEAK_OPTS = --tool=memcheck \
160 --num-callers=10 \
161 --leak-check=full \
162 --leak-resolution=high \
163 ${myextravalgrindleakopts}
164
165memcheck: $(check_PROGRAMS)
166 @for x in $(check_PROGRAMS); \
167 do \
168 $(MAKE) memcheck-$$x; \
169 done
170
171leakcheck: $(check_PROGRAMS)
172 @for x in $(check_PROGRAMS); \
173 do \
174 $(MAKE) leakcheck-$$x; \
175 done
176
177memcheck-%: %
178 @echo "*****************************************"; \
179 echo "MEMCHECK: $<"; \
180 echo "ARGS: ${VALGRIND_OPTS} ${VALGRIND_MEM_OPTS} ${$<_VALGRIND_MEM_OPTS}"; \
181 $(LIBTOOL) --mode=execute \
182 valgrind \
183 ${VALGRIND_OPTS} \
184 ${VALGRIND_MEM_OPTS} \
185 ${$<_VALGRIND_MEM_OPTS} ./$<
186
187leakcheck-%: %
188 @echo "*****************************************"; \
189 echo "LEAKCHECK: $<"; \
190 echo "ARGS: ${VALGRIND_OPTS} ${VALGRIND_LEAK_OPTS} ${$<_VALGRIND_LEAK_OPTS}"; \
191 G_SLICE=always-malloc $(LIBTOOL) --mode=execute \
192 valgrind \
193 ${VALGRIND_OPTS} \
194 ${VALGRIND_LEAK_OPTS} \
195 ${$<_VALGRIND_LEAK_OPTS} ./$<
196
Roger Meier213a6642010-10-27 12:30:11 +0000197clean-local:
198 $(RM) -r gen-c_glib gen-cpp
199
200CLEANFILES = \
Roger Meier213a6642010-10-27 12:30:11 +0000201 *.bb \
202 *.bbg \
203 *.da \
204 *.gcno \
205 *.gcda \
Roger Meierc1010922010-11-26 10:17:48 +0000206 *.gcov