Re: behavior on Win depends on whether \ or / is used??
Eli Zaretskii <[email protected]>
| Newsgroups | gmane.comp.gnu.make.windows |
|---|---|
| Message-ID | <[email protected]> |
> From: "Mark Galeck (CW)" <[email protected]> > Date: Sun, 13 Dec 2009 22:21:27 -0800 > Accept-Language: en-US > acceptlanguage: en-US > Cc: > > The makefile is: > > > SHELL=cmd.exe > > vpath %.s ..\foobar0 ..\foobar1 > > %.o: %.s > echo $< > > ..\foobar0\foobar.s: > > > Now, again, please excuse me if I repeat myself, from last time: > > First. The behavior with the above makefile, with the _backward_ slashes, is perfectly fine... it does find the file foobar.s in directory foobar1, no matter the backslashes, it does echo what it's supposed to echo. > > So I don't understand why you are saying that make fails in this case, that it does not find in vpath what it should, ... Nothing like that, it works perfectly fine. I say that Make ``fails'' because it works contrary to what its code intended it to do. If I convert your Makefile to its Unix equivalent: SHELL = /bin/sh vpath %.s ./foobar0 ./foobar1 %.o: %.s echo $< ./foobar0/foobar.s:; and run Make on GNU/Linux, I see the same error message: make: *** No rule to make target `foobar.s', needed by `foobar.o'. Stop. So Make is _supposed_ to behave like that, on GNU/Linux as on Windows. The reason it does _not_ behave like that on Windows when you use backslashes is because the backslashes are handled inconsistently by the Windows port of Make. The details are in my previous message in this thread. The different behavior, to me, is a ``failure'', because Make does not do what its programmer meant. It just so happens that my ``failure'' is your ``success''. But that's a matter of definitions. I hope you at least agree with me that the behavior on Windows with forward slashes is identical to what Make does on GNU/Linux, while the behavior with backslashes is different. I hope you also agree that Make should behave the same with forward and backslashes alike, at least ideally. Now, whether the behavior we see on GNU/Linux is correct or not, is a different question. I hope Paul will chime in and help us out here, because I don't understand what the code in question is doing and why, nor do I understand the commentary in the code which is supposed to explain that. Paul?