From: Monty Taylor Date: Thu, 17 Dec 2009 21:24:01 +0000 (-0800) Subject: Moves everything into root makefile except for docs. X-Git-Tag: 0.37~57^2~3 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=c801828a5a8937eeb9c008135185a6b5ab6199a9;p=m6w6%2Flibmemcached Moves everything into root makefile except for docs. --- diff --git a/Makefile.am b/Makefile.am index 5dd028a7..2533593b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -2,7 +2,9 @@ ACLOCAL_AMFLAGS = -I m4 # includes append to these: SUFFIXES = +PHONY = TESTS = +CLEANFILES = bin_PROGRAMS = noinst_HEADERS = lib_LTLIBRARIES = @@ -14,10 +16,13 @@ EXTRA_HEADERS = BUILT_SOURCES= EXTRA_DIST = README.FIRST -SUBDIRS = . docs support tests example +SUBDIRS = docs include libmemcached/include.am include clients/include.am +include tests/include.am +include example/include.am +include support/include.am check-local: test-no-outputdiff diff --git a/clients/include.am b/clients/include.am index d91ebc66..2e4d87ee 100644 --- a/clients/include.am +++ b/clients/include.am @@ -90,7 +90,7 @@ test-start-server: clients/memslap --servers=localhost --concurrency=10 --initial-load=1000 --execute-number=10 --test=set clients/memslap --servers=localhost --concurrency=10 --initial-load=1000 --execute-number=10 --test=set --non-blocking -valgrind: +client-valgrind: libtool --mode=execute valgrind --leak-check=yes --show-reachable=yes clients/memslap --servers=localhost libtool --mode=execute valgrind --leak-check=yes --show-reachable=yes clients/memslap --servers=localhost --concurrency=10 libtool --mode=execute valgrind --leak-check=yes --show-reachable=yes clients/memslap --servers=localhost --concurrency=10 --initial-load=1000 diff --git a/configure.ac b/configure.ac index 7687bf35..de62e1ea 100644 --- a/configure.ac +++ b/configure.ac @@ -46,11 +46,8 @@ AS_IF([test "x$ac_cv_header_atomic_h" = "xyes"], AC_CONFIG_FILES([ Makefile - tests/Makefile docs/Makefile - example/Makefile libmemcached/memcached_configure.h - support/Makefile support/libmemcached.pc support/libmemcached.spec support/libmemcached-fc.spec diff --git a/example/Makefile.am b/example/Makefile.am deleted file mode 100644 index 9c570822..00000000 --- a/example/Makefile.am +++ /dev/null @@ -1,20 +0,0 @@ -noinst_PROGRAMS = memcached_light - -memcached_light_SOURCES= memcached_light.c \ - memcached_light.h \ - storage.h \ - interface_v0.c \ - interface_v1.c -memcached_light_LDADD= $(top_builddir)/libmemcached/libmemcachedprotocol.la $(LIBINNODB) -memcached_light_DEPENDENCIES= $(top_builddir)/libmemcached/libmemcachedprotocol.la - -if BUILD_BYTEORDER -memcached_light_LDADD+= $(top_builddir)/libmemcached/libbyteorder.la -memcached_light_DEPENDENCIES+= $(top_builddir)/libmemcached/libbyteorder.la -endif - -if HAVE_LIBINNODB -memcached_light_SOURCES+= storage_innodb.c -else -memcached_light_SOURCES+= storage.c -endif diff --git a/example/include.am b/example/include.am new file mode 100644 index 00000000..daae642b --- /dev/null +++ b/example/include.am @@ -0,0 +1,24 @@ +# vim:ft=automake +# included from Top Level Makefile.am +# All paths should be given relative to the root + +noinst_PROGRAMS += example/memcached_light + +example_memcached_light_SOURCES= \ + example/interface_v0.c \ + example/interface_v1.c \ + example/memcached_light.c \ + example/memcached_light.h \ + example/storage.h + +example_memcached_light_LDADD= libmemcached/libmemcachedprotocol.la $(LIBINNODB) + +if BUILD_BYTEORDER +example_memcached_light_LDADD+= libmemcached/libbyteorder.la +endif + +if HAVE_LIBINNODB +example_memcached_light_SOURCES+= example/storage_innodb.c +else +example_memcached_light_SOURCES+= example/storage.c +endif diff --git a/support/Makefile.am b/support/Makefile.am deleted file mode 100644 index 48fab4c4..00000000 --- a/support/Makefile.am +++ /dev/null @@ -1,4 +0,0 @@ -EXTRA_DIST = libmemcached.spec set_benchmark.sh libmemcached-fc.spec.in - -pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libmemcached.pc diff --git a/support/include.am b/support/include.am new file mode 100644 index 00000000..d9287e47 --- /dev/null +++ b/support/include.am @@ -0,0 +1,11 @@ +# vim:ft=automake +# included from Top Level Makefile.am +# All paths should be given relative to the root + +EXTRA_DIST += \ + support/libmemcached.spec \ + support/libmemcached-fc.spec.in \ + support/set_benchmark.sh + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = support/libmemcached.pc diff --git a/tests/Makefile.am b/tests/Makefile.am deleted file mode 100644 index 6c51d28f..00000000 --- a/tests/Makefile.am +++ /dev/null @@ -1,103 +0,0 @@ -LDADDS = $(top_builddir)/libmemcached/libmemcached.la - -if BUILD_LIBMEMCACHEDUTIL -LDADDS+= $(top_builddir)/libmemcached/libmemcachedutil.la -endif - -EXTRA_DIST = \ - r/memcat.res\ - r/memcp.res\ - r/memrm.res\ - r/memslap.res\ - r/memstat.res\ - t/memcat.test\ - t/memcp.test\ - t/memrm.test\ - t/memslap.test\ - t/memstat.test - -LIBS = - -noinst_HEADERS = test.h server.h ketama_test_cases.h ketama_test_cases_spy.h hash_results.h libmemcached_world.h -noinst_PROGRAMS = testapp testplus udptest atomsmasher startservers -noinst_LTLIBRARIES= libserver.la libtest.la - -libserver_la_SOURCES= server.c -libtest_la_SOURCES= test.c - -testapp_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STRICT_ALIASING) -testapp_SOURCES = function.c -testapp_LDADD = $(top_builddir)/clients/libgenexec.la libtest.la libserver.la $(LDADDS) - -testplus_SOURCES = plus.cpp -testplus_LDADD = libtest.la libserver.la $(LDADDS) - -udptest_SOURCES = udp.c -udptest_LDADD = libtest.la libserver.la $(LDADDS) - -atomsmasher_SOURCES = atomsmasher.c -atomsmasher_LDADD = $(top_builddir)/clients/libgenexec.la libtest.la libserver.la $(LDADDS) - -startservers_SOURCES = start.c -startservers_LDADD = libserver.la $(LDADDS) - -client-record: - sh t/memcat.test > r/memcat.res - sh t/memcp.test > r/memcp.res - sh t/memrm.test > r/memrm.res - sh t/memslap.test > r/memslap.res - sh t/memstat.test > r/memstat.res - -test: testapp testplus library_test memcapable - echo "Tests completed" - -library_test: - ./testapp -# ./testplus - -memcapable: - @MEMC_BINARY@ -d -P /tmp/Xumemc.pid -p 12555 - @$(top_builddir)/clients/memcapable -p 12555 || echo "Your memcached server does not support all commands" - @cat /tmp/Xumemc.pid | xargs kill || echo "Failed to kill memcached server" - @rm /tmp/Xumemc.pid - -clients: - @MEMC_BINARY@ -d -P /tmp/Xumemc.pid -p 12555 - export MEMCACHED_SERVERS="localhost:12555" - sh t/memcat.test > r/memcat.cmp - diff r/memcat.res r/memcat.cmp - sh t/memcp.test > r/memcp.cmp - diff r/memcp.res r/memcp.cmp - sh t/memrm.test > r/memrm.cmp - diff r/memrm.res r/memrm.cmp - sh t/memslap.test > r/memslap.cmp - diff r/memslap.res r/memslap.cmp - sh t/memstat.test > r/memstat.cmp - diff r/memstat.res r/memstat.cmp - cat /tmp/Xumemc.pid | xargs kill - rm /tmp/Xumemc.pid - -valgrind: - $(LIBTOOL) --mode=execute valgrind --leak-check=yes --show-reachable=yes testapp - -cachegrind: - rm -f cachegrind.out.* - $(LIBTOOL) --mode=execute valgrind --tool=cachegrind --branch-sim=yes testapp - cg_annotate cachegrind.out.* --auto=yes > /tmp/cachegrind.out - -callgrind: - rm -f callgrind.out.* - $(LIBTOOL) --mode=execute valgrind --tool=callgrind testapp - callgrind_annotate callgrind.out.* --auto=yes > /tmp/callgrind.out - -helgrind: - rm -f helgrind.out.* - $(LIBTOOL) --mode=execute valgrind --tool=helgrind testapp - -helgrind-slap: - $(LIBTOOL) --mode=execute valgrind --tool=helgrind ${top_builddir}/clients/memslap --server=localhost --concurrency=30 - -test-no-outputdiff: test - -hudson-valgrind: - $(LIBTOOL) --mode=execute valgrind --leak-check=yes --show-reachable=yes --log-file=/tmp/valgrind.out testapp diff --git a/tests/include.am b/tests/include.am new file mode 100644 index 00000000..9c0ec5cf --- /dev/null +++ b/tests/include.am @@ -0,0 +1,136 @@ +# vim:ft=automake +# included from Top Level Makefile.am +# All paths should be given relative to the root + +TESTS_LDADDS = libmemcached/libmemcached.la + +if BUILD_LIBMEMCACHEDUTIL +TESTS_LDADDS+= libmemcached/libmemcachedutil.la +endif + +EXTRA_DIST+= \ + tests/r/memcat.res \ + tests/r/memcp.res \ + tests/r/memrm.res \ + tests/r/memslap.res \ + tests/r/memstat.res \ + tests/t/memcat.test \ + tests/t/memcp.test \ + tests/t/memrm.test \ + tests/t/memslap.test \ + tests/t/memstat.test + +noinst_HEADERS+= \ + tests/hash_results.h \ + tests/ketama_test_cases.h \ + tests/ketama_test_cases_spy.h \ + tests/libmemcached_world.h \ + tests/server.h \ + tests/test.h + +noinst_PROGRAMS+= \ + tests/atomsmasher \ + tests/startservers \ + tests/testapp \ + tests/testplus \ + tests/udptest + +noinst_LTLIBRARIES+= tests/libserver.la +tests_libserver_la_SOURCES= tests/server.c + +noinst_LTLIBRARIES+= tests/libtest.la +tests_libtest_la_SOURCES= tests/test.c + +tests_testapp_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STRICT_ALIASING) +tests_testapp_SOURCES= tests/function.c +tests_testapp_LDADD= \ + clients/libgenexec.la \ + tests/libserver.la \ + tests/libtest.la \ + $(TESTS_LDADDS) + +tests_testplus_SOURCES= tests/plus.cpp +tests_testplus_LDADD= tests/libtest.la tests/libserver.la $(TESTS_LDADDS) + +tests_udptest_SOURCES= tests/udp.c +tests_udptest_LDADD= tests/libtest.la tests/libserver.la $(TESTS_LDADDS) + +tests_atomsmasher_SOURCES= tests/atomsmasher.c +tests_atomsmasher_LDADD= \ + clients/libgenexec.la \ + tests/libserver.la \ + tests/libtest.la \ + $(TESTS_LDADDS) + +tests_startservers_SOURCES= tests/start.c +tests_startservers_LDADD= tests/libserver.la $(TESTS_LDADDS) + +client-record: + sh tests/t/memcat.test > tests/r/memcat.res + sh tests/t/memcp.test > tests/r/memcp.res + sh tests/t/memrm.test > tests/r/memrm.res + sh tests/t/memslap.test > tests/r/memslap.res + sh tests/t/memstat.test > tests/r/memstat.res + +test: tests/testapp tests/testplus library_test memcapable + echo "Tests completed" + +library_test: + tests/testapp +# tests/testplus + +memcapable: clients/memcapable + @MEMC_BINARY@ -d -P tests/Xumemc.pid -p 12555 + @clients/memcapable -p 12555 || echo "Your memcached server does not support all commands" + @cat tests/Xumemc.pid | xargs kill || echo "Failed to kill memcached server" + @rm tests/Xumemc.pid + +PHONY += clients +clients: + @MEMC_BINARY@ -d -P tests/Xumemc.pid -p 12555 + export MEMCACHED_SERVERS="localhost:12555" + sh tests/t/memcat.test > tests/r/memcat.cmp + diff tests/r/memcat.res tests/r/memcat.cmp + sh tests/t/memcp.test > tests/r/memcp.cmp + diff tests/r/memcp.res tests/r/memcp.cmp + sh tests/t/memrm.test > tests/r/memrm.cmp + diff tests/r/memrm.res tests/r/memrm.cmp + sh tests/t/memslap.test > tests/r/memslap.cmp + diff tests/r/memslap.res tests/r/memslap.cmp + sh tests/t/memstat.test > tests/r/memstat.cmp + diff tests/r/memstat.res tests/r/memstat.cmp + cat tests/Xumemc.pid | xargs kill + rm tests/Xumemc.pid + +PHONY += valgrind +valgrind: + $(LIBTOOL) --mode=execute valgrind --leak-check=yes --show-reachable=yes tests/testapp + +PHONY += cachegrind +CLEANFILES += tests/cachegrind.out +cachegrind: + rm -f tests/cachegrind.out.* + $(LIBTOOL) --mode=execute valgrind --tool=cachegrind --cachegrind-out-file=tests/cachegrind.out.%p --branch-sim=yes tests/testapp + cg_annotate tests/cachegrind.out.* --auto=yes > tests/cachegrind.out + +PHONY += callgrind +CLEANFILES += tests/callgrind.out +callgrind: + rm -f tests/callgrind.out.* + $(LIBTOOL) --mode=execute valgrind --tool=callgrind --callgrind-out-file=tests/callgrind.out.%p tests/testapp + callgrind_annotate tests/callgrind.out.* --auto=yes > tests/callgrind.out + +PHONY += helgrind +CLEANFILES+= helgrind.out.* +helgrind: + rm -f helgrind.out.* + $(LIBTOOL) --mode=execute valgrind --tool=helgrind tests/testapp + +PHONY += helgrind-slap +helgrind-slap: + $(LIBTOOL) --mode=execute valgrind --tool=helgrind clients/memslap --server=localhost --concurrency=30 + +test-no-outputdiff: test + +hudson-valgrind: + $(LIBTOOL) --mode=execute valgrind --leak-check=yes --show-reachable=yes --log-file=tests/valgrind.out tests/testapp