On Wed, 2003-07-23 at 09:39, Guido Draheim wrote: > Ralf Corsepius wrote: > > Hi, > > > > Simple question: Does automake support filenames containing blanks? > > > > I fear, the answer is no: > > > > # cat Makefile.am: > > data_DATA = foo\ 1 > > > > # make DESTDIR=/tmp install > > .. > > /bin/sh ./mkinstalldirs /tmp/usr/local/share > > mkdir -p -- /tmp/usr/local/share > > /usr/bin/install -c -m 644 ./foo\ /tmp/usr/local/share/foo\ > > /usr/bin/install: cannot stat `./foo\\': No such file or directory > > /usr/bin/install -c -m 644 ./1 /tmp/usr/local/share/1 > > /usr/bin/install: cannot stat `./1': No such file or directory > > make[1]: *** [install-dist_dataDATA] Error 1 > > .. > > > > Either I must be missing something (May-be I am quoting the blank > > incorrectly?) or something is broken ... > > > > # this is what we might expect... > $ for i in hello\ 1 2 ; do echo $i ; done > hello 1 > 2
> the assignment to a variable before for-in might have > been introduced to avoid problems with an empty list > which results in a syntax error on some platforms > (try `for i in; do`) but I've seen other solutions that > work just as well, like > for i in $(libs) : ; test "$$i" != ":" || continue;... Or may-be .. test -n '$(libs)' && for i in '$(libs)'; do ... or if test -n '$(libs)'; then for ... else true; fi I might be wrong, but IIRC automake once had used something similar to this. > Ooops, I just had a look into am/data.am, and there is > the very comment which I've just guessed above: > ## Funny invocation because Makefile variable can be empty, leading to > ## a syntax error in sh. > @list='$(%DIR%_%PRIMARY%)'; for p in $$list; do \ Ralf