请向我解释一下这行 make 的作用(
subst
部分)?
TRACK_CFLAGS = $(CC):$(subst ','\'',$(ALL_CFLAGS)):$(USE_GETTEXT_SCHEME)
我认为应该用 \' 替换单引号字符。
这将解释:
$ cat Makefile
in := 'aa'bb'
out_wrong := $(subst ','\'',$(in))
out_right := $(subst ',\',$(in))
$(info in=[$(in)])
$(info $$(subst ','\'',$$(in)) = [$(out_wrong)] (wrong))
$(info $$(subst ',\',$$(in)) = [$(out_right)] (right))
all:
$ make
in=['aa'bb']
$(subst ','\'',$(in)) = ['\''aa'\''bb'\''] (wrong)
$(subst ',\',$(in)) = [\'aa\'bb\'] (right)
make: Nothing to be done for 'all'.