Michael Sterrett writes:

 > How can I produce the functionality of the perl function join() in gmake.

Use the join function.

 > I have a list of directories:
 > 
 >     A = /usr/bin /bin
 > 
 > and I want this:
 > 
 >     A = /usr/bin:/bin
 > 
 > Something like this I thought would work in gmake, but doesn't seem to:
 > 
 >     A := $(subst  ,:,$(A))

This is a different question, relating to whitespace.  Make ignores
whitespace before the argument, so it thinks you are trying to replace
nothing (an empty argument) with ":".

You have to do this (this is described somewhere in the make manual,
but it's not convenient for me to look it up just at the moment):

  E := # empty variable
  S := $(E) # variable containing one space

  A := $(subst $(S),:,$(A))

_______________________________________________
Help-make mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-make
  • join? Michael Sterrett -Mr. Bones.-
    • Paul D. Smith

Reply via email to