[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: subdir-objects & depcomp trouble
From: |
Stepan Kasal |
Subject: |
Re: subdir-objects & depcomp trouble |
Date: |
Mon, 3 Oct 2005 14:15:29 +0200 |
User-agent: |
Mutt/1.4.1i |
Hello Patrick,
On Fri, Sep 30, 2005 at 09:48:25AM +0200, Patrick Guio wrote:
> libmylib_la_SOURCES = $(top_srcdir)/src/myfile.cc
this is the problem.
though it might seem counter-intiuitve, you should never specify srcdir
or top_srcdir in your Makefile.am. You should use a relative path, ie.
in lib/Makefile.am you should use:
libmylib_la_SOURCES = ../src/myfile.cc
It's the job of the VPATH feature to find out that this is valid only
in the source tree, effectively transforming it to: lib/../src/myfile.cc
The reason is exactly what you discovered by your experience:
the directory prefix is used not only for finding the source, but also
for dependency tracking and with subdir-objects also for the directory
where the object will be created.
Does this work for you?
(Well, I should admit that I'm mostly guessing. But if it helps you,
you could perhaps forgive me. ;-)
Stepan Kasal
A footnote:
Because top_builddir is always a relative path, it should be safe to use:
libmylib_la_SOURCES = $(top_builddir)/src/myfile.cc
but it really looks confusing, so I don't recommend it, unless necessary.
(If is necessary if the same makefile fragment is included by Makefile.am's
in different depths.)
- Re: subdir-objects & depcomp trouble,
Stepan Kasal <=