我试图定义一个字符串X =“或者'这个'那个'”但GNU make不会接受它(I am trying to define a string X=“either 'this|that'” but GNU make won't accept it)
我正在尝试为GNU make编写一个Makefile。 我无法弄清楚这里的问题是什么:
foo := this|works bar := "I lost my 'single quotes'" baz := 'make|will|not|accept|this|with|the|single|quotes' whatIWant := "A string with its 'single|quoted|regex|alternatives'" this-almost-works: #But the single quotes are lost. @printf '%s ' "$(whatIWant)" this-fails-horribly: @printf '$(whatIWant)'我收到以下错误消息
/bin/sh: 1: quoted: not found /bin/sh: 1: /bin/sh: 1: regex: not foundalternatives": not found blah blah Error 127为什么尝试在shell中运行此字符串的一部分?
如何定义变量以准确包含whatIWant的内容?
I am trying to write a Makefile for GNU make. I can't figure out what the problem is here:
foo := this|works bar := "I lost my 'single quotes'" baz := 'make|will|not|accept|this|with|the|single|quotes' whatIWant := "A string with its 'single|quoted|regex|alternatives'" this-almost-works: #But the single quotes are lost. @printf '%s ' "$(whatIWant)" this-fails-horribly: @printf '$(whatIWant)'I get the following error message
/bin/sh: 1: quoted: not found /bin/sh: 1: /bin/sh: 1: regex: not foundalternatives": not found blah blah Error 127Why is it trying to run parts of this string in the shell?
How can I define a variable to contain exactly the contents of whatIWant?
更多推荐
发布评论