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 | # |
Jens Geyer | 8677719 | 2015-07-25 15:59:46 +0200 | [diff] [blame] | 19 | AUTOMAKE_OPTIONS = subdir-objects serial-tests |
Roger Meier | 81a1f99 | 2014-10-22 14:09:43 +0200 | [diff] [blame] | 20 | |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 21 | SUBDIRS = |
| 22 | |
Nobuaki Sukegawa | ef0a8fa | 2015-05-10 20:21:17 +0900 | [diff] [blame] | 23 | BUILT_SOURCES = \ |
| 24 | gen-c_glib/t_test_debug_proto_test_types.h \ |
| 25 | gen-c_glib/t_test_empty_service.h \ |
| 26 | gen-c_glib/t_test_inherited.h \ |
| 27 | gen-c_glib/t_test_optional_required_test_types.h \ |
| 28 | gen-c_glib/t_test_reverse_order_service.h \ |
| 29 | gen-c_glib/t_test_second_service.h \ |
| 30 | gen-c_glib/t_test_service_for_exception_with_a_map.h \ |
| 31 | gen-c_glib/t_test_srv.h \ |
| 32 | gen-c_glib/t_test_thrift_test.h \ |
| 33 | gen-c_glib/t_test_thrift_test_types.h |
| 34 | |
Simon South | db3646f | 2015-08-01 12:18:12 +0000 | [diff] [blame] | 35 | AM_CPPFLAGS = -I../src |
| 36 | AM_CFLAGS = -g -Wall -Wextra -pedantic $(GLIB_CFLAGS) $(GOBJECT_CFLAGS) \ |
| 37 | @GCOV_CFLAGS@ |
| 38 | AM_CXXFLAGS = $(AM_CFLAGS) |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 39 | AM_LDFLAGS = $(GLIB_LIBS) $(GOBJECT_LIBS) @GCOV_LDFLAGS@ |
| 40 | |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 41 | check_PROGRAMS = \ |
Roger Meier | 909f186 | 2014-07-24 23:52:14 +0200 | [diff] [blame] | 42 | testapplicationexception \ |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 43 | testtransportsocket \ |
Roger Meier | c101092 | 2010-11-26 10:17:48 +0000 | [diff] [blame] | 44 | testbinaryprotocol \ |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 45 | testbufferedtransport \ |
| 46 | testframedtransport \ |
| 47 | testmemorybuffer \ |
| 48 | teststruct \ |
| 49 | testsimpleserver \ |
| 50 | testdebugproto \ |
| 51 | testoptionalrequired \ |
| 52 | testthrifttest |
| 53 | |
| 54 | if WITH_CPP |
Nobuaki Sukegawa | ef0a8fa | 2015-05-10 20:21:17 +0900 | [diff] [blame] | 55 | BUILT_SOURCES += gen-cpp/ThriftTest_types.cpp |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 56 | check_PROGRAMS += testthrifttestclient |
| 57 | endif |
| 58 | |
Roger Meier | 909f186 | 2014-07-24 23:52:14 +0200 | [diff] [blame] | 59 | testapplicationexception_SOURCES = testapplicationexception.c |
| 60 | testapplicationexception_LDADD = \ |
Jens Geyer | 8677719 | 2015-07-25 15:59:46 +0200 | [diff] [blame] | 61 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/libthrift_c_glib_la-thrift_application_exception.o \ |
| 62 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol.o \ |
| 63 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/libthrift_c_glib_la-thrift_struct.o \ |
| 64 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o |
Roger Meier | 909f186 | 2014-07-24 23:52:14 +0200 | [diff] [blame] | 65 | |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 66 | testtransportsocket_SOURCES = testtransportsocket.c |
| 67 | testtransportsocket_LDADD = \ |
Jens Geyer | 8677719 | 2015-07-25 15:59:46 +0200 | [diff] [blame] | 68 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o \ |
| 69 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_buffered_transport.o \ |
| 70 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_transport.o \ |
| 71 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_socket.o |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 72 | |
Roger Meier | c101092 | 2010-11-26 10:17:48 +0000 | [diff] [blame] | 73 | testbinaryprotocol_SOURCES = testbinaryprotocol.c |
| 74 | testbinaryprotocol_LDADD = \ |
Jens Geyer | 8677719 | 2015-07-25 15:59:46 +0200 | [diff] [blame] | 75 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol.o \ |
| 76 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o \ |
| 77 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_socket.o \ |
| 78 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_transport.o \ |
| 79 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_socket.o |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 80 | |
| 81 | testbufferedtransport_SOURCES = testbufferedtransport.c |
| 82 | testbufferedtransport_LDADD = \ |
Jens Geyer | 8677719 | 2015-07-25 15:59:46 +0200 | [diff] [blame] | 83 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o \ |
| 84 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_socket.o \ |
| 85 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_transport.o \ |
| 86 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_socket.o |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 87 | |
| 88 | testframedtransport_SOURCES = testframedtransport.c |
| 89 | testframedtransport_LDADD = \ |
Jens Geyer | 8677719 | 2015-07-25 15:59:46 +0200 | [diff] [blame] | 90 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o \ |
| 91 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_socket.o \ |
| 92 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_transport.o \ |
| 93 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_socket.o |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 94 | |
| 95 | testmemorybuffer_SOURCES = testmemorybuffer.c |
| 96 | testmemorybuffer_LDADD = \ |
Jens Geyer | 8677719 | 2015-07-25 15:59:46 +0200 | [diff] [blame] | 97 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 98 | |
| 99 | teststruct_SOURCES = teststruct.c |
| 100 | teststruct_LDADD = \ |
Jens Geyer | 8677719 | 2015-07-25 15:59:46 +0200 | [diff] [blame] | 101 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol.o \ |
| 102 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 103 | |
| 104 | testsimpleserver_SOURCES = testsimpleserver.c |
| 105 | testsimpleserver_LDADD = \ |
Jens Geyer | 8677719 | 2015-07-25 15:59:46 +0200 | [diff] [blame] | 106 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol.o \ |
| 107 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o \ |
| 108 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport_factory.o \ |
| 109 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/processor/libthrift_c_glib_la-thrift_processor.o \ |
| 110 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol_factory.o \ |
| 111 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_binary_protocol.o \ |
| 112 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_binary_protocol_factory.o \ |
| 113 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_socket.o \ |
| 114 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_transport.o \ |
| 115 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_server_socket.o \ |
| 116 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/server/libthrift_c_glib_la-thrift_server.o |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 117 | |
| 118 | testdebugproto_SOURCES = testdebugproto.c |
| 119 | testdebugproto_LDADD = libtestgenc.la |
| 120 | |
| 121 | testoptionalrequired_SOURCES = testoptionalrequired.c |
| 122 | testoptionalrequired_LDADD = \ |
Jens Geyer | 8677719 | 2015-07-25 15:59:46 +0200 | [diff] [blame] | 123 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/protocol/libthrift_c_glib_la-thrift_protocol.o \ |
| 124 | $(top_builddir)/lib/c_glib/src/thrift/c_glib/transport/libthrift_c_glib_la-thrift_transport.o \ |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 125 | libtestgenc.la |
| 126 | |
| 127 | testthrifttest_SOURCES = testthrifttest.c |
| 128 | testthrifttest_LDADD = libtestgenc.la |
| 129 | |
| 130 | testthrifttestclient_SOURCES = testthrifttestclient.cpp |
| 131 | testthrifttestclient_CPPFLAGS = -I../../cpp/src $(BOOST_CPPFLAGS) -I./gen-cpp -I../src -I./gen-c_glib $(GLIB_CFLAGS) |
| 132 | testthrifttestclient_LDADD = ../../cpp/.libs/libthrift.la ../libthrift_c_glib.la libtestgenc.la libtestgencpp.la |
| 133 | testthrifttestclient_LDFLAGS = -L../.libs -L../../cpp/.libs $(GLIB_LIBS) $(GOBJECT_LIBS) |
| 134 | |
| 135 | check_LTLIBRARIES = libtestgenc.la |
| 136 | |
| 137 | if WITH_CPP |
| 138 | check_LTLIBRARIES += libtestgencpp.la |
| 139 | endif |
| 140 | |
Bryan Duxbury | 39fbb9a | 2011-01-13 18:09:51 +0000 | [diff] [blame] | 141 | nodist_libtestgenc_la_SOURCES = \ |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 142 | gen-c_glib/t_test_debug_proto_test_types.c \ |
| 143 | gen-c_glib/t_test_empty_service.c \ |
| 144 | gen-c_glib/t_test_inherited.c \ |
| 145 | gen-c_glib/t_test_optional_required_test_types.c \ |
| 146 | gen-c_glib/t_test_reverse_order_service.c \ |
| 147 | gen-c_glib/t_test_second_service.c \ |
| 148 | gen-c_glib/t_test_service_for_exception_with_a_map.c \ |
| 149 | gen-c_glib/t_test_srv.c \ |
| 150 | gen-c_glib/t_test_thrift_test.c \ |
| 151 | gen-c_glib/t_test_thrift_test_types.c \ |
| 152 | gen-c_glib/t_test_debug_proto_test_types.h \ |
| 153 | gen-c_glib/t_test_empty_service.h \ |
| 154 | gen-c_glib/t_test_inherited.h \ |
| 155 | gen-c_glib/t_test_optional_required_test_types.h \ |
| 156 | gen-c_glib/t_test_reverse_order_service.h \ |
| 157 | gen-c_glib/t_test_second_service.h \ |
| 158 | gen-c_glib/t_test_service_for_exception_with_a_map.h \ |
| 159 | gen-c_glib/t_test_srv.h \ |
| 160 | gen-c_glib/t_test_thrift_test.h \ |
| 161 | gen-c_glib/t_test_thrift_test_types.h |
| 162 | libtestgenc_la_LIBADD = $(top_builddir)/lib/c_glib/libthrift_c_glib.la |
Jens Geyer | 1c19027 | 2015-07-28 23:15:18 +0200 | [diff] [blame] | 163 | libtestgenc_la_CPPFLAGS = $(AM_CPPFLAGS) -Wno-unused-function |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 164 | |
Bryan Duxbury | 39fbb9a | 2011-01-13 18:09:51 +0000 | [diff] [blame] | 165 | nodist_libtestgencpp_la_SOURCES = \ |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 166 | gen-cpp/ThriftTest.cpp \ |
| 167 | gen-cpp/ThriftTest_constants.cpp \ |
| 168 | gen-cpp/ThriftTest_types.cpp \ |
| 169 | gen-cpp/ThriftTest.h \ |
| 170 | gen-cpp/ThriftTest_constants.h \ |
| 171 | gen-cpp/ThriftTest_types.h |
| 172 | libtestgencpp_la_CPPFLAGS = -I../../cpp/src $(BOOST_CPPFLAGS) -I./gen-cpp |
| 173 | |
| 174 | THRIFT = $(top_builddir)/compiler/cpp/thrift |
| 175 | |
| 176 | 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 |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 177 | $(THRIFT) --gen c_glib $< |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 178 | |
| 179 | gen-c_glib/t_test_optional_required_test_types.c gen-c_glib/t_test_optional_required_test_types.h: ../../../test/OptionalRequiredTest.thrift |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 180 | $(THRIFT) --gen c_glib $< |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 181 | |
Nobuaki Sukegawa | ef0a8fa | 2015-05-10 20:21:17 +0900 | [diff] [blame] | 182 | 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 |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 183 | $(THRIFT) --gen c_glib $< |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 184 | |
Roger Meier | 035870d | 2014-10-22 23:43:05 +0200 | [diff] [blame] | 185 | gen-cpp/ThriftTest.cpp gen-cpp/ThriftTest_constants.cpp gen-cpp/ThriftTest_types.cpp: ../../../test/ThriftTest.thrift |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 186 | $(THRIFT) --gen cpp $< |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 187 | |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 188 | TESTS = \ |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 189 | $(check_PROGRAMS) \ |
| 190 | $(check_SCRIPTS) |
| 191 | |
| 192 | # globally added to all instances of valgrind calls |
| 193 | # VALGRIND_OPTS = --suppressions=glib.suppress |
| 194 | VALGRIND_OPTS = |
| 195 | |
| 196 | # globally added to all memcheck calls |
| 197 | VALGRIND_MEM_OPTS = --tool=memcheck \ |
| 198 | --num-callers=10 \ |
| 199 | ${myextravalgrindmemopts} |
| 200 | |
| 201 | # globally added to all leakcheck calls |
| 202 | VALGRIND_LEAK_OPTS = --tool=memcheck \ |
| 203 | --num-callers=10 \ |
| 204 | --leak-check=full \ |
| 205 | --leak-resolution=high \ |
| 206 | ${myextravalgrindleakopts} |
| 207 | |
| 208 | memcheck: $(check_PROGRAMS) |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 209 | @for x in $(check_PROGRAMS); \ |
| 210 | do \ |
| 211 | $(MAKE) memcheck-$$x; \ |
| 212 | done |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 213 | |
| 214 | leakcheck: $(check_PROGRAMS) |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 215 | @for x in $(check_PROGRAMS); \ |
| 216 | do \ |
| 217 | $(MAKE) leakcheck-$$x; \ |
| 218 | done |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 219 | |
| 220 | memcheck-%: % |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 221 | @echo "*****************************************"; \ |
| 222 | echo "MEMCHECK: $<"; \ |
| 223 | echo "ARGS: ${VALGRIND_OPTS} ${VALGRIND_MEM_OPTS} ${$<_VALGRIND_MEM_OPTS}"; \ |
| 224 | $(LIBTOOL) --mode=execute \ |
| 225 | valgrind \ |
| 226 | ${VALGRIND_OPTS} \ |
| 227 | ${VALGRIND_MEM_OPTS} \ |
| 228 | ${$<_VALGRIND_MEM_OPTS} ./$< |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 229 | |
| 230 | leakcheck-%: % |
Jens Geyer | 79f988c | 2014-10-03 20:42:54 +0200 | [diff] [blame] | 231 | @echo "*****************************************"; \ |
| 232 | echo "LEAKCHECK: $<"; \ |
| 233 | echo "ARGS: ${VALGRIND_OPTS} ${VALGRIND_LEAK_OPTS} ${$<_VALGRIND_LEAK_OPTS}"; \ |
| 234 | G_SLICE=always-malloc $(LIBTOOL) --mode=execute \ |
| 235 | valgrind \ |
| 236 | ${VALGRIND_OPTS} \ |
| 237 | ${VALGRIND_LEAK_OPTS} \ |
| 238 | ${$<_VALGRIND_LEAK_OPTS} ./$< |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 239 | |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 240 | clean-local: |
Jens Geyer | 8c5fce9 | 2015-07-28 22:59:16 +0200 | [diff] [blame] | 241 | $(RM) gen-c_glib/* gen-cpp/* |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 242 | |
| 243 | CLEANFILES = \ |
Roger Meier | 213a664 | 2010-10-27 12:30:11 +0000 | [diff] [blame] | 244 | *.bb \ |
| 245 | *.bbg \ |
| 246 | *.da \ |
| 247 | *.gcno \ |
| 248 | *.gcda \ |
Roger Meier | c101092 | 2010-11-26 10:17:48 +0000 | [diff] [blame] | 249 | *.gcov |