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

时间:2018-08-09 21:06:47

标签: makefile printf gnu-make

在我的Makefile中,我有这个:

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

我尝试使pwd的结果与我的printf推荐字对齐

1 个答案:

答案 0 :(得分:1)

您可以使用...从单引号的上下文中删除`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"