When auditing compilation, it is helpful to be able to see all of the
object files passed during the linking step, which ninja can obscure
behind temporary .rsp "response files". Normally, these are deleted
immediately afterwards - but for debugging purposes, it is helpful to
leave them behind to understand what went wrong.

Signed-off-by: John Snow <[email protected]>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 54547a37b1a..9dda1b3c89a 100644
--- a/Makefile
+++ b/Makefile
@@ -151,7 +151,7 @@ NINJAFLAGS = \
         $(filter-out -j, \
           $(or $(filter -l% -j%, $(MAKEFLAGS)), \
                $(if $(filter --jobserver-auth=%, $(MAKEFLAGS)),, -j1))) \
-        -d keepdepfile
+        -d keepdepfile $(if $(DEBUG),-d keeprsp)
 ninja-cmd-goals += $(or $(MAKECMDGOALS), all)
 ninja-cmd-goals += $(foreach g, $(MAKECMDGOALS), $(.ninja-goals.$g))
 
-- 
2.56.0


Reply via email to