-----------------------------------------------------------------------------
--- $Id: DriverPipeline.hs,v 1.82 2001/06/26 16:30:50 rrt Exp $
+-- $Id: DriverPipeline.hs,v 1.86 2001/07/03 16:46:21 rrt Exp $
--
-- GHC Driver
--
-----------------------------------------------------------------------------
-- GHC modes of operation
-data GhcMode
- = DoMkDependHS -- ghc -M
- | DoMkDLL -- ghc --mk-dll
- | StopBefore Phase -- ghc -E | -C | -S | -c
- | DoMake -- ghc --make
- | DoInteractive -- ghc --interactive
- | DoLink -- [ the default ]
- deriving (Eq)
-
-GLOBAL_VAR(v_GhcMode, error "todo", GhcMode)
-
modeFlag :: String -> Maybe GhcMode
modeFlag "-M" = Just $ DoMkDependHS
modeFlag "--mk-dll" = Just $ DoMkDLL
-- ToDo: switch away from using 'echo' altogether (but need
-- a faster alternative than what's done below).
-#if defined(mingw32_TARGET_OS) && defined(MINIMAL_UNIX_DEPS)
- else (do
+#if defined(mingw32_TARGET_OS)
+ else do
h <- openFile output_fn WriteMode
hPutStrLn h ("{-# LINE 1 \"" ++ input_fn ++ "\" #-}")
ls <- readFile input_fn -- inefficient, but it'll do for now.
-- ToDo: speed up via slurping.
hPutStrLn h ls
- hClose h) `catchAllIO`
- (\_ -> throwDyn (PhaseFailed "Ineffective C pre-processor" (ExitFailure 1)))
+ hClose h
#else
else do
SysTools.runSomething "Ineffective C pre-processor"
objs <- mapM odir_ify ofiles
+ -- Handle for file that accumulates dependencies
hdl <- readIORef v_Dep_tmp_hdl
-- std dependency of the object(s) on the source file