bug-make
[Top][All Lists]
Advanced

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

[bug #30829] vpath conflict with file mention in makefile vs file on dis


From: Paul D. Smith
Subject: [bug #30829] vpath conflict with file mention in makefile vs file on disk
Date: Sun, 8 Jan 2023 14:44:51 -0500 (EST)

Follow-up Comment #1, bug #30829 (project make):

I checked this with GNU Make 4.4(.1) and see the same behavior still.  In the
success case if we add -d and examine the output we get (extracting the
interesting bits):

   Trying pattern rule '%.enu: %.h' with stem 'boo'.
   Trying implicit prerequisite 'boo.h'.
   Found prerequisite 'boo.h' as VPATH 'sue/boo.h'.
   Found implicit rule '%.enu: %.h' for 'boo.enu'.
    Considering target file 'boo.h'.
     Looking for an implicit rule for 'boo.h'.
     No implicit rule found for 'boo.h'.
     Finished prerequisites of target file 'boo.h'.
    No need to remake target 'boo.h'; using VPATH name 'sue/boo.h'.

We locate sue/boo.h via VPATH and it exists, and we don't have to remake it,
so we succeed.

If we run in the failure case, we get this:

   Trying pattern rule '%.enu: %.h' with stem 'boo'.
   Trying implicit prerequisite 'boo.h'.
   Found prerequisite 'boo.h' as VPATH 'woo/boo.h'.
   Found implicit rule '%.enu: %.h' for 'boo.enu'.
    Considering target file 'woo/boo.h'.
     File 'woo/boo.h' does not exist.
     Looking for an implicit rule for 'woo/boo.h'.
     No implicit rule found for 'woo/boo.h'.
     Finished prerequisites of target file 'woo/boo.h'.
    Must remake target 'woo/boo.h'.

and we fail because we don't know how to create woo/boo.h.  Here we can see
that we say we found woo/boo.h via VPATH, but in fact there is no file named
woo/boo.h so it should not have been found.

It appears it was found because the mention of this file in this rule:

a.o: woo/boo.h

caused make to visualize it as a target that could be built, and so the vpath
search finds it.

I'm not actually sure what if anything we should do about this.  I think it's
intentional that make will check the set of targets that could be created for
vpath matches.

Maybe we need to change things so that instead of giving up if we can't build
a non-existing VPATH match, instead we try to find another vpath match for the
file.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?30829>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

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