转义makefile中的字符';添加前缀';
我有一份图书馆清单:转义makefile中的字符';添加前缀';,makefile,Makefile,我有一份图书馆清单: lib_paths := dir1 dir2 dir3 我想通过 LDFLAGS += (addprefix -Wl,-rpath,$(lib_paths)) 当然,这会失败,因为,是makefile中addprefix函数的分隔符。如何转义逗号?必须将其放入变量中。Make将在展开参数之前打断逗号上的参数,因此: comma = , LDFLAGS += $(addprefix -Wl$(comma)-rpath,$(lib_paths))
lib_paths := dir1 dir2 dir3
我想通过
LDFLAGS += (addprefix -Wl,-rpath,$(lib_paths))
当然,这会失败,因为
,
是makefile中addprefix
函数的分隔符。如何转义逗号?必须将其放入变量中。Make将在展开参数之前打断逗号上的参数,因此:
comma = ,
LDFLAGS += $(addprefix -Wl$(comma)-rpath,$(lib_paths))