]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
automake: Make debug targets known but not built by default in non-debug builds.
authorTommi Virtanen <tommi.virtanen@dreamhost.com>
Wed, 27 Apr 2011 19:16:52 +0000 (12:16 -0700)
committerTommi Virtanen <tommi.virtanen@dreamhost.com>
Wed, 27 Apr 2011 19:16:52 +0000 (12:16 -0700)
With this, "./configure --without-debug && make -C src testceph" will work.
Before this, it would use make builtin rules, and fail to compile in a
confusing manner.

Signed-off-by: Tommi Virtanen <tommi.virtanen@dreamhost.com>
qa/workunits/Makefile.am
src/Makefile.am

index 9881adcd3954aad1766375c5bdb1a305281f6048..b2e500b3ee917e9d995fbab3c3ef4b04c480153d 100644 (file)
@@ -3,7 +3,7 @@ AUTOMAKE_OPTIONS = gnu
 SUBDIRS = 
 bin_PROGRAMS =
 
-if WITH_DEBUG
 direct_io_test_SOURCES = direct_io_test.c
+if WITH_DEBUG
 bin_PROGRAMS += direct_io_test
 endif
index 3ee0e0ece0d4360109d3c6340f50638ed83f92ce..0b56a74e0e877789cdf82587950374fd2a0bcb4e 100644 (file)
@@ -7,6 +7,8 @@ SUBDIRS =
 DIST_SUBDIRS = gtest
 CLEANFILES =
 bin_PROGRAMS =
+# like bin_PROGRAMS, but these targets are only built for debug builds
+bin_DEBUGPROGRAMS =
 sbin_PROGRAMS =
 sbin_SCRIPTS =
 bin_SCRIPTS = crun $(srcdir)/cclsinfo cdebugpack crbdnamer
@@ -144,23 +146,21 @@ cosd_SOURCES += perfglue/disabled_heap_profiler.cc
 cmds_SOURCES += perfglue/disabled_heap_profiler.cc
 endif # WITH_TCMALLOC
 
-# debug targets?
-if WITH_DEBUG
-
+# debug targets
 psim_SOURCES = psim.cc
 psim_LDADD = libcrush.a libcommon.a -lpthread -lm $(CRYPTO_LIBS) $(EXTRALIBS)
-bin_PROGRAMS += psim
+bin_DEBUGPROGRAMS += psim
 
 test_mutate_SOURCES = test/test_mutate.cc msg/SimpleMessenger.cc
 test_mutate_LDADD = librados.la -lpthread -lm $(CRYPTO_LIBS) $(EXTRALIBS)
-bin_PROGRAMS += test_mutate
+bin_DEBUGPROGRAMS += test_mutate
 
 testmsgr_SOURCES = testmsgr.cc msg/SimpleMessenger.cc
 testmsgr_LDADD = libcommon.a -lpthread -lm $(CRYPTO_LIBS) $(EXTRALIBS)
-bin_PROGRAMS += testmsgr
+bin_DEBUGPROGRAMS += testmsgr
 
 test_ioctls_SOURCES = client/test_ioctls.c
-bin_PROGRAMS += test_ioctls
+bin_DEBUGPROGRAMS += test_ioctls
 
 dumpjournal_SOURCES = dumpjournal.cc msg/SimpleMessenger.cc
 dumpjournal_LDADD = libosdc.a libcrush.a libcommon.a -lpthread -lm $(CRYPTO_LIBS) $(EXTRALIBS)
@@ -168,18 +168,15 @@ dupstore_SOURCES = dupstore.cc
 dupstore_LDADD = libos.a libcommon.a -lpthread -lm $(CRYPTO_LIBS) $(EXTRALIBS)
 streamtest_SOURCES = streamtest.cc
 streamtest_LDADD = libos.a libcommon.a -lpthread -lm $(CRYPTO_LIBS) $(EXTRALIBS)
-bin_PROGRAMS += dumpjournal dupstore streamtest
+bin_DEBUGPROGRAMS += dumpjournal dupstore streamtest
 
 test_trans_SOURCES = test_trans.cc
 test_trans_LDADD = libos.a libcommon.a -lpthread -lm $(CRYPTO_LIBS) $(EXTRALIBS)
-bin_PROGRAMS += test_trans
+bin_DEBUGPROGRAMS += test_trans
 
 testsnaps_SOURCES = test/osd/TestSnaps.cc
 testsnaps_LDADD = librados.la -lpthread -lm $(CRYPTO_LIBS) $(EXTRALIBS)
-bin_PROGRAMS += testsnaps
-
-endif
-
+bin_DEBUGPROGRAMS += testsnaps
 
 ##########
 BUILT_SOURCES =
