Mon 29 Nov 2004 02:50:22 AM UTC, comment #1:
This is not a bug in GNU make, at least not directly. GNU make is not looking for PWD.EXE; their makefile contains this code to look for it:
PWD:=$(strip $(wildcard $(addsuffix /pwd.exe,$(SEARCHPATH))))
The addsuffix function is quite clear that it splits words on whitespace, so it is not an appropriate function to use for this purpose if there is whitespace that you do NOT want to be split.
To do what they want they will have to be much more creative; probably by replacing any whitespace in the SEARCHPATH with some other character to hide it; maybe something like this:
E = #empty var
S = $E $E
_XSEARCHPATH := $(subst ;, ,$(subst $S,%,$(SEARCHPATH)))
PWD := $(strip $(foreach D,$(_XSEARCHPATH),$(wildcard $(subst %, ,$(D))/pwd.exe)))
Note this is untested, but basically it replaces all the whitespace in SEARCHPATH with a token (here '%') which can't be a legal token to appear in a filename; then it replaces all ";" with a space, then for each word (space-separated value) in the resulting path it changes the token ('%') back to space and uses wildcard on that plus '/pwd.exe' to see if it exists.
Note I wrote this from scratch and have not tested it, but it should work. If you don't think '%' is a good token (because it might be used in a filename) then you can pick another one.
It's a known fact that make does not handle spaced in pathnames very well at all so perhaps an argument could be made that this is another facet of that problem.
|