[project @ 2001-06-14 15:42:35 by simonpj]
[ghc-hetmet.git] / ghc / compiler / main / DriverPhases.hs
index 3a7053f..69840a3 100644 (file)
@@ -1,5 +1,5 @@
 -----------------------------------------------------------------------------
--- $Id: DriverPhases.hs,v 1.5 2001/02/27 12:36:37 rrt Exp $
+-- $Id: DriverPhases.hs,v 1.10 2001/06/14 15:42:35 simonpj Exp $
 --
 -- GHC Driver
 --
@@ -12,12 +12,14 @@ module DriverPhases (
    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
 
+#include "../includes/config.h"
+
 import DriverUtil
 
 -----------------------------------------------------------------------------
@@ -39,12 +41,9 @@ data Phase
        = MkDependHS    -- haskell dependency generation
        | Unlit
        | Cpp
-       | Hsc
+       | Hsc -- ToDo: HscTargetLang
        | Cc
        | HCc           -- Haskellised C (as opposed to vanilla C) compilation
-#ifdef ILX
-       | Ilx           -- .NET extended IL
-#endif
        | Mangle        -- assembly mangling, now done by a separate script.
        | SplitMangle   -- after mangler if splitting
        | SplitAs
@@ -72,9 +71,6 @@ phaseInputExt Cpp         = "lpp"     -- intermediate only
 phaseInputExt Hsc         = "hspp"
 phaseInputExt HCc         = "hc"
 phaseInputExt Cc          = "c"
-#ifdef ILX
-phaseInputExt Ilx         = "ilx"
-#endif
 phaseInputExt Mangle      = "raw_s"
 phaseInputExt SplitMangle = "split_s"  -- not really generated
 phaseInputExt As          = "s"
@@ -82,9 +78,17 @@ phaseInputExt SplitAs     = "split_s"   -- not really generated
 phaseInputExt Ln          = "o"
 phaseInputExt MkDependHS  = "dep"
 
-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