[project @ 2003-01-09 10:49:21 by simonmar]
[ghc-hetmet.git] / ghc / compiler / main / Main.hs
index 677c8a3..abe7c01 100644 (file)
@@ -1,7 +1,7 @@
 {-# OPTIONS -fno-warn-incomplete-patterns -optc-DNON_POSIX_SOURCE #-}
 
 -----------------------------------------------------------------------------
--- $Id: Main.hs,v 1.116 2002/12/18 16:29:30 simonmar Exp $
+-- $Id: Main.hs,v 1.118 2003/01/09 10:49:21 simonmar Exp $
 --
 -- GHC Driver program
 --
@@ -27,8 +27,9 @@ import CompManager    ( cmInit, cmLoadModules, cmDepAnal )
 import HscTypes                ( GhciMode(..) )
 import Config          ( cBooterVersion, cGhcUnregisterised, cProjectVersion )
 import SysTools                ( getPackageConfigPath, initSysTools, cleanTempFiles )
-import Packages                ( showPackages, getPackageConfigMap )
-
+import Packages                ( showPackages, getPackageConfigMap, basePackage,
+                         haskell98Package
+                       )
 import DriverPipeline  ( staticLink, doMkDLL, genPipeline, pipeLoop )
 import DriverState     ( buildCoreToDo, buildStgToDo,
                          findBuildTag, 
@@ -333,7 +334,23 @@ beginMake fileish_args  = do
                    when (failed ok_flag) (exitWith (ExitFailure 1))
                    return ()
   where
-    looks_like_an_input m = haskellish_src_file m || '.' `notElem` m
+    {-
+      The following things should be considered compilation manager inputs:
+
+       - haskell source files (strings ending in .hs, .lhs or other 
+         haskellish extension),
+
+       - module names (not forgetting hierarchical module names),
+
+       - and finally we consider everything not containing a '.' to be
+         a comp manager input, as shorthand for a .hs or .lhs filename.
+
+      Everything else is considered to be a linker object, and passed
+      straight through to the linker.
+    -}
+    looks_like_an_input m =  haskellish_src_file m 
+                         || looksLikeModuleName m
+                         || '.' `notElem` m
 
 
 beginInteractive :: [String] -> IO ()