bug-make
[Top][All Lists]
Advanced

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

canonicalization/stripping of leading ./


From: dherring
Subject: canonicalization/stripping of leading ./
Date: Wed, 28 Nov 2007 15:53:26 -0500 (EST)

Here's an example makefile:

cat <<_EOF > Makefile
test.out: ./script.sh
        $< > $@
_EOF

Now when I run make, it executes
`script.sh > test.out`
instead of `./script.sh > test.out`

This is all fine when 'PATH=.:<stuff>', and sometimes acceptable when 'PATH=<stuff>:.'; but in the general case, its very bad.

I'm working around this by changing my makefiles to

cat <<_EOF > Makefile
test.out: ./script.sh
        ./$< > $@
_EOF

but that doesn't seem too good either; maybe it should always be

cat <<_EOF > Makefile
test.out: $(srcdir)/script.sh
        $(srcdir)/$< > $@
_EOF

??

Bug reports #15338 and #17230 cover this same issue, but I haven't seen any followup, neither on Savannah nor on these lists.

The closest discussion I could find was #10708, mentioned in
http://lists.gnu.org/archive/html/help-make/2006-03/msg00231.html

What's the official scoop? Are there plans to fix/change this behavior? In the meantime, how should I code the above Makefile (where an output file should be rebuilt whenever its script changes)?

Thanks,
Daniel




reply via email to

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