Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 1 | SUBDIRS = |
| 2 | |
| 3 | AM_CPPFLAGS = -g -Wall -I../src $(GLIB_CFLAGS) |
| 4 | AM_LDFLAGS = $(GLIB_LIBS) $(GOBJECT_LIBS) @GCOV_LDFLAGS@ |
| 5 | |
| 6 | CFLAGS = @GCOV_CFLAGS@ |
| 7 | CXXFLAGS = -g |
| 8 | |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 9 | check_PROGRAMS = \ |
| 10 | testtransportsocket \ |
Roger Meier | c101092 | 2010-11-26 10:17:48 +0000 | [diff] [blame^] | 11 | testbinaryprotocol \ |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 12 | testbufferedtransport \ |
| 13 | testframedtransport \ |
| 14 | testmemorybuffer \ |
| 15 | teststruct \ |
| 16 | testsimpleserver \ |
| 17 | testdebugproto \ |
| 18 | testoptionalrequired \ |
| 19 | testthrifttest |
| 20 | |
| 21 | if WITH_CPP |
| 22 | check_PROGRAMS += testthrifttestclient |
| 23 | endif |
| 24 | |
| 25 | testtransportsocket_SOURCES = testtransportsocket.c |
| 26 | testtransportsocket_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 Meier | c101092 | 2010-11-26 10:17:48 +0000 | [diff] [blame^] | 31 | testbinaryprotocol_SOURCES = testbinaryprotocol.c |
| 32 | testbinaryprotocol_LDADD = \ |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 33 | ../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 | |
| 39 | testbufferedtransport_SOURCES = testbufferedtransport.c |
| 40 | testbufferedtransport_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 | |
| 46 | testframedtransport_SOURCES = testframedtransport.c |
| 47 | testframedtransport_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 | |
| 53 | testmemorybuffer_SOURCES = testmemorybuffer.c |
| 54 | testmemorybuffer_LDADD = \ |
| 55 | ../libthrift_c_glib_la-thrift_transport.o |
| 56 | |
| 57 | teststruct_SOURCES = teststruct.c |
| 58 | teststruct_LDADD = \ |
| 59 | ../libthrift_c_glib_la-thrift_protocol.o \ |
| 60 | ../libthrift_c_glib_la-thrift_transport.o |
| 61 | |
| 62 | testsimpleserver_SOURCES = testsimpleserver.c |
| 63 | testsimpleserver_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 | |
| 76 | testdebugproto_SOURCES = testdebugproto.c |
| 77 | testdebugproto_LDADD = libtestgenc.la |
| 78 | |
| 79 | testoptionalrequired_SOURCES = testoptionalrequired.c |
| 80 | testoptionalrequired_LDADD = \ |
| 81 | ../libthrift_c_glib_la-thrift_protocol.o \ |
| 82 | ../libthrift_c_glib_la-thrift_transport.o \ |
| 83 | libtestgenc.la |
| 84 | |
| 85 | testthrifttest_SOURCES = testthrifttest.c |
| 86 | testthrifttest_LDADD = libtestgenc.la |
| 87 | |
| 88 | testthrifttestclient_SOURCES = testthrifttestclient.cpp |
| 89 | testthrifttestclient_CPPFLAGS = -I../../cpp/src $(BOOST_CPPFLAGS) -I./gen-cpp -I../src -I./gen-c_glib $(GLIB_CFLAGS) |
| 90 | testthrifttestclient_LDADD = ../../cpp/.libs/libthrift.la ../libthrift_c_glib.la libtestgenc.la libtestgencpp.la |
| 91 | testthrifttestclient_LDFLAGS = -L../.libs -L../../cpp/.libs $(GLIB_LIBS) $(GOBJECT_LIBS) |
| 92 | |
| 93 | check_LTLIBRARIES = libtestgenc.la |
| 94 | |
| 95 | if WITH_CPP |
| 96 | check_LTLIBRARIES += libtestgencpp.la |
| 97 | endif |
| 98 | |
| 99 | libtestgenc_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 |
| 120 | libtestgenc_la_LIBADD = $(top_builddir)/lib/c_glib/libthrift_c_glib.la |
| 121 | |
| 122 | libtestgencpp_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 |
| 129 | libtestgencpp_la_CPPFLAGS = -I../../cpp/src $(BOOST_CPPFLAGS) -I./gen-cpp |
| 130 | |
| 131 | THRIFT = $(top_builddir)/compiler/cpp/thrift |
| 132 | |
| 133 | gen-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 | |
| 136 | gen-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 | |
| 139 | gen-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 | |
| 142 | gen-cpp/ThriftTest.cpp gen-cpp/ThriftTest.h: ../../../test/ThriftTest.thrift |
| 143 | $(THRIFT) --gen cpp $< |
| 144 | |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 145 | TESTS = \ |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 146 | $(check_PROGRAMS) \ |
| 147 | $(check_SCRIPTS) |
| 148 | |
| 149 | # globally added to all instances of valgrind calls |
| 150 | # VALGRIND_OPTS = --suppressions=glib.suppress |
| 151 | VALGRIND_OPTS = |
| 152 | |
| 153 | # globally added to all memcheck calls |
| 154 | VALGRIND_MEM_OPTS = --tool=memcheck \ |
| 155 | --num-callers=10 \ |
| 156 | ${myextravalgrindmemopts} |
| 157 | |
| 158 | # globally added to all leakcheck calls |
| 159 | VALGRIND_LEAK_OPTS = --tool=memcheck \ |
| 160 | --num-callers=10 \ |
| 161 | --leak-check=full \ |
| 162 | --leak-resolution=high \ |
| 163 | ${myextravalgrindleakopts} |
| 164 | |
| 165 | memcheck: $(check_PROGRAMS) |
| 166 | @for x in $(check_PROGRAMS); \ |
| 167 | do \ |
| 168 | $(MAKE) memcheck-$$x; \ |
| 169 | done |
| 170 | |
| 171 | leakcheck: $(check_PROGRAMS) |
| 172 | @for x in $(check_PROGRAMS); \ |
| 173 | do \ |
| 174 | $(MAKE) leakcheck-$$x; \ |
| 175 | done |
| 176 | |
| 177 | memcheck-%: % |
| 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 | |
| 187 | leakcheck-%: % |
| 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 Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 197 | clean-local: |
| 198 | $(RM) -r gen-c_glib gen-cpp |
| 199 | |
| 200 | CLEANFILES = \ |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 201 | *.bb \ |
| 202 | *.bbg \ |
| 203 | *.da \ |
| 204 | *.gcno \ |
| 205 | *.gcda \ |
Roger Meier | c101092 | 2010-11-26 10:17:48 +0000 | [diff] [blame^] | 206 | *.gcov |