在带有 pwd 输出的 Makefile 中使用 printf 格式化输出

formated output with fprint in Makefile with pwd output

在我的 Makefile 中有这个::

update:
    cd pkg_one && git fetch && git rebase
    @printf '  ==> [pkg_one] rebase Done, now in `pwd`\n' 

我尝试让 pwd 的结果与我的 printf commend

一致

您可以使用...从单引号的上下文中删除 `pwd`...

update:
    cd pkg_one && git fetch && git rebase
    @printf '  ==> [pkg_one] rebase Done, now in '`pwd`'\n'

或者,改用双引号...

update:
    cd pkg_one && git fetch && git rebase
    @printf "  ==> [pkg_one] rebase Done, now in `pwd`\n"