Hi,

Thanks for looking into this Eddy!

The behavior depends on the VPATH directory order

e.g.
VPATH = a b, mv a => b does not work
VPATH = a b, mv b => a works correct
VPATH = b a, mv b => a works
VPATH = b a, mv a => b does not work

To illustrate this better the script attached in the bug-report was
modified to use the method for dependency file generation described at 
http://make.paulandlesley.org/autodep.html.


   %.o : %.c
           $(COMPILE.c) -MD -o $@ $<
           @cp $*.d $*.P; \
             sed -e 's/#.*//' -e 's/^[^:]*: *//' -e 's/ *\\$$//' \
                 -e '/^$$/ d' -e 's/$$/ :/'<  $*.d>>  $*.P; \
             rm -f $*.d


So either VPATH or dependency generation does not work properly.

Cheers,
Joachim


-----Original Message-----
From: ext Edward Welbourne [mailto:e...@opera.com] 
Sent: Thursday, June 09, 2011 9:48 AM
To: Bauernberger, Joachim (EXT-Other - DE/Ulm)
Cc: bug-make@gnu.org
Subject: Re: VPATH file rename is not detected by $<

I got lost in your perl script, so may have missed something; but it
*looks* as if what's happening is that your .d.cmd file records the
prior path of what was $< on your previous run; so the .o file depends
on that (as well as the newly renamed file that's $<) and this is the
problem, not the fact that $< is missing.

I suspect (although I'm no expert on VPATH) that the fix for this is
for your perl script to strip, from each prerequisite listed in the
*.d file, any prefix that's present in VPATH.  Then the .d.cmd file
will list paths relative to VPATH and the VPATH machinery shall take
care of things moving among its directories.

        Eddy.

_______________________________________________
Bug-make mailing list
Bug-make@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-make

Reply via email to