From: simonmar Date: Tue, 15 Oct 2002 13:20:18 +0000 (+0000) Subject: [project @ 2002-10-15 13:20:18 by simonmar] X-Git-Tag: Approx_11550_changesets_converted~1538 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=7370adc00c9de2092c2323c7a8e20902dc4bbe41;p=ghc-hetmet.git [project @ 2002-10-15 13:20:18 by simonmar] beginMake: separate out compilation-manager inputs from linkable objects in a way that is more consistent with the one-shot compilation mode. Specifically, we now pass anything that looks like a module name or a Haskell source filename to the compilation manager, and everything else to the linker. MERGE TO STABLE --- diff --git a/ghc/compiler/main/Main.hs b/ghc/compiler/main/Main.hs index 1fb9ece..fd84cf0 100644 --- a/ghc/compiler/main/Main.hs +++ b/ghc/compiler/main/Main.hs @@ -1,7 +1,7 @@ {-# OPTIONS -fno-warn-incomplete-patterns -optc-DNON_POSIX_SOURCE #-} ----------------------------------------------------------------------------- --- $Id: Main.hs,v 1.111 2002/09/13 15:02:35 simonpj Exp $ +-- $Id: Main.hs,v 1.112 2002/10/15 13:20:18 simonmar Exp $ -- -- GHC Driver program -- @@ -311,18 +311,22 @@ main = beginMake :: [String] -> IO () -beginMake fileish_args - = do let (objs, mods) = partition objish_file fileish_args - mapM_ (add v_Ld_inputs) objs - - case mods of - [] -> throwDyn (UsageError "no input files") - _ -> do dflags <- getDynFlags - state <- cmInit Batch - graph <- cmDepAnal state dflags mods - (_, ok_flag, _) <- cmLoadModules state dflags graph - when (failed ok_flag) (exitWith (ExitFailure 1)) - return () +beginMake fileish_args = do + -- anything that doesn't look like a Haskell source filename or + -- a module name is passed straight through to the linker + let (inputs, objects) = partition looks_like_an_input fileish_args + mapM_ (add v_Ld_inputs) objects + + case inputs of + [] -> throwDyn (UsageError "no input files") + _ -> do dflags <- getDynFlags + state <- cmInit Batch + graph <- cmDepAnal state dflags inputs + (_, ok_flag, _) <- cmLoadModules state dflags graph + when (failed ok_flag) (exitWith (ExitFailure 1)) + return () + where + looks_like_an_input m = haskellish_src_file m || looksLikeModuleName m beginInteractive :: [String] -> IO ()