@@ -210,24 +207,21 @@ libceph_la_LIBADD = libcrush.la -lpthread $(CRYPTO_LIBS) $(EXTRALIBS)
 libceph_la_LDFLAGS = ${AM_LDFLAGS} -version-info 1:0:0 -export-symbols-regex '^ceph_.*'
 lib_LTLIBRARIES += libceph.la
 
-if WITH_DEBUG
 testceph_SOURCES = client/testceph.cc
 testceph_LDADD = libceph.la libcrush.la -lpthread -lm $(CRYPTO_LIBS) $(EXTRALIBS)
-bin_PROGRAMS += testceph
+bin_DEBUGPROGRAMS += testceph
 
 testtimers_SOURCES = test/TestTimers.cc
 testtimers_LDADD = libceph.la libcrush.la -lpthread -lm $(CRYPTO_LIBS) $(EXTRALIBS)
-bin_PROGRAMS += testtimers
+bin_DEBUGPROGRAMS += testtimers
 
 testdout_streambuf_SOURCES = test/TestDoutStreambuf.cc
 testdout_streambuf_LDADD = libceph.la libcrush.la -lpthread
-bin_PROGRAMS += testdout_streambuf
+bin_DEBUGPROGRAMS += testdout_streambuf
 
 testsignal_handlers_SOURCES = test/TestSignalHandlers.cc
 testsignal_handlers_LDADD = libceph.la -lpthread
-bin_PROGRAMS += testsignal_handlers
-
-endif
+bin_DEBUGPROGRAMS += testsignal_handlers
 
 # librados
 librados_SOURCES = \
@@ -265,30 +259,26 @@ rados_SOURCES = rados.cc
 rados_LDADD = librados.la -lpthread -lm $(CRYPTO_LIBS) $(EXTRALIBS)
 bin_PROGRAMS += rados
 
-if WITH_DEBUG
 testrados_SOURCES = testrados.c
 testrados_LDADD = librados.la -lpthread -lm $(CRYPTO_LIBS) $(EXTRALIBS)
 testradospp_SOURCES = testradospp.cc
 testradospp_LDADD = librados.la -lpthread -lm
 radosacl_SOURCES = radosacl.cc
 radosacl_LDADD = librados.la -lpthread -lm $(CRYPTO_LIBS) $(EXTRALIBS)
-bin_PROGRAMS += testrados testradospp radosacl
-endif
+bin_DEBUGPROGRAMS += testrados testradospp radosacl
 
 rbd_SOURCES = rbd.cc common/fiemap.cc common/secret.c
 rbd_CXXFLAGS = ${AM_CXXFLAGS}
 rbd_LDADD = librbd.la librados.la libcrush.la -lpthread -lm -lkeyutils $(CRYPTO_LIBS) $(EXTRALIBS)
 bin_PROGRAMS += rbd
 
-if WITH_DEBUG
 testlibrbd_SOURCES = testlibrbd.c
 testlibrbd_LDADD = librbd.la librados.la libcrush.la -lpthread -lm \
                   $(CRYPTO_LIBS) $(EXTRALIBS)
 testlibrbdpp_SOURCES = testlibrbdpp.cc
 testlibrbdpp_LDADD = librbd.la librados.la libcrush.la -lpthread -lm \
                     $(CRYPTO_LIBS) $(EXTRALIBS)
-bin_PROGRAMS += testlibrbd testlibrbdpp
-endif
+bin_DEBUGPROGRAMS += testlibrbd testlibrbdpp
 
 if WITH_RADOSGW
 libradosgw_a_SOURCES = \
@@ -323,17 +313,15 @@ radosgw_admin_LDADD = libradosgw.a librados.a libcrush.a -lfcgi -lexpat -lpthrea
 bin_PROGRAMS += radosgw radosgw_admin
 endif
 
-if WITH_DEBUG
 testcrypto_SOURCES = testcrypto.cc
 testcrypto_LDADD = libcommon.a -lpthread -lm $(CRYPTO_LIBS) $(EXTRALIBS)
 testcrypto_CXXFLAGS = ${AM_CXXFLAGS}
-bin_PROGRAMS += testcrypto
+bin_DEBUGPROGRAMS += testcrypto
 
 testkeys_SOURCES = testkeys.cc
 testkeys_LDADD = libmon.a libcommon.a -lpthread -lm $(CRYPTO_LIBS) $(EXTRALIBS)
 testkeys_CXXFLAGS = ${AM_CXXFLAGS}
-bin_PROGRAMS += testkeys
-endif
+bin_DEBUGPROGRAMS += testkeys
 
 
 ## rados object classes
@@ -1093,3 +1081,8 @@ uninstall-local:
        -rmdir -p $(DESTDIR)$(localstatedir)/log/ceph/stat
        -rmdir -p $(DESTDIR)$(localstatedir)/lib/ceph/tmp
 
+# if we are doing a debug build, tell make to actually build the debug
+# targets
+if WITH_DEBUG
+bin_PROGRAMS += $(bin_DEBUGPROGRAMS)
+endif