automake
[Top][All Lists]
Advanced

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

Re: directory prefix on .o


From: NightStrike
Subject: Re: directory prefix on .o
Date: Thu, 9 Aug 2007 19:08:29 -0400

On 8/9/07, Jan Engelhardt <address@hidden> wrote:
> Hi again :)
>
>
> in a different project, I have a number of files that have the same
> filename, but live in different directories, for example
>
>         project/module1/hooks.c
>         project/module1/m1.c
>         project/module2/hooks.c
>         project/module2/m2.c
>         etc.
>         project/Makefile.am
>
> I'd really like to avoid using make recursion (and all the reasons are
> described in the automake info page nicely). The flat Makefile.am I have
> come up so far is
>
>         lib_LTLIBRARIES = module1.la module2.la
>         module1_la_SOURCES = module1/hooks.c module1/m1.c
>         module2_la_SOURCES = module2/hooks.c module2/m2.c
>         etc.
>
> Unfortunately, it does not seem like the directory is encoded into the
> object file, hence automake will fail on me since it wants to use
> hooks.o for both hooks.c files.
>
> Is it currently possible to make the directory part of the object name,
> e.g.  module1__hooks.o and module2__hooks.o for example? If not, I'm
> going to cook up a patch (*), but I'd wanted to go sure such a feature is
> not already available.

Maybe this is what you need, from the automake manual:

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.




reply via email to

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