[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Alternative Approach to Subdirectories issue
From: |
Ben Pfaff |
Subject: |
Re: Alternative Approach to Subdirectories issue |
Date: |
Fri, 20 Jul 2007 16:23:56 -0700 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) |
Jan Engelhardt <address@hidden> writes:
> Makefile.am contains like:
>
> PROGRAM1_SOURCES := src/p1/foo.c
> PROGRAM2_SOURCES := src/p2/foo.c
>
> Then the following warning will be generated upon `autoreconf -fi`:
>
> Makefile.am: object `foo.lo' created by
> `src/p1/foo.c' and `src/p2/foo.c'
> autoreconf: automake failed with exit status: 1
It sounds like you are not using the subdir-objects option. Here
is its documentation, from the Automake 1.10 manual:
17 Changing Automake's Behavior
*******************************
Various features of Automake can be controlled by options in the
`Makefile.am'. Such options are applied on a per-`Makefile' basis when
listed in a special `Makefile' variable named `AUTOMAKE_OPTIONS'. They
are applied globally to all processed `Makefiles' when listed in the
first argument of `AM_INIT_AUTOMAKE' in `configure.ac'. Currently
understood options are:
[...]
`subdir-objects'
If this option is specified, then objects are placed into the
subdirectory of the build directory corresponding to the
subdirectory of the source file. For instance, if the source file
is `subdir/file.cxx', then the output file would be
`subdir/file.o'.
In order to use this option with C sources, you should add
`AM_PROG_CC_C_O' to `configure.ac'.
--
Ben Pfaff
http://benpfaff.org