Roger Meier | c2cc61a | 2010-11-30 19:53:29 +0000 | [diff] [blame] | 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 | |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 20 | SUBDIRS = |
| 21 | |
| 22 | AM_CPPFLAGS = -g -Wall -I../src $(GLIB_CFLAGS) |
| 23 | AM_LDFLAGS = $(GLIB_LIBS) $(GOBJECT_LIBS) @GCOV_LDFLAGS@ |
| 24 | |
| 25 | CFLAGS = @GCOV_CFLAGS@ |
| 26 | CXXFLAGS = -g |
| 27 | |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 28 | check_PROGRAMS = \ |
| 29 | testtransportsocket \ |
Roger Meier | c101092 | 2010-11-26 10:17:48 +0000 | [diff] [blame] | 30 | testbinaryprotocol \ |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 31 | testbufferedtransport \ |
| 32 | testframedtransport \ |
| 33 | testmemorybuffer \ |
| 34 | teststruct \ |
| 35 | testsimpleserver \ |
| 36 | testdebugproto \ |
| 37 | testoptionalrequired \ |
| 38 | testthrifttest |
| 39 | |
| 40 | if WITH_CPP |
| 41 | check_PROGRAMS += testthrifttestclient |
| 42 | endif |
| 43 | |
| 44 | testtransportsocket_SOURCES = testtransportsocket.c |
| 45 | testtransportsocket_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 Meier | c101092 | 2010-11-26 10:17:48 +0000 | [diff] [blame] | 50 | testbinaryprotocol_SOURCES = testbinaryprotocol.c |
| 51 | testbinaryprotocol_LDADD = \ |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 52 | ../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 | |
| 58 | testbufferedtransport_SOURCES = testbufferedtransport.c |
| 59 | testbufferedtransport_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 | |
| 65 | testframedtransport_SOURCES = testframedtransport.c |
| 66 | testframedtransport_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 | |
| 72 | testmemorybuffer_SOURCES = testmemorybuffer.c |
| 73 | testmemorybuffer_LDADD = \ |
| 74 | ../libthrift_c_glib_la-thrift_transport.o |
| 75 | |
| 76 | teststruct_SOURCES = teststruct.c |
| 77 | teststruct_LDADD = \ |
| 78 | ../libthrift_c_glib_la-thrift_protocol.o \ |
| 79 | ../libthrift_c_glib_la-thrift_transport.o |
| 80 | |
| 81 | testsimpleserver_SOURCES = testsimpleserver.c |
| 82 | testsimpleserver_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 | |
| 95 | testdebugproto_SOURCES = testdebugproto.c |
| 96 | testdebugproto_LDADD = libtestgenc.la |
| 97 | |
| 98 | testoptionalrequired_SOURCES = testoptionalrequired.c |
| 99 | testoptionalrequired_LDADD = \ |
| 100 | ../libthrift_c_glib_la-thrift_protocol.o \ |
| 101 | ../libthrift_c_glib_la-thrift_transport.o \ |
| 102 | libtestgenc.la |
| 103 | |
| 104 | testthrifttest_SOURCES = testthrifttest.c |
| 105 | testthrifttest_LDADD = libtestgenc.la |
| 106 | |
| 107 | testthrifttestclient_SOURCES = testthrifttestclient.cpp |
| 108 | testthrifttestclient_CPPFLAGS = -I../../cpp/src $(BOOST_CPPFLAGS) -I./gen-cpp -I../src -I./gen-c_glib $(GLIB_CFLAGS) |
| 109 | testthrifttestclient_LDADD = ../../cpp/.libs/libthrift.la ../libthrift_c_glib.la libtestgenc.la libtestgencpp.la |
| 110 | testthrifttestclient_LDFLAGS = -L../.libs -L../../cpp/.libs $(GLIB_LIBS) $(GOBJECT_LIBS) |
| 111 | |
| 112 | check_LTLIBRARIES = libtestgenc.la |
| 113 | |
| 114 | if WITH_CPP |
| 115 | check_LTLIBRARIES += libtestgencpp.la |
| 116 | endif |
| 117 | |
Bryan Duxbury | 39fbb9a | 2011-01-13 18:09:51 +0000 | [diff] [blame] | 118 | nodist_libtestgenc_la_SOURCES = \ |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 119 | 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 |
| 139 | libtestgenc_la_LIBADD = $(top_builddir)/lib/c_glib/libthrift_c_glib.la |
| 140 | |
Bryan Duxbury | 39fbb9a | 2011-01-13 18:09:51 +0000 | [diff] [blame] | 141 | nodist_libtestgencpp_la_SOURCES = \ |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 142 | 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 |
| 148 | libtestgencpp_la_CPPFLAGS = -I../../cpp/src $(BOOST_CPPFLAGS) -I./gen-cpp |
| 149 | |
| 150 | THRIFT = $(top_builddir)/compiler/cpp/thrift |
| 151 | |
| 152 | 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 |
| 153 | $(THRIFT) --gen c_glib $< |
| 154 | |
| 155 | gen-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 | |
| 158 | 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 |
| 159 | $(THRIFT) --gen c_glib $< |
| 160 | |
| 161 | gen-cpp/ThriftTest.cpp gen-cpp/ThriftTest.h: ../../../test/ThriftTest.thrift |
| 162 | $(THRIFT) --gen cpp $< |
| 163 | |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 164 | TESTS = \ |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 165 | $(check_PROGRAMS) \ |
| 166 | $(check_SCRIPTS) |
| 167 | |
| 168 | # globally added to all instances of valgrind calls |
| 169 | # VALGRIND_OPTS = --suppressions=glib.suppress |
| 170 | VALGRIND_OPTS = |
| 171 | |
| 172 | # globally added to all memcheck calls |
| 173 | VALGRIND_MEM_OPTS = --tool=memcheck \ |
| 174 | --num-callers=10 \ |
| 175 | ${myextravalgrindmemopts} |
| 176 | |
| 177 | # globally added to all leakcheck calls |
| 178 | VALGRIND_LEAK_OPTS = --tool=memcheck \ |
| 179 | --num-callers=10 \ |
| 180 | --leak-check=full \ |
| 181 | --leak-resolution=high \ |
| 182 | ${myextravalgrindleakopts} |
| 183 | |
| 184 | memcheck: $(check_PROGRAMS) |
| 185 | @for x in $(check_PROGRAMS); \ |
| 186 | do \ |
| 187 | $(MAKE) memcheck-$$x; \ |
| 188 | done |
| 189 | |
| 190 | leakcheck: $(check_PROGRAMS) |
| 191 | @for x in $(check_PROGRAMS); \ |
| 192 | do \ |
| 193 | $(MAKE) leakcheck-$$x; \ |
| 194 | done |
| 195 | |
| 196 | memcheck-%: % |
| 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 | |
| 206 | leakcheck-%: % |
| 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 Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 216 | clean-local: |
| 217 | $(RM) -r gen-c_glib gen-cpp |
| 218 | |
| 219 | CLEANFILES = \ |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 220 | *.bb \ |
| 221 | *.bbg \ |
| 222 | *.da \ |
| 223 | *.gcno \ |
| 224 | *.gcda \ |
Roger Meier | c101092 | 2010-11-26 10:17:48 +0000 | [diff] [blame] | 225 | *.gcov |