automake
[Top][All Lists]
Advanced

[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/Makefile.am (the makefile we are talking about)
<srcdir>/common/map.cpp
<srcdir>/linux/map.cpp

and the above automake file with a section like:
XXX_SOURCES= \
   $(abs_top_srcdir)/common/map.cpp \
   $(abs_top_srcdir)/linux/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:
<build-dir>/blah/XXX/common/map.o
<build-dir>/blah/XXX/linux/map.o

but can also handle a less desirable option:
<build-dir>/blah/XXX/($abs_top_srcdir)/common/map.o
<build-dir>/blah/XXX/($abs_top_srcdir)/linux/map.o

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/Makefile.am: 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):
Makefile:823: 
/home/bcosta/build/gary/../../dev/SV/Gary/X3f_951_client_restructure/src/packet/.deps/audio_server-serverstat.Po:
No such file or directory

There is an existing thread about this problem which it seems nothing
was done to address it:
http://www.mail-archive.com/address@hidden/msg00779.html

So I tried replacing the variable with:
XXX_SOURCES= \
   ../common/map.cpp \
   ../linux/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:
<build-dir>/common/map.o
<build-dir>/linux/map.o

which is no good for my project.


Any help you can give would be greatly appreciated.

Thanks,
Brendon.




reply via email to

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