Another round of External Core fixes
[ghc-hetmet.git] / compiler / main / DriverMkDepend.hs
index aad9b8a..4155274 100644 (file)
@@ -22,7 +22,7 @@ module DriverMkDepend (
 import qualified GHC
 import GHC             ( Session, ModSummary(..) )
 import DynFlags
-import Util            ( escapeSpaces )
+import Util
 import HscTypes                ( HscEnv, IsBootInterface, msObjFilePath, msHsFilePath )
 import SysTools                ( newTempName )
 import qualified SysTools
@@ -35,6 +35,7 @@ import Panic
 import SrcLoc
 import Data.List
 import CmdLineParser
+import FastString
 
 import ErrUtils         ( debugTraceMsg, putMsg )
 
@@ -248,10 +249,10 @@ findDependency hsc_env src imp is_boot include_pkg_deps
 -----------------------------
 writeDependency :: Handle -> [FilePath] -> FilePath -> IO ()
 -- (writeDependency h [t1,t2] dep) writes to handle h the dependency
---     t1 t2 : dep
+--      t1 t2 : dep
 writeDependency hdl targets dep
-  = hPutStrLn hdl (unwords (map escapeSpaces targets) ++ " : "
-                  ++ escapeSpaces dep)
+  = hPutStrLn hdl (unwords (map forOutput targets) ++ " : " ++ forOutput dep)
+    where forOutput = escapeSpaces . reslash Forwards . normalise
 
 -----------------------------
 insertSuffixes 
@@ -275,7 +276,9 @@ insertSuffixes
 insertSuffixes file_name extras
   = file_name : [ basename <.> (extra ++ "_" ++ suffix) | extra <- extras ]
   where
-    (basename, suffix) = splitExtension file_name
+    (basename, suffix) = case splitExtension file_name of
+                         -- Drop the "." from the extension
+                         (b, s) -> (b, drop 1 s)
 
 
 -----------------------------------------------------------------