Re: make target / dependency names with spaces
grischka <[email protected]>
| Newsgroups | gmane.comp.gnu.make.windows |
|---|---|
| Message-ID | <[email protected]> |
Eli Zaretskii wrote: >>> This will only work in the commands (where simple quoting will also >>> work), but not in targets and dependencies, which is what the OP >>> wants. >> >> You probably meant: This will only work in targets and dependencies >> but not in commands. > > No, I meant what I said, but it looks like I was mistaken, sorry. > Somehow, I remembered Paul saying that file names with blanks cannot > be supported, but my failing memory betrayed me again, or so it seems. Whatever, somebody, must have put some code into gmake that to some point does support spaces in filenames. However it's true that it's too inconsistent to be practically useful. >> some\ program\ name.exe : some\ file.c other\ file.c >> @echo gcc $^ -o $@ >> some\ file.c other\ file.c : >> @echo touch $@ >> >> touch some file.c >> touch other file.c >> gcc some file.c other file.c -o some program name.exe > > Of course, in a real-life example, some additional juggling will be > needed, because each file name with spaces needs to be quoted on the > command line, or else: > > touch some file.c > touch some file.c > touch other file.c > touch other file.c > gcc some file.c other file.c -o some program name.exe > gcc some file.c other file.c -o some program name.exe > gcc: program: No such file or directory > gcc: name.exe: No such file or directory > make: *** [some program name.exe] Error 1 > > (And `touch' creates the files `some', `other', and `file.c'.) > > Quoting inside $^ is not entirely trivial. I'd really like to see how you solved that impossibility in a "not entirely trivial" way.