But you've left out, again, the most important part of your makefile (this is why I am asking you to create a small _complete_ example that shows the behavior you have a problem with).
After you see the below comments, if you still want me to, I will create a complete example.
Remember that make works from the "root" of the dependency graph _down_; it doesn't work from the leaves _up_.
So, if make is trying to build a file that matches the above rule, then it's because you defined it as a prerequisite like this:
install: ../install/scripts/foo
If you run "make install", then make says "OK, I need to build ../install/scripts/foo". It looks to see if that file exists. If it does, then VPATH is never consulted.
We expect the above behavior.
If it doesn't exist, then if VPATH is defined make uses it to try to find the target. How does this work? Make doesn't really grok the structure of pathnames: to make every pathname is just a string. It appends the string to the end of each directory (adding a "/" separator) in VPATH and checks if _that_ file exists. If it does, then this is the VPATH pathname of that file.
This is how it is working and it is still what we expect it to do. The only surprise is the order in which it is doing this.
Contents of makefile in /u/user/src
.. VPATH=/u/proj/src install: ../install/scripts/foo $(INSTALL) .. ..
/u/user/install is empty and /u/proj/install/scripts/foo exists. gmake says that /u/proj/src/../install/scripts/foo exists and there is nothing to do when I do 'gmake install' in /u/user/src.
However, this behavior changes when /u/user/install/scripts/foo exists and has a modification date earlier than /u/user/src/scripts/foo. 'gmake install' in /u/user/src executes the install command and updated /u/user/install/scripts/foo.
Does it look at the individual paths in VPATH plus the relative targets (../install/scripts/foo, in this case) first or does it look at just the relative targets from the directory of execution first?
It is behaving differently when ../install/scripts/foo exists versus it not existing.
I'm not sure I'm making myself clear, or whether I'm understanding your real problem. All of the above behavior is expected and is not a bug. If you think I'm still missing the point, there _could_ be a bug here, but I'll need you to provide me a small test makefile etc. that will reproduce the problem. Once I can see a complete example I can be sure about whether what you see is correct or not.
You are making yourself clear. I am having a hard time explaining with out a full sample and I am not surprised. It took me a while to isolate the issue.
If the above comments are still not clear, please let me know, I will tar up a sample and send it to you.
Regards, Harsha
[EMAIL PROTECTED] 212.762.4165
This communication is intended for the addressee(s) and may contain confidential and legally privileged information. We do not waive confidentiality or privilege by mis-transmission. If you have received this communication in error, any use, dissemination, printing or copying is strictly prohibited; please destroy all electronic and paper copies and notify the sender immediately.
_______________________________________________ Bug-make mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-make