Wolfgang Laun wrote:
> Talking about UNIX (vanilla) Make and GNU Make, I'd say that you're in
> for some fun and games if you try to make this robust against spaces in
> path names by using some general set of rules. It would be possible to
> put quotes around all macro expansions where one path name is known to
> be expanded (as in "$(CLEARTOOL)" in your example). But what do you do
> with $^, for instance?

For what it's worth, our toplevel makefile (actually our platform
description, following "Applying RCS and SCCS" by Bolinger and Bronson)
defines an acceptable quote character for the shell (on Windows you have
QUOTE='; on pretty much anything POSIX you have QUOTE=").  Then our
(say) install targets look something like this:

  install : $(VARIOUS_FILES)
      $(INSTALL) $(foreach file,$^,$(QUOTE)$(file)$(QUOTE))
$(INSTALLDIR)

The same platform description of course would cause $(INSTALL) to be,
say, "copy" or "xcopy" or some such on Windows and "cp" or "install"
everywhere else.

GNU make v3.78.

Cheers,
Laird

Reply via email to