[Top][All Lists]

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

RE: VPATH file rename is not detected by $<

From: Bauernberger, Joachim (EXT-Other - DE/Ulm)
Subject: RE: VPATH file rename is not detected by $<
Date: Thu, 9 Jun 2011 12:23:41 +0200


Thanks for looking into this Eddy!

The behavior depends on the VPATH directory order

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 

   %.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.


-----Original Message-----
From: ext Edward Welbourne [mailto:address@hidden 
Sent: Thursday, June 09, 2011 9:48 AM
To: Bauernberger, Joachim (EXT-Other - DE/Ulm)
Cc: address@hidden
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.


reply via email to

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