[Top][All Lists]

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

Keeping source directory structure

From: Brendon Costa
Subject: Keeping source directory structure
Date: Wed, 24 Mar 2010 12:58:32 +1100

Hi all,

I have been using automake for a while now, however I recently came
across an issue i haven't had to worry about before, which is having
duplicate named source files under different directory structures
producing conflicting object files.

Say i have a source directory structure like:
<srcdir>/blah/ (the makefile we are talking about)

and the above automake file with a section like:
   $(abs_top_srcdir)/common/map.cpp \

where abs_top_srcdir is a variable i define in my configure script
that is an absolute path to the top_srcdir (to avoid the ..'s) and is
used in the sources instead of $(top_srcdir)

What i really want is to build all the object files like:

but can also handle a less desirable option:

Is there any way I can do this with automake? Or is there any plan to
support something like this?

I am using automake version: 1.11

I have described below what options Ihave tried:

The error i get running automake using the first configuration is similar to:
blah/ object `XXX-map.$(OBJEXT)' created by
`$(top_srcdir)/common/map.cpp' and `$(top_srcdir)/linux/map.cpp'

I then looked at the subdir-objects automake option to solve this
problem. Using this fails with an error like (this error message comes
from the real code not the above simple example, but gives an idea of
the error):
No such file or directory

There is an existing thread about this problem which it seems nothing
was done to address it:

So I tried replacing the variable with:
   ../common/map.cpp \

This will kind of build, though the location it is putting the object
files in is really bad and conflicts with those from other makefiles.
I.e. they are going into:

which is no good for my project.

Any help you can give would be greatly appreciated.


reply via email to

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