1 2 3 4 5 6 7 8 9 10 11
# http://www.gnu.org/software/make/manual/make.html#Syntax-of-Functions comma:= , empty:= space:= $(empty) $(empty) foo:= a b c bar:= $(subst $(space),$(comma),$(foo)) # bar is now `a,b,c' test: echo $(bar) echo $(subst ,repl,str)