X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=compiler%2Fmain%2FDriverMkDepend.hs;h=4155274e313cef63dcd164d49fd4fb4906a5264d;hb=4c6a3f787abcaed009a574196d82237d9ae64fc8;hp=b24c14e6b3b01449db0e8b204f3988be4186e281;hpb=317fc69d18eda68fd65f5ba634feafbe4a3923da;p=ghc-hetmet.git diff --git a/compiler/main/DriverMkDepend.hs b/compiler/main/DriverMkDepend.hs index b24c14e..4155274 100644 --- a/compiler/main/DriverMkDepend.hs +++ b/compiler/main/DriverMkDepend.hs @@ -1,3 +1,10 @@ +{-# OPTIONS -w #-} +-- The above warning supression flag is a temporary kludge. +-- While working on this module you are encouraged to remove it and fix +-- any warnings in the module. See +-- http://hackage.haskell.org/trac/ghc/wiki/Commentary/CodingStyle#Warnings +-- for details + ----------------------------------------------------------------------------- -- -- Makefile Dependency Generation @@ -15,7 +22,7 @@ module DriverMkDepend ( import qualified GHC import GHC ( Session, ModSummary(..) ) import DynFlags -import Util ( escapeSpaces, splitFilename, joinFileExt ) +import Util import HscTypes ( HscEnv, IsBootInterface, msObjFilePath, msHsFilePath ) import SysTools ( newTempName ) import qualified SysTools @@ -28,6 +35,7 @@ import Panic import SrcLoc import Data.List import CmdLineParser +import FastString import ErrUtils ( debugTraceMsg, putMsg ) @@ -35,6 +43,7 @@ import Data.IORef ( IORef, readIORef, writeIORef ) import Control.Exception import System.Exit ( ExitCode(..), exitWith ) import System.Directory +import System.FilePath import System.IO import SYSTEM_IO_ERROR ( isEOFError ) import Control.Monad ( when ) @@ -240,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 @@ -265,9 +274,11 @@ insertSuffixes -- Lots of other things will break first! insertSuffixes file_name extras - = file_name : [ basename `joinFileExt` (extra ++ "_" ++ suffix) | extra <- extras ] + = file_name : [ basename <.> (extra ++ "_" ++ suffix) | extra <- extras ] where - (basename, suffix) = splitFilename file_name + (basename, suffix) = case splitExtension file_name of + -- Drop the "." from the extension + (b, s) -> (b, drop 1 s) -----------------------------------------------------------------