2017-08-31 57 views
2

当构建链规则时,会自动调用rm以在构建过程结束时删除任何中间文件。由于我有大约400个中间文件以这种方式删除,导致控制台输出很糟糕。make - 无提示地删除中间文件

有没有办法让这些中间文件静静地等待,这样在构建完成后没有任何东西会被回显,或者像“删除中间文件”这样的消息被回显?

回答

2

您可以运行make -s或建立你自己的这个补丁应用做出的版本:

diff --git file.c file.c 
index ae1c285..de3c426 100644 
--- file.c 
+++ file.c 
@@ -410,18 +410,6 @@ remove_intermediates (int sig) 
        { 
        if (! doneany) 
         DB (DB_BASIC, (_("Removing intermediate files...\n"))); 
-     if (!silent_flag) 
-      { 
-      if (! doneany) 
-       { 
-       fputs ("rm ", stdout); 
-       doneany = 1; 
-       } 
-      else 
-       putchar (' '); 
-      fputs (f->name, stdout); 
-      fflush (stdout); 
-      } 
        } 
       if (status < 0) 
        perror_with_name ("unlink: ", f->name); 
+0

-s是不大不小的解决方案,但我想我不能只是编译我自己的版本,因为别人有为了能够编译我的代码,并且我不想要不一致 – user2642796