-----------------------------------------------------------------------------
--- $Id: DriverPhases.hs,v 1.1 2000/10/16 15:16:59 simonmar Exp $
+-- $Id: DriverPhases.hs,v 1.4 2001/01/03 11:13:43 simonmar Exp $
--
-- GHC Driver
--
| SplitAs
| As
| Ln
- deriving (Eq)
+ deriving (Eq, Show)
-- the first compilation phase for a given file is determined
-- by its suffix.
startPhase "lhs" = Unlit
startPhase "hs" = Cpp
+startPhase "hspp" = Hsc
startPhase "hc" = HCc
startPhase "c" = Cc
startPhase "raw_s" = Mangle
startPhase "s" = As
startPhase "S" = As
-startPhase "o" = Ln
+startPhase "o" = Ln
startPhase _ = Ln -- all unknown file types
-- the output suffix for a given phase is uniquely determined by
-- the input requirements of the next phase.
phaseInputExt Unlit = "lhs"
phaseInputExt Cpp = "lpp" -- intermediate only
-phaseInputExt Hsc = "cpp" -- intermediate only
+phaseInputExt Hsc = "hspp"
phaseInputExt HCc = "hc"
phaseInputExt Cc = "c"
phaseInputExt Mangle = "raw_s"
phaseInputExt Ln = "o"
phaseInputExt MkDependHS = "dep"
-haskellish_suffix = (`elem` [ "hs", "lhs", "hc" ])
+haskellish_suffix = (`elem` [ "hs", "hspp", "lhs", "hc" ])
cish_suffix = (`elem` [ "c", "s", "S" ]) -- maybe .cc et al.??
haskellish_file f = haskellish_suffix suf where (_,suf) = splitFilename f