GNU make的--print-directory
option将打印目录遍历消息,如下所示:
make[1]: Entering directory '/users/clachanc/directory'
make[1]: Leaving directory '/users/clachanc/directory'
make[1]: Entering directory '/users/clachanc/directory2'
make[1]: Leaving directory '/users/clachanc/directory2'
我想将这些消息分开,以便更容易阅读,如下所示:
make[1]: Entering directory '/users/clachanc/directory'
make[1]: Leaving directory '/users/clachanc/directory'
make[1]: Entering directory '/users/clachanc/directory2'
make[1]: Leaving directory '/users/clachanc/directory2'
我该如何做到这一点?
答案 0 :(得分:1)
您必须编辑源代码,否则后处理输出(通过sed或类似方法管道输出)以添加换行符。
如果你想编辑源代码,在GNU的现代版本中,你应该查看output.c
(在GNU make source中),在格式行的末尾添加一个额外的\n
对于这些消息。
要使用sed,请执行以下操作:
make ... | sed '/^make.*: Leaving directory/a\ '