automake
[Top][All Lists]
Advanced

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

Re: How to specify a library as dependecy to a executable


From: Stefano Lattarini
Subject: Re: How to specify a library as dependecy to a executable
Date: Thu, 15 Dec 2011 18:01:27 +0100
User-agent: KMail/1.13.7 (Linux/2.6.30-2-686; KDE/4.6.5; i686; ; )

On Thursday 15 December 2011, ittium  wrote:
> Group,
> I have a Makefile.am which is building a executable. This executable
> depends on certain libraries. I want to put these libraries as dependencies
> to the executable so that when library got build, executable is also built
> (if build from top level dir), I have many tried some option from net e.g
> specifying "LIBRARY=" variable, none is working. Please let me know, how to
> do this.
> thanks
> Ittium
> 
Something like this should work:

  lib_LIBRARIES = libfoo.a
  bin_PROGRAMS = bar
  bar_LDADD = libfoo.a

or better again, in case your library is only useful to build your program
and is not meant to be installed:

  noinst_LIBRARIES = libfoo.a
  bin_PROGRAMS = bar
  bar_LDADD = libfoo.a

For more information about the use of LDADD, see also:

 <http://www.gnu.org/software/automake/manual/automake.html#Linking>

HTH,
  Stefano



reply via email to

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