This is the mail archive of the automake@gnu.org mailing list for the automake project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

adding subdirectories


Hello,

I build my project in a single directory using automake, like this:

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=\"@sysconfdir@\"
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

Now I want to separate the production targets from the regression tests.
I moved the noinst_PROGRAMS to testsuite/Makefile.am and
AC_SUBST(AM_CFLAGS) in configure.ac. However, now I've got two problems:

1. I was able to escape variable expansion with a backslash
   ("\$(top_srcdir)"), but @sysconfdir@ remains unexpanded.

2. More importantly, I can't build the project any more: make
   immediately dives into testsuite/, files under which require
   libzzz.la, which is going to be built later. If I "make libzzz.la
   all", everything works fine.

How can I overcome these problems (esp. the second one)?

I've put the sources to
http://ata.cs.hun.edu.tr/~ibr/z/z0.tgz  main and test together
http://ata.cs.hun.edu.tr/~ibr/z/z1.tgz  main and test separate, AM_CFLAGS copied
http://ata.cs.hun.edu.tr/~ibr/z/z2.tgz  main and test separate, AM_CFLAGS AC_SUBSTed

Thanks in advance,
Baurzhan.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]