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
