[Top][All Lists]

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

Re: adding subdirectories

From: Alexandre Duret-Lutz
Subject: Re: adding subdirectories
Date: Thu, 10 Mar 2005 00:26:36 +0100
User-agent: Gnus/5.110003 (No Gnus v0.3) Emacs/21.3.50 (gnu/linux)

>>> "Baurjan" == Baurjan Ismagulov <address@hidden> writes:

 Baurjan> On Mon, Mar 07, 2005 at 02:27:25PM +0100, Nicolas Joly wrote:
 >> > AUTOMAKE_OPTIONS = dejagnu
 >> > bin_PROGRAMS = zzz
 >> > noinst_PROGRAMS = test1 test2 test3
 >> > noinst_LTLIBRARIES =
 >> > zzz_SOURCES = zzz.c
 >> > libzzz_la_SOURCES = a/a.c b/b.c
 >> > AM_CFLAGS = -g -Wall -std=c99 -I$(top_srcdir)/include @ZZZ_CFLAGS@ 
 >> > -DSYSCONFDIR=\"@address@hidden"
 >> > zzz_LDADD = @ZZZ_LIBS@ $(top_builddir)/
 >> > test1_LDADD = @ZZZ_LIBS@ $(top_builddir)/
 >> > test2_LDADD = @ZZZ_LIBS@ $(top_builddir)/
 >> > test3_LDADD = @ZZZ_LIBS@ $(top_builddir)/

1) since is referenced as `' in noinst_LTLIBRARIES,
  a) it is built built is the current directory
  b) you should reference it as `' anywhere else in the same 
     Makefile (BSD Make is not able to guess that ./ is the 
     same file as, for instance).
So all these $(top_builddir)/ really should be

2) the `LDADD' variable contains the default definition for
all *_LDADD variables.  So linking all you programs against the
same libraries requires only one line (LDADD = $(ZZZ_LIBS)

 Baurjan> I haven't found a way of specifying dependencies between different
 Baurjan> makefiles. I've reverted to a single and specified the
 Baurjan> dependencies manually, like this:

 Baurjan> zzz_DEPENDENCIES =
 Baurjan> test1_DEPENDENCIES =
 Baurjan> test2_DEPENDENCIES =
 Baurjan> test3_DEPENDENCIES =

When you write 

 zzz_LDADD = $(ZZZ_LIBS)

automake generates 



 Baurjan> Is there a way to specify that binaries should depend
 Baurjan> on the libraries they are linked with (i.e., that a
 Baurjan> general LDADD implies general DEPENDENCIES or
 Baurjan> generates the respective dependencies automatically)?

This is what happens.
Alexandre Duret-Lutz

reply via email to

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