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 = libzzz.la
> > 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=\"@[EMAIL PROTECTED]"
> > zzz_LDADD = @ZZZ_LIBS@ $(top_builddir)/libzzz.la
> > test1_LDADD = @ZZZ_LIBS@ $(top_builddir)/libzzz.la
> > test2_LDADD = @ZZZ_LIBS@ $(top_builddir)/libzzz.la
> > test3_LDADD = @ZZZ_LIBS@ $(top_builddir)/libzzz.la

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

zzz_DEPENDENCIES = libzzz.la
test1_DEPENDENCIES = libzzz.la
test2_DEPENDENCIES = libzzz.la
test3_DEPENDENCIES = libzzz.la

This works, but clutters Makefile.am (I'm planning to have at least
hundreds of tests). Is there a way to specify that binaries should
depend on the libraries they are linked with (i.e., that a general LDADD
implies general DEPENDENCIES or generates the respective dependencies
automatically)? The goal is to be able to build unit tests via
specifying them in noinst_PROGRAMS only (AM_CFLAGS and LDADD are
AC_SUBST'ed).

Thanks in advance,
Baurzhan.


Reply via email to