With the advent of (idiotic) paths with spaces in them, it's become important to
deal with them.
I was thinking of the following style rule for calling executables:
1. When calling executables, wrap the executable name in double quotes. This is
even more important if a macro is being used instead of a hard-coded executable
name. For example:
Instead of:
ifeq ($(OS),Windows_NT)
CLEARTOOL:=//c/Program Files/Rational/ClearCase/bin/cleartool
else
CLEARTOOL:=/usr/atria/bin/cleartool
endif
help:
$(CLEARTOOL) help
You have:
ifeq ($(OS),Windows_NT)
CLEARTOOL:=//c/Program Files/Rational/ClearCase/bin/cleartool
else
CLEARTOOL:=/usr/atria/bin/cleartool
endif
help:
"$(CLEARTOOL)" help
Aside from "preventing" (ie ignoring) the problem, has anyone else found a good
way to deal with the situation?
Note that I have considered the alternatives of:
CLEARTOOL:="//c/Program Files/Rational/ClearCase/bin/cleartool"
and:
CLEARTOOL:=//c/Program\ Files/Rational/ClearCase/bin/cleartool
The former has a problem when using $(CLEARTOOL) within another set of double
quotes. The latter has a problem when passing $(CLEARTOOL) to another script.
However, wrapping the call in double quotes makes the makefile less legible.
Thanks,
Noel
This communication is for informational purposes only. It is not intended as
an offer or solicitation for the purchase or sale of any financial instrument
or as an official confirmation of any transaction. All market prices, data
and other information are not warranted as to completeness or accuracy and
are subject to change without notice. Any comments or statements made herein
do not necessarily reflect those of J.P. Morgan & Co. Incorporated, its
subsidiaries and affiliates.