{-# OPTIONS -#include "hschooks.h" #-}
-----------------------------------------------------------------------------
--- $Id: DriverFlags.hs,v 1.52 2001/03/29 18:40:09 rrt Exp $
+-- $Id: DriverFlags.hs,v 1.53 2001/05/09 09:38:18 simonmar Exp $
--
-- Driver flags
--
, ( "odir" , HasArg (writeIORef v_Output_dir . Just) )
, ( "o" , SepArg (writeIORef v_Output_file . Just) )
, ( "osuf" , HasArg (writeIORef v_Object_suf . Just) )
+ , ( "hcsuf" , HasArg (writeIORef v_HC_suf . Just) )
, ( "hisuf" , HasArg (writeIORef v_Hi_suf) )
, ( "tmpdir" , HasArg (writeIORef v_TmpDir . (++ "/")) )
- , ( "ohi" , HasArg (\s -> case s of
- "-" -> writeIORef v_Hi_on_stdout True
- _ -> writeIORef v_Output_hi (Just s)) )
+ , ( "ohi" , HasArg (writeIORef v_Output_hi . Just) )
-- -odump?
, ( "keep-hc-file" , AnySuffix (\_ -> writeIORef v_Keep_hc_files True) )
-----------------------------------------------------------------------------
--- $Id: DriverPipeline.hs,v 1.67 2001/05/08 11:07:30 simonmar Exp $
+-- $Id: DriverPipeline.hs,v 1.68 2001/05/09 09:38:18 simonmar Exp $
--
-- GHC Driver
--
writeIORef v_Object_suf (Just "ilx")
#endif
osuf <- readIORef v_Object_suf
+ hcsuf <- readIORef v_HC_suf
let
----------- ----- ---- --- -- -- - - -
else do
let
- ----------- ----- ---- --- -- -- - - -
- myPhaseInputExt Ln = case osuf of Nothing -> phaseInputExt Ln
- Just s -> s
- myPhaseInputExt other = phaseInputExt other
+ -- .o and .hc suffixes can be overriden by command-line options:
+ myPhaseInputExt Ln | Just s <- osuf = s
+ myPhaseInputExt HCc | Just s <- hcsuf = s
+ myPhaseInputExt other = phaseInputExt other
annotatePipeline
:: [Phase] -- raw pipeline
-----------------------------------------------------------------------------
--- $Id: DriverState.hs,v 1.37 2001/03/28 11:01:19 simonmar Exp $
+-- $Id: DriverState.hs,v 1.38 2001/05/09 09:38:18 simonmar Exp $
--
-- Settings for the driver
--
| otherwise = HscC
GLOBAL_VAR(v_Output_dir, Nothing, Maybe String)
-GLOBAL_VAR(v_Object_suf, Nothing, Maybe String)
GLOBAL_VAR(v_Output_file, Nothing, Maybe String)
GLOBAL_VAR(v_Output_hi, Nothing, Maybe String)
+GLOBAL_VAR(v_Object_suf, Nothing, Maybe String)
+GLOBAL_VAR(v_HC_suf, Nothing, Maybe String)
+GLOBAL_VAR(v_Hi_suf, "hi", String)
+
GLOBAL_VAR(v_Ld_inputs, [], [String])
odir_ify :: String -> IO String
Just s -> return (newsuf s f)
-----------------------------------------------------------------------------
--- Hi Files
-
-GLOBAL_VAR(v_Hi_on_stdout, False, Bool)
-GLOBAL_VAR(v_Hi_suf, "hi", String)
-
------------------------------------------------------------------------------
-- Compiler optimisation options
GLOBAL_VAR(v_OptLevel, 0, Int)