2017-08-31 93 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