From: "Matt W. Benjamin" <matt@linuxbox.com>
To: Noah Watkins <noah.watkins@inktank.com>
Cc: Sage Weil <sage@inktank.com>,
ceph-devel@vger.kernel.org,
Roald van Loon <roaldvanloon@gmail.com>
Subject: Re: subdir-objects
Date: Sat, 7 Sep 2013 20:36:11 -0400 (EDT) [thread overview]
Message-ID: <1692710180.24.1378600571331.JavaMail.root@thunderbeast.private.linuxbox.com> (raw)
In-Reply-To: <CA+Hcz58E7OKaGto0pF_ZYoge-FcDLtc66cbqx9a9+z-=Op3YWQ@mail.gmail.com>
Thanks for doing this. Also in the same interest of building Ceph faster, we've
been experimenting with a CMake translation of the current AM build. I have no
idea yet if it will be any help ;).
Matt
----- "Noah Watkins" <noah.watkins@inktank.com> wrote:
> I'm so excited to have a refactored automake setup :)
>
> I was just looking through build-refactor, and it doesn't really look
> like there is much that could be reused for the non-recrusive
> approach. I'll leave it up for a few days, just in case.
>
> On Sat, Sep 7, 2013 at 1:11 PM, Roald van Loon
> <roaldvanloon@gmail.com> wrote:
> > On Sat, Sep 7, 2013 at 7:47 PM, Noah Watkins
> <noah.watkins@inktank.com> wrote:
> >> Oh, and one question about the non-recursive approach. If I stick
> a
> >> Makefile.am in the test/ directory I can do things like:
> >>
> >> LDADD = all-the-test-dependencies
> >>
> >> and then avoid redundant per-target primaries like test_LDADD =
> (deps)
> >> $(LDADD), because it applies to everything in the Makefile.
> >>
> >> Is that possible with the include approach, or would a naked LDADD
> in
> >> an included Makefile fragment affect all the targets in the file
> >> including it?
> >
> > LDADD = xyz would indeed affect all targets. However, it's not
> > something you want to do anyway; using an _LDADD at a target is
> less
> > confusing and less prone to errors because you know exactly what
> > libraries a target needs.
> >
> > For instance, in test/Makefile.am you can have a debug target
> > depending on libglobal, which has dependencies set by libglobal
> > itself;
> >
> > CEPH_GLOBAL = $(LIBGLOBAL) $(PTHREAD_LIBS) -lm $(CRYPTO_LIBS)
> $(EXTRALIBS)
> >
> > And then in test/Makefile.am;
> >
> > ceph_test_crypto_SOURCES = test/testcrypto.cc
> > ceph_test_crypto_LDADD = $(CEPH_GLOBAL)
> > bin_DEBUGPROGRAMS += ceph_test_crypto
> >
> > And a unittest also depending on libosd;
> >
> > unittest_pglog_SOURCES = test/osd/TestPGLog.cc
> > unittest_pglog_LDADD = $(LIBOSD) $(CEPH_GLOBAL)
> > check_PROGRAMS += unittest_pglog
> >
> > However, libosd requires libos and libosdc, but that dependency is
> set
> > by libosd;
> >
> > LIBOSD += $(LIBOSDC) $(LIBOS)
> >
> > This way, you have the dependencies in the right place. With
> recusive
> > builds you'll need an "LDADD = libosd.la libosdc.la libos.la
> > libglobal.la $(PTHREAD_LIBS) -lm $(CRYPTO_LIBS) $(EXTRALIBS)", so
> > basically you're setting the dependencies of the required libraries
> in
> > the makefile requiring those libraries, which is IMHO way to
> complex.
> >
> >>> I think the benefits of using recursive builds are that it may be
> >>> familiar to the most people, it reflects the methods/suggestions
> in
> >>> the automake manual, and, most importantly, it would seem that its
> use
> >>> forces good decomposition where as a non-recursive approach relies
> on
> >>> guidelines that are easily broken.
> >
> > I don't know how which method is more familiar, but I personally
> think
> > that anyone understanding recursive automake is capable of
> > understanding a simple include :-)
> >
> > The decomposition is a valid argument. I think that there are some
> > libraries which might benefit from complete separation, like
> librados
> > and a "libceph_client" or something like it. Those can be
> separated,
> > but most other can't. The mon, mds, os, and osd subdirs have
> > inter-dependencies for instance.
> >
> > We might need to restructure the source tree anyway because at some
> > points it has grown messy (for instance, libcommon including stuff
> > from mds, mon but also from include). However, I think implementing
> a
> > recursive automake right now forces us to do two things at once;
> > cleanup the makefiles and do some restructuring in the subdirs. I
> > personally think it's best to start with cleaning up makefiles and
> use
> > an include per subdir, so we can restructure the subdirs into
> > segregated libraries later on.
> >
> > So I all boils down to; what to do first :-) Because I agree some
> > things are better of with recursive builds, but it might be wise
> not
> > to do that before we have revisited the source tree layout.
> >
> > Roald
> --
> To unsubscribe from this list: send the line "unsubscribe ceph-devel"
> in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Matt Benjamin
The Linux Box
206 South Fifth Ave. Suite 150
Ann Arbor, MI 48104
http://linuxbox.com
tel. 734-761-4689
fax. 734-769-8938
cel. 734-216-5309
prev parent reply other threads:[~2013-09-08 0:36 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-21 19:45 subdir-objects Roald van Loon
2013-08-21 20:01 ` subdir-objects Noah Watkins
2013-08-21 20:13 ` subdir-objects Roald van Loon
2013-08-21 20:41 ` subdir-objects Sage Weil
2013-08-21 21:01 ` subdir-objects Roald van Loon
2013-09-06 17:27 ` subdir-objects Noah Watkins
2013-09-07 8:52 ` subdir-objects Roald van Loon
2013-09-07 17:38 ` subdir-objects Noah Watkins
2013-09-07 17:47 ` subdir-objects Noah Watkins
2013-09-07 20:11 ` subdir-objects Roald van Loon
2013-09-07 20:39 ` subdir-objects Sage Weil
2013-09-09 11:47 ` subdir-objects Roald van Loon
2013-09-07 21:03 ` subdir-objects Noah Watkins
2013-09-07 23:01 ` subdir-objects Roald van Loon
2013-09-08 23:16 ` subdir-objects Sage Weil
2013-09-09 5:37 ` subdir-objects Roald van Loon
2013-09-08 23:27 ` subdir-objects Milosz Tanski
2013-09-09 5:41 ` subdir-objects Roald van Loon
2013-09-08 0:36 ` Matt W. Benjamin [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1692710180.24.1378600571331.JavaMail.root@thunderbeast.private.linuxbox.com \
--to=matt@linuxbox.com \
--cc=ceph-devel@vger.kernel.org \
--cc=noah.watkins@inktank.com \
--cc=roaldvanloon@gmail.com \
--cc=sage@inktank.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.