[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: using VPATH in depend2.am?
From: |
Harald Dunkel |
Subject: |
Re: using VPATH in depend2.am? |
Date: |
Fri, 21 Oct 2005 09:49:58 +0200 |
User-agent: |
Debian Thunderbird 1.0.2 (X11/20050402) |
Hi Stepan,
Stepan Kasal wrote:
>
> So I suppose something like this
>
> `IFS=:; for d in '' '$(srcdir)' $(VPATH); do \
> test -n "$$d" && d=$$d/; \
> test -f "$$d"%SOURCE% && echo "$$d" && break; \
> done`%SOURCE%
>
> Could you test whether this works for you?
>
Something like
IFS=:; for d in a:b; do echo $d; done
works for Sun's /bin/sh, but not for Bash 2.05b (even if you
use --posix). The Bash folks say that this has been done to
fix a security hole.
I have another concern: In your version $(srcdir) gets
a higher priority than the $(VPATH) set in Makefile.am. If
Automake instantiates the suffix rules to generate *.o files,
then this is different, AFAICS.
So how about this?
`IFS=:; x=":$(VPATH)"; \
for d in $$x; do \
test -n "$$d" && d=$$d/; \
test -f "$$d"%SOURCE% && echo "$$d" && break;
done`%SOURCE%
It allows the writer of Makefile.am to completely ignore
$(srcdir), if he wants to.
Regards
Harri