[project @ 2001-10-08 13:24:53 by simonmar]
[ghc-hetmet.git] / ghc / compiler / main / DriverPhases.hs
index 80c2b44..916c6bb 100644 (file)
@@ -1,5 +1,5 @@
 -----------------------------------------------------------------------------
--- $Id: DriverPhases.hs,v 1.4 2001/01/03 11:13:43 simonmar Exp $
+-- $Id: DriverPhases.hs,v 1.12 2001/08/15 09:32:40 rrt Exp $
 --
 -- GHC Driver
 --
@@ -7,15 +7,17 @@
 --
 -----------------------------------------------------------------------------
 
+#include "../includes/config.h"
+
 module DriverPhases (
    Phase(..),
    startPhase,         -- :: String -> Phase
    phaseInputExt,      -- :: Phase -> String
 
-   haskellish_file,
-   haskellish_suffix,
-   cish_file,
-   cish_suffix
+   haskellish_file, haskellish_suffix,
+   haskellish_src_file, haskellish_src_suffix,
+   objish_file, objish_suffix,
+   cish_file, cish_suffix
  ) where
 
 import DriverUtil
@@ -39,14 +41,18 @@ data Phase
        = MkDependHS    -- haskell dependency generation
        | Unlit
        | Cpp
-       | Hsc
+       | Hsc -- ToDo: HscTargetLang
        | Cc
        | HCc           -- Haskellised C (as opposed to vanilla C) compilation
        | Mangle        -- assembly mangling, now done by a separate script.
        | SplitMangle   -- after mangler if splitting
        | SplitAs
        | As
-       | Ln 
+       | Ln
+#ifdef ILX
+        | Ilx2Il
+       | Ilasm
+#endif
   deriving (Eq, Show)
 
 -- the first compilation phase for a given file is determined
@@ -75,10 +81,22 @@ phaseInputExt As          = "s"
 phaseInputExt SplitAs     = "split_s"   -- not really generated
 phaseInputExt Ln          = "o"
 phaseInputExt MkDependHS  = "dep"
+#ifdef ILX
+phaseInputExt Ilx2Il      = "ilx"
+phaseInputExt Ilasm       = "il"
+#endif
 
-haskellish_suffix = (`elem` [ "hs", "hspp", "lhs", "hc" ])
-cish_suffix       = (`elem` [ "c", "s", "S" ])  -- maybe .cc et al.??
+haskellish_suffix     = (`elem` [ "hs", "hspp", "lhs", "hc", "raw_s" ])
+haskellish_src_suffix = (`elem` [ "hs", "hspp", "lhs" ])
+cish_suffix           = (`elem` [ "c", "s", "S" ])  -- maybe .cc et al.??
 
-haskellish_file f = haskellish_suffix suf where (_,suf) = splitFilename f
-cish_file f       = cish_suffix suf       where (_,suf) = splitFilename f
+#if mingw32_TARGET_OS || cygwin32_TARGET_OS
+objish_suffix     = (`elem` [ "o", "O", "obj", "OBJ" ])
+#else
+objish_suffix     = (`elem` [ "o" ])
+#endif
 
+haskellish_file     = haskellish_suffix     . getFileSuffix
+haskellish_src_file = haskellish_src_suffix . getFileSuffix
+cish_file           = cish_suffix           . getFileSuffix
+objish_file         = objish_suffix         . getFileSuffix