echo-cmd = $(if 1,\ $(info $(escchar)) && echo ' $(call escchar,$($(quiet)cmd_$(1)))' ;) Syntax error: "&&" unexpected
时间: 2023-08-05 13:08:54 浏览: 46
CMD-DOS下符号的作用
The error message suggests that there is a problem with the use of `&&` in this variable definition. In Makefiles, the `&&` operator is used to chain commands together so that the second command only runs if the first command was successful. However, this syntax is not supported in all contexts.
To fix the error, you could try breaking up the commands into separate lines, like this:
```
echo-cmd = $(if 1, \
$(info $(escchar)) ; \
echo ' $(call escchar,$($(quiet)cmd_$(1)))' ; \
)
```
This splits the two commands into separate lines with a semicolon `;` between them. This should work in most contexts and avoid the syntax error you encountered.
阅读全文