Mail Archives: djgpp/1998/12/09/10:30:33
On Wed, 9 Dec 1998, Jeff Williams wrote:
> There is one problem, however, that I can't seem to fix by fiddling with the
> bash environment variables: a colon-delimited directory list in makefiles
> (e.g., in a vpath statement) will not be recognized, even if PATH_SEPARATOR=:
> For some reason I must use semicolons (or spaces).
The reason for this is that VPATH and vpath are processed by Make itself,
and Make doesn't know anything about PATH_SEPARATOR. That feature is
unique to Bash.
Obviously, you cannot use a colon in DOS-style VPATH/vpath variables,
since they can legitimately include drive letters.
> Is it possible to use colon-delimited directory lists in makefiles (vpath
> and elsewhere) under bash simply by setting the environment variables
> appropriately, or will I need in this case to resort to the OS-dependent
> separator as you described?
One portable way to handle this nuisance is to say this in the Makefile:
ifneq ($(COMSPEC),)
sep = ;
else
sep = :
endif
and then use $(sep) in VPATH and vpath. (You might need to handle the
blanks around the colon and semi-colon, I'm not sure.)
- Raw text -