automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: question using VPATH'S ...


From: Ralf Wildenhues
Subject: Re: question using VPATH'S ...
Date: Tue, 1 Jul 2008 22:37:15 +0200
User-agent: Mutt/1.5.18 (2008-05-17)

Hello Roberto,

please don't top-post, thank you.

* Roberto Alejandro Espí Muñoz wrote on Tue, Jul 01, 2008 at 08:37:36AM CEST:
> On Mon, Jun 23, 2008 at 12:13 PM, Ralf Wildenhues <address@hidden> wrote:
> > * Roberto Alejandro Espí Muñoz wrote on Sun, Jun 22, 2008 at 06:33:07PM 
> > CEST:
> >> Hi , I read about the possibility of creating VPATHs so that my project
> >> can produce multiple configured outputs in different locations ( build
> >> tree != source tree ).  I'm trying to accommodate that philosophy to
> >> what I want to do.  When I construct all my targets I want them to end
> >> up in specific directories.  For example I would want my binaries to end
> >> up in something like bin/, or my shared objects in lib/.
> >>
> >> Is there any way  I can do this?? Is VPATH the way??
> >
> > Yes.  Most likely you won't have to do anything, you esp. don't have to
> > set VPATH yourself.  But you should read up on the three different
> > trees: the source tree, the build tree, and the install tree.
> >
> > This chapter of the Automake manual walks you through several autotools
> > features, including those you're looking for:
> > <http://www.gnu.org/software/automake/manual/html_node/Autotools-Introduction.html>

> Ok, I thinks I didn't explain myself correctly then ... From what I
> saw there I can use either bindir, libdir or includedir for when I'm
> installing the completed targets.  What I want to do is to locate them
> before that moment.

You can.

1) Headers: 
Generated headers live in the build tree, thus can be found with
relative paths -I../include -I../src or -I$(top_builddir)/include or
similar, depending on your directory layout.  Non-generated headers live
in the source tree, thus can be found with -I$(srcdir) or
-I$(top_srcdir)/include or similar.  Also read about AM_CPPFLAGS and
provided defaults here:
<http://www.gnu.org/software/automake/manual/html_node/Program-variables.html>

2) Programs:
Live in the build tree, in the directory in which you have listed them
in the Makefile.am.

3) Libraries:
Live in the build tree, in the directory in which you have listed them
in the Makefile.am.  Do *NOT* use the .libs subdirectory.  For example,
lib/Makefile.am builds libfoo.la, and src/Makefile.am builds
  bin_PROGRAMS = prog

which should use libfoo, then you use
  prog_LDADD = ../lib/libfoo.la

and be done with it.

> I noticed that all my libs and binaries are
> ending up in a hidden .libs directory.  What I would like to do is
> determine exactly where my targets end up in my project directory
> before I install them.  All my binaries on a bin subdirectory for
> example, or my shared objects in a lib directory, my object files in a
> obj directory.

You will not have fun with automake if you insist on this structure.
You can, but it won't be fun, and it won't be useful, as Stepan already
noted.  What you can do is lay out your source tree in such a way as you
like, and then use things as described above.

Hope that helps.

Cheers,
Ralf




reply via email to

[Prev in Thread] Current Thread [Next in Thread]