From 5db3b4cff15fbcaa74c881b5dd5e39f7cade08d5 Mon Sep 17 00:00:00 2001
From: Simon Marlow <marlowsd@gmail.com>
Date: Tue, 3 Jan 2012 10:28:39 +0000
Subject: [PATCH] Don't record outputFile in the hashed flags

We don't want

    ghc --make M -o <file>

to force recompilation of all modules when <file> changes.  The -o
value is already taken into account by the recompilation machinery
when we check the modification time on the object file or the
executable.
---
 compiler/iface/FlagChecker.hs | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/compiler/iface/FlagChecker.hs b/compiler/iface/FlagChecker.hs
index 611228e5673d..5e4a7092bfa6 100644
--- a/compiler/iface/FlagChecker.hs
+++ b/compiler/iface/FlagChecker.hs
@@ -41,7 +41,9 @@ fingerprintDynFlags DynFlags{..} nameio =
         -- -i, -osuf, -hcsuf, -hisuf, -odir, -hidir, -stubdir, -o, -ohi
         paths = (map normalise importPaths,
                    [ objectSuf, hcSuf, hiSuf ],
-                   [ objectDir, hiDir, stubDir, outputFile, outputHi ])
+                   [ objectDir, hiDir, stubDir, outputHi ])
+                   -- NB. not outputFile, we don't want "ghc --make M -o <file>"
+                   -- to force recompilation when <file> changes.
 
         -- -fprof-auto etc.
         prof = if opt_SccProfilingOn then fromEnum profAuto else 0
-- 
GitLab