Date: Tue, 23 Feb 1999 10:45:27 +0200 (IST) From: Eli Zaretskii X-Sender: eliz AT is To: "Salvador Eduardo Tropea (SET)" cc: djgpp-workers AT delorie DOT com Subject: Re: Bug in make? In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp-workers AT delorie DOT com On Mon, 22 Feb 1999, Salvador Eduardo Tropea (SET) wrote: > make -f m2.mak > make.exe[1]: Entering directory `c:/980127/new/new/9901/mail/pp' > E:\DJ\BIN/make.exe -f m3.mak > make.exe[1]: *** [pepe.c] Error -1 Sigh. This is an unfortunate side-effect of the backslash problem (the file README.DOS explicitly tells you to stay away of backslashes as much as you can). Currently, you cannot use backslashes in commands except as escape characters or in pairs, like in "E:\\DJ\\BIN/make.exe". I will try to see what can possibly be done to correct this, at least in part, but don't hold your breath: it's a tough one to solve. Here's why. - Many Makefiles which come from Unix expect the backslash to quote any character, not just " and '. For example, they might use "\$" to get a dollar, or "\ " to get a space. We don't want to break these cases. - Some non-DJGPP programs invoked by Make choke on Unix-style path names, so the user must have a way of passing backslashed names if that is required. For these and several other reasons, and, more generally, since Make cannot possibly know what is it that the user is trying to accomplish, it should not (IMHO) blindly replace backslashes with forward slashes. > Even when the solution is just be coherent and use $(MAKE) in all the places: The use of $(MAKE) is not just for coherency; it is to ensure that you invoke the same executable throughout the job. If you don't use $(MAKE), you can get all kinds of surprises, like if a Makefile tinkers with PATH, or if there's a local file called `make.bat', or if the top-level Makefile was run with a program called something like `gmake' etc. For these reasons, you should always use $(MAKE) in recursive Makefiles. > 1) It works in Linux. Small wonder, indeed: Linux doesn't have to cope with the backslash schizophrenia. > 2) I don't see why "E:\DJ\BIN/make.exe -f m3.mak" should fail. Because the backslashes are stripped, and what DOS gets from spawnvpe is "E:DJBIN/make.exe", which fails. > 3) The variable should be expanded with forward slashes. Every variable or just $(MAKE)? If you mean every variable, I think it's wrong: it will prevent you from ever having a variable with backslashes. But even if you mean to have a special treatment for $(MAKE), I'm not sure it should be done. Somebody could say something like this: command.com /c $(MAKE) This won't work with forward slashes. It's a mess...