[project @ 2005-05-17 09:21:53 by simonmar]
[ghc-hetmet.git] / ghc / compiler / main / DriverMkDepend.hs
index 410f5b1..c8fb955 100644 (file)
@@ -40,6 +40,7 @@ import Maybe            ( isJust )
 #if __GLASGOW_HASKELL__ <= 408
 import Panic           ( catchJust, ioErrors )
 #endif
+import ErrUtils         ( debugTraceMsg )
 
 -----------------------------------------------------------------
 --
@@ -54,7 +55,7 @@ doMkDependHS session srcs
        ; files <- beginMkDependHS dflags
 
                -- Do the downsweep to find all the modules
-       ; targets <- mapM GHC.guessTarget srcs
+       ; targets <- mapM (\s -> GHC.guessTarget s Nothing) srcs
        ; GHC.setTargets session targets
        ; excl_mods <- readIORef v_Dep_exclude_mods
        ; GHC.depanal session excl_mods
@@ -62,12 +63,10 @@ doMkDependHS session srcs
 
                -- Sort into dependency order
                -- There should be no cycles
-       ; let sorted = GHC.topSortModuleGraph False mod_summaries
+       ; let sorted = GHC.topSortModuleGraph False mod_summaries Nothing
 
                -- Print out the dependencies if wanted
-       ; if verbosity dflags >= 2 then
-               hPutStrLn stderr (showSDoc (text "Module dependencies" $$ ppr sorted))
-         else return ()
+       ; debugTraceMsg dflags 2 (showSDoc (text "Module dependencies" $$ ppr sorted))
                
                -- Prcess them one by one, dumping results into makefile
                -- and complaining about cycles