How to replace single-quote by space in a Makefile
I am able to replace anything with anything else in a GNU makefile. But can't work out how to replace single-quote with spaces. Any help!
EDIT: I have tried something like this:
$(subst \', :, $(text))
In above I am trying to re开发者_Python百科place single-quotes with colons, but it doesn't seem to work.
Seems to work as expected:
$ cat Makefile
FOO="'"
BAR=$(subst ', :,$(FOO))
BAZ="This 'is 'some 'te'xt' wi't'h in'ter'sper'sed' apo'stro'phe's"
QUX=$(subst ', ,${BAZ})
ARF=$(subst ',:,$(BAZ))
.PHONY: all
all:
@echo FOO = ${FOO}
@echo BAR = ${BAR}
@echo BAZ = ${BAZ}
@echo QUX = ${QUX}
@echo ARF = ${ARF}
$ make
FOO = '
BAR = :
BAZ = This 'is 'some 'te'xt' wi't'h in'ter'sper'sed' apo'stro'phe's
QUX = This is some te xt wi t h in ter sper sed apo stro phe s
ARF = This :is :some :te:xt: wi:t:h in:ter:sper:sed: apo:stro:phe:s
精彩评论