Re: specifying target directories in non-recursive automake

2006-02-24 Thread Gary V. Vaughan
John Darrington wrote:
 I've been trying to convert a rather largish automake controlled
 project from a recursive style build system, to a non-recursive one.
 I was rather suprised to see that automake decides to put all the
 object files in the root directory; not only ugly, but destroys the
 namespaces afforded by each directory.
 
 Consequently, things are falling down when in the cases where there
 are identically names source files in different directories. For
 example, this simple Makefile.am complains about main.o being created
 twice, when the two main.c files are clearly separate.
 
 bin_PROGRAMS = prog1/foo prog2/bar
 
 prog1_foo_SOURCES = prog1/main.c
 
 prog2_bar_SOURCES = prog2/main.c
 
 
 Reading the manual suggests that I should be able to prefix the
 SOURCES variables with nobase_ but it doesn't seem to work.
 
 Can anyone tell me the correct way to create a non-recursive automake
 system, which might have identically named source files?

In your configure.ac, make sure AM_INIT_AUTOMAKE is given the
subdir-objects option (you'll also need a recent automake):

  AM_INIT_AUTOMAKE([1.9 subdir-objects])

HTH,
Gary.
-- 
Gary V. Vaughan  ())_.  [EMAIL PROTECTED],gnu.org}
Research Scientist   ( '/   http://tkd.kicks-ass.net
GNU Hacker   / )=   http://www.gnu.org/software/libtool
Technical Author   `(_~)_   http://sources.redhat.com/autobook



signature.asc
Description: OpenPGP digital signature


Re: specifying target directories in non-recursive automake

2006-02-23 Thread Ralf Wildenhues
Hi John,

* John Darrington wrote on Mon, Feb 20, 2006 at 03:42:37AM CET:
 I've been trying to convert a rather largish automake controlled
 project from a recursive style build system, to a non-recursive one.
 I was rather suprised to see that automake decides to put all the
 object files in the root directory; not only ugly, but destroys the
 namespaces afforded by each directory.

Read up on the Automake option subdir-objects in the documentation.
To specify per-package like this:

AC_INIT([foo-package], [1.23], [EMAIL PROTECTED])
AM_INIT_AUTOMAKE([subdir-objects ...])

or per-Makefile.am in `AUTOMAKE_OPTIONS = ...'.  I prefer the first
usually.

Cheers,
Ralf