From: Monty Taylor Date: Wed, 8 Jul 2009 17:58:46 +0000 (-0700) Subject: Cleaned up clients/ and tests/ to not build things multiple times, and to not X-Git-Tag: 0.31~4^2~4 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=1a1007937aadd0e5efbc94fb72dc7dca807e7375;p=m6w6%2Flibmemcached Cleaned up clients/ and tests/ to not build things multiple times, and to not refer to things using relative paths, but rather paths based on top_srcdir or top_builddir. --- diff --git a/clients/Makefile.am b/clients/Makefile.am index 9cb34318..244c80d3 100644 --- a/clients/Makefile.am +++ b/clients/Makefile.am @@ -1,4 +1,4 @@ -LDADDS = $(top_builddir)/libmemcached/libmemcached.la +LDADDS = $(top_builddir)/libmemcached/libmemcached.la libutilities.la bin_PROGRAMS = memcat memdump memcp memstat memrm memflush memslap memerror @@ -7,37 +7,43 @@ noinst_HEADERS = client_options.h \ generator.h \ execute.h -memcat_SOURCES = memcat.c utilities.c +noinst_LTLIBRARIES= libutilities.la libgenexec.la + +libutilities_la_SOURCES= utilities.c +libgenexec_la_SOURCES= generator.c execute.c + +memcat_SOURCES = memcat.c memcat_LDADD = $(LDADDS) memcat_LDFLAGS = -rpath $(pkglibdir) -memcp_SOURCES = memcp.c utilities.c +memcp_SOURCES = memcp.c memcp_LDADD = $(LDADDS) memcp_LDFLAGS = -rpath $(pkglibdir) -memdump_SOURCES = memdump.c utilities.c +memdump_SOURCES = memdump.c memdump_LDADD = $(LDADDS) memdump_LDFLAGS = -rpath $(pkglibdir) -memstat_SOURCES = memstat.c utilities.c +memstat_SOURCES = memstat.c memstat_LDADD = $(LDADDS) memstat_LDFLAGS = -rpath $(pkglibdir) -memrm_SOURCES = memrm.c utilities.c +memrm_SOURCES = memrm.c memrm_LDADD = $(LDADDS) memrm_LDFLAGS = -rpath $(pkglibdir) -memflush_SOURCES = memflush.c utilities.c +memflush_SOURCES = memflush.c memflush_LDADD = $(LDADDS) memflush_LDFLAGS = -rpath $(pkglibdir) -memerror_SOURCES = memerror.c utilities.c +memerror_SOURCES = memerror.c memerror_LDADD = $(LDADDS) memerror_LDFLAGS = -rpath $(pkglibdir) -memslap_SOURCES = memslap.c utilities.c generator.c execute.c -memslap_LDADD = $(LDADDS) -lpthread -memslap_LDFLAGS = -rpath $(pkglibdir) +memslap_SOURCES = memslap.c +memslap_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS) +memslap_LDADD = $(LDADDS) $(PTHREAD_LIBS) libgenexec.la +memslap_LDFLAGS = $(AM_LDFLAGS) -rpath $(pkglibdir) test-start-server: memflush --servers=localhost diff --git a/tests/Makefile.am b/tests/Makefile.am index 2916350e..5f3afcb2 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -20,22 +20,26 @@ LIBS = noinst_HEADERS = test.h server.h ketama_test_cases.h noinst_PROGRAMS = testapp testplus udptest atomsmasher startservers +noinst_LTLIBRARIES= libserver.la libtest.la -testapp_CFLAGS= ${AM_CFLAGS} ${NO_CONVERSION} ${NO_STRICT_ALIASING} -testapp_SOURCES = test.c function.c server.c ../clients/generator.c ../clients/execute.c -testapp_LDADD = $(LDADDS) +libserver_la_SOURCES= server.c +libtest_la_SOURCES= test.c -testplus_SOURCES = test.c plus.cpp server.c -testplus_LDADD = $(LDADDS) +testapp_CFLAGS= $(AM_CFLAGS) $(NO_CONVERSION) $(NO_STRICT_ALIASING) +testapp_SOURCES = function.c +testapp_LDADD = $(LDADDS) $(top_builddir)/clients/libgenexec.la libtest.la libserver.la -udptest_SOURCES = test.c udp.c server.c -udptest_LDADD = $(LDADDS) +testplus_SOURCES = plus.cpp +testplus_LDADD = $(LDADDS) libtest.la libserver.la -atomsmasher_SOURCES = test.c atomsmasher.c server.c ../clients/generator.c ../clients/execute.c -atomsmasher_LDADD = $(LDADDS) +udptest_SOURCES = udp.c +udptest_LDADD = $(LDADDS) libtest.la libserver.la -startservers_SOURCES = start.c server.c -startservers_LDADD = $(LDADDS) +atomsmasher_SOURCES = atomsmasher.c +atomsmasher_LDADD = $(LDADDS) $(top_builddir)/clients/libgenexec.la libtest.la libserver.la + +startservers_SOURCES = start.c +startservers_LDADD = $(LDADDS) libserver.la record: ./testapp > output.res @@ -91,7 +95,7 @@ helgrind: libtool --mode=execute valgrind --tool=helgrind testapp helgrind-slap: - libtool --mode=execute valgrind --tool=helgrind ../clients/memslap --server=localhost --concurrency=30 + libtool --mode=execute valgrind --tool=helgrind ${top_builddir}/clients/memslap --server=localhost --concurrency=30 test-no-outputdiff: testapp ./testapp > /dev/null