Commit 02edb760 authored by simonmar's avatar simonmar
Browse files

[project @ 2001-05-09 09:38:18 by simonmar]

Add a new option: -hcsuf <suffix> which renames the .hc suffix to
<suffix> for this compilation, in the same way as -osuf and -hisuf.

To even things up, remove partial support for '-ohi -', which
allegedly dumped the .hi file to stdout but in reality never worked.
It's a strange thing to want to do anyway, but in any case you could
always say '-ohi /dev/stdout', or even 'ghc Foo.hs && cat Foo.hi'.
parent 3738f227
{-# 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
--
......@@ -206,11 +206,10 @@ static_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
--
......@@ -152,6 +152,7 @@ genPipeline todo stop_flag persistent_output lang filename
writeIORef v_Object_suf (Just "ilx")
#endif
osuf <- readIORef v_Object_suf
hcsuf <- readIORef v_HC_suf
let
----------- ----- ---- --- -- -- - - -
......@@ -209,10 +210,10 @@ genPipeline todo stop_flag persistent_output lang filename
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
--
......@@ -92,10 +92,13 @@ defaultHscLang
| 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
......@@ -112,12 +115,6 @@ osuf_ify f = do
Nothing -> return f
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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment